Paypal Buttons - No Money Actually Moved or any sign of transaction other than API logs

djtekkii
New Community Member

Hello, I am trying to integrate Paypal buttons onto my website so that visitors can pay our business through Paypal for the cart total based on the items they've purchased.

 

I am using PHP, HTML, and of course Javascript.

I included this script first:

 

<script src="https://www.paypal.com/sdk/js?client-id=MY_CLIENT_ID&currency=USD"></script>

 

I replaced "MY_CLIENT_ID" with my actual client ID, it's replaced above for obvious reasons.

Next, I included this code:

 

<script>

// Render the PayPal button into #paypal-button-container
paypal.Buttons({

createOrder: function(data, actions) {
return actions.order.create({
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": getAmount()
},
"description": "Test description"
}
]
});
},</script>

 

The function "getAmount()" receives the cart total.

My "onApprove" script simply redirects the user to another page, but that hasn't been included here.

 

The PayPal buttons appear just fine:

image.png

 

Clicking on the PayPal button also appears to bring up the correct window:

image.png

 

I log in with a Sandbox account (the default personal account that is provided in Sandbox mode) and then use the PayPal balance to make the transaction. In the Sandbox account, under the Funding tab, it says that there is a $5,000 PayPal balance on that account.

 

After signing in and choosing to pay with that account, everything goes through seemingly fine and the page redirects like it's supposed to from the onApprove action.

 

Here's the problem, no funds are subtracted from the Sandbox's Funding account.

 

When I tried this with a live client key and used a real credit card, I was never charged and my account never said it received the payment. This was despite the onApprove running and the popup window seemingly processing everything fine.

 

Even further, I can see information in the API event logs:

image.png

What am I missing?

 

Thanks,

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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