How to approve order from response links of create order api using paypal's javascript sdk?

yousufkhankorai
Contributor
Contributor

I am trying to implement paypal advanced credit and debit cards payments using javascript sdk on client side. I am using the following example as reference https://developer.paypal.com/docs/business/checkout/advanced-card-payments/services.

I have created the order, got links as response, how to approve the order using the approve url link as the user is using credit card details for payment without paypal login before performing order capture. 

I know that it is not best approach for this implementation. firstly i want to try out this example as given in paypal docs.i will implement it in server side later to avoid security vulnerabilities.

 

Code Place in Reply Box.

 

 

Login to Me Too
2 REPLIES 2

yousufkhankorai
Contributor
Contributor

after executing above snippet, getting this as response

{name: "UNPROCESSABLE_ENTITY", details: [{issue: "ORDER_NOT_APPROVED",…}],…} debug_id: "a63fbc3806995" details: [{issue: "ORDER_NOT_APPROVED",…}] 0: {issue: "ORDER_NOT_APPROVED",…} links: [{href: "https://developer.paypal.com/docs/api/orders/v2/#error-ORDER_NOT_APPROVED",…}] 0: {href: "https://developer.paypal.com/docs/api/orders/v2/#error-ORDER_NOT_APPROVED",…} message: "The requested action could not be performed, semantically incorrect, or failed business validation." name: "UNPROCESSABLE_ENTITY

Login to Me Too

MTS_Justin
Moderator
Moderator
Hello,

You're receiving that response as the order hasn't been approved.

The buyer needs to be re-directed to the approval URL, where they will get the option to login to an account to approve the payment or where available, pay using debit/credit card without using an account.

(note : guest checkout is not a payment method which is guaranteed to be available for every buyer checkout session)

Thanks !

Was my post helpful? If so, please give me a kudos!
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.