Commit ced66f2dc54fce04949660e16c69dd858853b22e
1 parent
4de569579d
Exists in
master
and in
1 other branch
minor changes
Showing
1 changed file
with
14 additions
and
10 deletions
Show diff stats
script.js
... | ... | @@ -589,12 +589,15 @@ |
589 | 589 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', |
590 | 590 | headers: {} |
591 | 591 | }).then(function mySuccess(searchResult) { |
592 | - if (searchResult.data[0].status == "pending") { | |
592 | + if (searchResult.data[0].status == "created") { | |
593 | 593 | $scope.checkView = true; |
594 | 594 | $scope.verifyView = false; |
595 | - $scope.amount = searchResult.data[0].amount * 100; | |
596 | - console.log('pending data', searchResult); | |
595 | + $scope.amount = searchResult.data[0].amount; | |
596 | + $scope.searchResult = searchResult.data[0]; | |
597 | + console.log('====searchResult===', searchResult); | |
598 | + console.log("searchResult=====",searchResult.data[0].razorOrderId) | |
597 | 599 | var i = 0; |
600 | + $scope.amount = $scope.amount * 100; | |
598 | 601 | var options = { |
599 | 602 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
600 | 603 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", |
... | ... | @@ -619,23 +622,24 @@ |
619 | 622 | var rzp1 = new Razorpay(options); |
620 | 623 | rzp1.open(); |
621 | 624 | $scope.paymentResponse = {}; |
622 | - | |
623 | 625 | function createPayment(response) { |
624 | - console.log("response",response); | |
626 | + $scope.amount = $scope.amount / 100; | |
627 | + console.log("response======retepaymen",response); | |
625 | 628 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
626 | - $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | |
629 | + $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; | |
627 | 630 | $scope.paymentResponse.amount = $scope.amount; |
628 | - $scope.paymentResponse.currency = "INR"; | |
629 | - $scope.paymentResponse.status = "captured"; | |
630 | - $scope.paymentResponse.applicantId = $scope.userId; | |
631 | + $scope.paymentResponse.currency = $scope.searchResult.currency; | |
632 | + $scope.paymentResponse.status = $scope.searchResult.status; | |
633 | + $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; | |
631 | 634 | console.log("$scope.paymentResponse", $scope.paymentResponse) |
632 | 635 | $http({ |
633 | 636 | method: 'PUT', |
634 | - url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, | |
637 | + url: BASE_URL + '/payments/' + $scope.searchResult.id, | |
635 | 638 | data: $scope.paymentResponse, |
636 | 639 | headers: {} |
637 | 640 | }).then(function mySuccess(searchResult) { |
638 | 641 | console.log("finalsearchResult",searchResult) |
642 | + $location.path("/confirmation") | |
639 | 643 | }, function myError(error) { |
640 | 644 | |
641 | 645 | }); | ... | ... |