wip amazon payments donation

This commit is contained in:
Matteo Pagliazzi 2015-07-12 23:43:10 +02:00
parent de32461787
commit bade139b4b
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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){