mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
wip amazon payments donation
This commit is contained in:
parent
de32461787
commit
bade139b4b
2 changed files with 5 additions and 3 deletions
|
|
@ -152,7 +152,7 @@ function($rootScope, User, $http, Content) {
|
|||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Payments.amazonPayments.initWidgets = function(){
|
||||
var walletParams = {
|
||||
|
|
@ -193,6 +193,7 @@ function($rootScope, User, $http, Content) {
|
|||
|
||||
onPaymentSelect: function() {
|
||||
$rootScope.$apply(function(){
|
||||
console.log('Payment plan selected')
|
||||
Payments.amazonPayments.paymentSelected = true;
|
||||
});
|
||||
},
|
||||
|
|
@ -205,7 +206,7 @@ function($rootScope, User, $http, Content) {
|
|||
|
||||
Payments.amazonPayments.checkout = function(){
|
||||
if(Payments.amazonPayments.type === 'donation'){
|
||||
var url = '/amazon/checkout'
|
||||
var url = '/amazon/createOrderReferenceId'
|
||||
$http.post(url, {
|
||||
billingAgreementId: Payments.amazonPayments.billingAgreementId,
|
||||
gift: Payments.amazonPayments.gift
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ exports.createOrderReferenceId = function(req, res, next){
|
|||
|
||||
amzPayment.offAmazonPayments.createOrderReferenceForId({
|
||||
Id: req.body.billingAgreementId,
|
||||
IdType: 'BillingAgreement'
|
||||
IdType: 'BillingAgreement',
|
||||
ConfirmNow: false
|
||||
}, function(err, response){
|
||||
if(err) return next(err);
|
||||
if(!response.OrderReferenceDetails || !response.OrderReferenceDetails.AmazonOrderReferenceId){
|
||||
|
|
|
|||
Loading…
Reference in a new issue