◎위챗 : speedseoul
https://github.com/totaljs/node-paypal-express-checkout/issues/24
Hello @petersirka ,
I have solved issue for shipping charges.
Just added -params.PAYMENTREQUEST_0_SHIPPINGAMT = data.PAYMENTREQUEST_0_SHIPPINGAMT;
line in Paypal.prototype.getExpressCheckoutDetails method.
Paypal.prototype.getExpressCheckoutDetails = function(token, doPayment, callback) {
var self = this;
var params = self.params();
params.TOKEN = token;
params.METHOD = 'GetExpressCheckoutDetails';
self.request(self.url, 'POST', params, function(err, data) {
if (err) {
callback(err, data);
return;
}
if (!doPayment) {
return callback(null, data);
}
var params = self.params();
params.PAYMENTACTION = 'Sale';
params.PAYERID = data.PAYERID;
params.TOKEN = token;
params.PAYMENTREQUEST_0_AMT = data.PAYMENTREQUEST_0_AMT;
params.PAYMENTREQUEST_0_CURRENCYCODE = data.PAYMENTREQUEST_0_CURRENCYCODE;
params.PAYMENTREQUEST_0_ITEMAMT = data.PAYMENTREQUEST_0_ITEMAMT;
params.PAYMENTREQUEST_0_SHIPPINGAMT = data.PAYMENTREQUEST_0_SHIPPINGAMT;
params.METHOD = 'DoExpressCheckoutPayment';
self.request(self.url, 'POST', params, function(err, data2) {
if (err) {
callback(err, data2);
return;
}
if (data.ACK !== 'Success') {
return callback(new Error('Error DoExpressCheckoutPayment'), data2);
}
// Combine results of getExpressCheckout and DoExpress checkout payment.
callback(null, _.extend(data, data2));
});
});
return self;
};