cancel
Showing results for 
Search instead for 
Did you mean: 

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

Options
yousufkhankorai
Contributor
Posted on

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.

 

 

2 REPLIES 2

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

Options
yousufkhankorai
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

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

Options
MTS_Justin
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!

Haven't Found your Answer?

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