Rest | 400 | PAYMENT_NOT_APPROVED_FOR_EXECUTION

OmedaUser
Contributor
Contributor

I am trying to create a program in Java which would create and execute the payment without any user interaction. I have created 2 methods, one for creating payment and another for executing the payment. The create payment method works fine and returns a payment Id. I am passing this created payment Id and a constant payer Id to execute payment method. While executing payment, I am getting this error. 

name: PAYMENT_NOT_APPROVED_FOR_EXECUTION message: Payer has not approved payment

Later I found that Execute payment call works only after a customer has approved the payment.

Is there any way to approve the payment in Java without any user interaction ? 

Login to Me Too
1 REPLY 1

haroldpogix3m
Contributor
Contributor

I was able to do this without User Interaction.

First I recorded the result of payment execute.

Once I have that, I used nock to intercept the payment execute and have the return result equal to the one I recorded earlier.

Hope it helps

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.