Any time I try to make a test credit card payment, it says that the address is invalid

benh2
New Community Member

No matter what I put in for the address, it says it's invalid. It is connecting to the sandbox

 

Screenshot 2020-04-21 at 20.54.35.png

 

My code is:

 

 

paypal.Buttons({
style: {
layout: "horizontal"
},
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
purchase_units: [{
description: "(Description)",
amount: {
value: $("#Amount").val(),
"currency_code": "USD",
}
}],
"application_context" : {
"shipping_preference":"NO_SHIPPING"
}
});


},
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(function(details) {
console.log(details);
// This function shows a transaction success message to your buyer.
alert(\'Transaction completed by \' + details.payer.name.given_name);
});
}
}).render(\'#paypal-button\');

}, true);
});

 

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Sandbox Community.

Can you please provide your merchant id for your sandbox account?

I will review the error messages in our sandbox logs and see if there is a setting that needs to be updated.

Thank you,

Jenifer

PayPal

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.