daslicht
daslicht

Reputation: 823

PayPal\Api\Payment - getState()

I have a question regarding states:

The API says the following:

getState( ) The state of the payment, authorization, or order transaction. The value is:

–––

What does approved actually mean ?

Is the money already on my PayPal account ?

Can it be canceled by the Payer after the status is approved (fraud) ?

The question is now, is it safe to ship the product when the status is approved?

Is that enough or do I need to use a Webhook or IPN ?

Here is an example response for my current sandbox setup: https://gist.github.com/daslicht/795dceae24740d5ca3330cd2066c38bb

And then here: https://gist.github.com/daslicht/795dceae24740d5ca3330cd2066c38bb#file-gistfile1-txt-L65 There is another state which says "completed"

~ Marc

Upvotes: 0

Views: 253

Answers (1)

daslicht
daslicht

Reputation: 823

Finally Paypal Answered my Question:

The "approved" state just means the buyer logged into their account and approved the payment. You still need to execute the payment request, which once you do check the "state" shown in the "related_resources" section and it should say "completed", which indicates the transaction amount has been captured. The "id" shown below is the transaction identifier.

"related_resources": [
            {
                "sale": {
                    "id": "6CP443382P136134L",
                    "state": "completed",
                    "amount": {
                        "total": "7.47",
                        "currency": "USD",

Hope that helps someone else and saves time waiting for a response from paypal

Upvotes: 0

Related Questions