You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var cred = {
username: 'mhamedhafsia06-facilitator_....',
password: 'hdfjgfj....',
signature: 'asdfasdf....'
};
var opts = {
sandbox: true,
version: '92.0'
};
var ec = new PayPalEC(cred, opts);
console.log("ec", ec);
var params = {
returnUrl: 'http://localhost:3000/confirm',
cancelUrl: 'http://localhost:3000/cancel',
SOLUTIONTYPE: 'sole',
PAYMENTREQUEST_0_AMT: '0.5',
PAYMENTREQUEST_0_DESC: 'Something',
PAYMENTREQUEST_0_CURRENCYCODE: 'USD',
PAYMENTREQUEST_0_PAYMENTACTION: 'Sale',
};
console.log("params", params);
ec.set(params, function(err, data) {
console.log("set");
console.log("");
console.log("errset", err);
console.log("data", data);
console.log("-------------------------");
console.log("");
// data[ 'PAYMENTURL' ] is the payment url which
// you should redirect your user to
});
// NOTE: you must set another `params` with the token
// you just get from PayPal
ec.get_details(params, function(err, data) {
// data contains all the payment details, let your
// user confirm this information
console.log("get_details");
console.log("");
console.log("get_details", err);
console.log("data2", data);
console.log("********************");
console.log("");
});
// NOTE: set the `params` to contain both the token
// and all the payment information
ec.do_payment(params, function(err, data) {
console.log("do_payment");
console.log("");
// really charge the user for the payment
console.log("do_payment", err);
console.log("data3", data);
console.log("////////////////////");
console.log("");
});
in do_payment i got [Error: Invalid token.]
but in set i go
The text was updated successfully, but these errors were encountered: