Commit d4f6eab76f9f5645e1cf93ab040969ff9937429f
1 parent
e7202f14e2
Exists in
paytm
paytm integration
Showing
2 changed files
with
74 additions
and
56 deletions
Show diff stats
pages/registration.html
1 | + | |
1 | 2 | <div class="header"> |
2 | 3 | <div> |
3 | 4 | <!-- <img src="images/LOGO.png" class="logojalsa"><span class="jalsaheadr" style="">2018</span> --> |
... | ... | @@ -7,9 +8,11 @@ |
7 | 8 | </div> |
8 | 9 | <!-- CLOSE HEADER --> |
9 | 10 | <form name="applicantForm"> |
11 | + | |
10 | 12 | <div class="col-xs-12 col-md-8 col-md-offset-2"> |
11 | 13 | <div class="form-all"> |
12 | 14 | <h4 class="title">General Information</h4> |
15 | + <p></p> | |
13 | 16 | <!-- <table style="width: 100%;"> |
14 | 17 | <tr> |
15 | 18 | <td> | ... | ... |
script.js
... | ... | @@ -65,8 +65,8 @@ |
65 | 65 | |
66 | 66 | }]).run(['Analytics', function(Analytics) { }]); |
67 | 67 | |
68 | - scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") | |
69 | - //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") | |
68 | + // scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") | |
69 | + scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") | |
70 | 70 | |
71 | 71 | // create the controller and inject Angular's $scope |
72 | 72 | scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { |
... | ... | @@ -604,7 +604,10 @@ |
604 | 604 | $scope.formPage = false; |
605 | 605 | $scope.current = 0; |
606 | 606 | $scope.payingAmnt = 0; |
607 | - $scope.discountAmount = 0; | |
607 | + $scope.discountAmount = 0; | |
608 | + $scope.approvedMsg = false; | |
609 | + $scope.disApprovedMsg = false; | |
610 | + | |
608 | 611 | // $scope.data.quantity = "1"; |
609 | 612 | $scope.check = false; |
610 | 613 | $scope.numberCheck = false; |
... | ... | @@ -613,7 +616,18 @@ |
613 | 616 | "amount": $scope.payingAmnt, |
614 | 617 | "currency": "INR", |
615 | 618 | "status": "pending" |
616 | - } | |
619 | + } | |
620 | + var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] | |
621 | + console.log(window.location.href,"myParam",myParam) | |
622 | + if(myParam){ | |
623 | + if(myParam == "approved"){ | |
624 | + $scope.showResponse = true; | |
625 | + }else{ | |
626 | + $scope.disApprovedMsg = true; | |
627 | + } | |
628 | + }else{ | |
629 | + $scope.disApprovedMsg = true; | |
630 | + } | |
617 | 631 | |
618 | 632 | $scope.removeError = function() { |
619 | 633 | $('#invalidEmail').css('display', 'none'); |
... | ... | @@ -794,61 +808,62 @@ |
794 | 808 | data: data, |
795 | 809 | headers: {} |
796 | 810 | }).then(function mySuccess(paymentResult) { |
797 | - $scope.paymentResult = paymentResult; | |
798 | - }, function myError(error) { | |
799 | - }); | |
800 | - } | |
801 | - var i = 0; | |
802 | - $scope.payingAmnt = $scope.payingAmnt * 100; | |
803 | - var options = { | |
804 | - //"key": "rzp_test_YwHsVFiDIQ2WUQ", | |
805 | - "key": "rzp_live_mkmCb4FkstuWaS", | |
806 | - "amount": $scope.payingAmnt, | |
807 | - | |
808 | - "name": "Startup Jalsa", | |
809 | - "description":"amount", | |
810 | - "currency": "INR", | |
811 | - "status": "done", | |
812 | - | |
813 | - "prefill": { | |
814 | - "email": $scope.detail.email, | |
815 | - "contact": $scope.detail.phone | |
816 | - }, | |
817 | - | |
818 | - "theme": { | |
819 | - "color": "#2196f3 ", | |
820 | - "image_padding":"NO" | |
821 | - }, | |
822 | - "modal": { | |
823 | - "ondismiss": function(){ | |
824 | - } | |
825 | - }, | |
826 | - "handler": function (response){ | |
827 | - createPayment(response); | |
828 | - } | |
829 | - }; | |
830 | - var rzp1 = new Razorpay(options); | |
831 | - rzp1.open(); | |
832 | - $scope.paymentResponse = {}; | |
833 | - function createPayment(response){ | |
834 | - console.log("response12333333",response) | |
835 | - $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | |
836 | - $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | |
837 | - $scope.paymentResponse.amount = data.amount; | |
838 | - $scope.paymentResponse.currency = "INR"; | |
839 | - $scope.paymentResponse.status = $scope.paymentResult.data.status; | |
840 | - console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) | |
841 | - $http({ | |
842 | - method: 'PUT', | |
843 | - url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | |
844 | - data: $scope.paymentResponse, | |
845 | - headers: {} | |
846 | - }).then(function mySuccess(searchResult) { | |
847 | - console.log("searchResult",searchResult) | |
848 | - $location.path("/confirmation") | |
811 | + console.log("paymentResult",paymentResult.data.data) | |
812 | + $("p").html(paymentResult.data.data) | |
849 | 813 | }, function myError(error) { |
850 | 814 | }); |
851 | 815 | } |
816 | + // var i = 0; | |
817 | + // $scope.payingAmnt = $scope.payingAmnt * 100; | |
818 | + // var options = { | |
819 | + // //"key": "rzp_test_YwHsVFiDIQ2WUQ", | |
820 | + // "key": "rzp_live_mkmCb4FkstuWaS", | |
821 | + // "amount": $scope.payingAmnt, | |
822 | + | |
823 | + // "name": "Startup Jalsa", | |
824 | + // "description":"amount", | |
825 | + // "currency": "INR", | |
826 | + // "status": "done", | |
827 | + | |
828 | + // "prefill": { | |
829 | + // "email": $scope.detail.email, | |
830 | + // "contact": $scope.detail.phone | |
831 | + // }, | |
832 | + | |
833 | + // "theme": { | |
834 | + // "color": "#2196f3 ", | |
835 | + // "image_padding":"NO" | |
836 | + // }, | |
837 | + // "modal": { | |
838 | + // "ondismiss": function(){ | |
839 | + // } | |
840 | + // }, | |
841 | + // "handler": function (response){ | |
842 | + // createPayment(response); | |
843 | + // } | |
844 | + // }; | |
845 | + // var rzp1 = new Razorpay(options); | |
846 | + // rzp1.open(); | |
847 | + // $scope.paymentResponse = {}; | |
848 | + // function createPayment(response){ | |
849 | + // console.log("response12333333",response) | |
850 | + // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | |
851 | + // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | |
852 | + // $scope.paymentResponse.amount = data.amount; | |
853 | + // $scope.paymentResponse.currency = "INR"; | |
854 | + // $scope.paymentResponse.status = $scope.paymentResult.data.status; | |
855 | + // console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) | |
856 | + // $http({ | |
857 | + // method: 'PUT', | |
858 | + // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | |
859 | + // data: $scope.paymentResponse, | |
860 | + // headers: {} | |
861 | + // }).then(function mySuccess(searchResult) { | |
862 | + // console.log("searchResult",searchResult) | |
863 | + // $location.path("/confirmation") | |
864 | + // }, function myError(error) { | |
865 | + // }); | |
866 | + // } | |
852 | 867 | //} |
853 | 868 | |
854 | 869 | }, function myError(error) { | ... | ... |