Reputation: 2261
I am trying to integrate PayPal on our site where we allow Merchants to connect their account using PayPal Connect. Once I have Merchants Access Token I fetch their account id which I use as merchant-id to process payment directly to their account.
In front-end I have used link to allow Customers to pay to the Merchants. I generate the order Id on the backend using following body and I return this orderId to the front end :
request.requestBody({
intent: 'CAPTURE',
purchase_units: [{
amount: {
currency_code: currency,
value: amount
},
payee: {
merchant_id: accountId
}
}]
});
After the customer makes the payment, I receive CHECKOUT.ORDER.APPROVED
webhook notification on which I try to CAPTURE
the order by using the order Id and get the following response
Paypal order capture COMPLETED
but purchase_units[0].payments.capture[0].status
is PENDING
When I see the customer sandbox account who made the payment I see a entry for -3000 INR waiting for seller to claim.
In my developer account under Notifications I do see the Merchant getting a notification to claim the amount.
but when I login in my Merchant Sandbox Account I don't see any activity. Even after capturing the order the total amount still remains unchanged.
on Front-End I have passed following parameters to the script
https://www.paypal.com/sdk/js?client-id=abcd¤cy=INR&intent=capture&merchant-id=ABCDEFGHIJKLI
I am using Node JS in the backend with @paypal/checkout-server-sdk
Upvotes: 4
Views: 3044
Reputation: 30359
The reason for pending says 'UNILATERAL'.
You are apparently processing a payment in sandbox mode, to a sandbox receiver email or merchantID that does not currently correspond to any account, or that is not confirmed on the account. You would need to create a sandbox Business account with that email address, or add and confirm it with an existing account in that Sandbox business account's https://www.sandbox.paypal.com interface, in order to accept the payment in Sandbox.
If it exists on an account in https://www.sandbox.paypal.com/businessprofile/settings/email but is not confirmed (likely due to a Sandbox bug during the period you created this account), send a new confirmation message and confirm it via https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fnotifications%2F
By the way, INR payments can only be sent by India buyers. Payers from outside India cannot complete INR checkouts, this currency is restricted.
Upvotes: 3