Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Reasons for Sale Object having a state of 'pending' after executing a payment via REST API #402

Open
theyuv opened this issue Nov 28, 2019 · 1 comment
Labels

Comments

@theyuv
Copy link

theyuv commented Nov 28, 2019

  • SDK/Library version: 1.14.0
  • Environment: Production
  • Language, language version, and OS: java 1.8.0_181

I execute payments using the REST API similar to what's outlined here:
https://developer.paypal.com/docs/api/quickstart/payments/#execute-payment

It has come to my attention that while the state of the Payment Object returned by the execute method is approved, the state of the Sale Object is pending in some cases.

Payment createdPayment = payment.execute(apiContext, paymentExecution);
createdPayment.getState() // approved

createdPayment.getTransactions().get(0)
                .getRelatedResources().get(0)
                .getSale().getState(); // pending

I'm wondering what are the causes for the Sale Object having a state of pending?
(If I know the reason I can alert the users as to how to fix this issue, since I can't accept payments that aren't fully complete).

Thanks.

@theyuv theyuv changed the title Possible Webhooks events after a Payment is created, approved and executed Reasons for Sale Object having a state of 'pending' after executing a payment via REST API Nov 28, 2019
@prakash-gangadharan
Copy link

Hi @theyuv, Please refer Show sale details API you can check the reason_code in the response which describes why the transaction state is pending or reversed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants