Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain paypal payment flow: RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION #12

Open
alisacorporation opened this issue Nov 12, 2024 · 3 comments

Comments

@alisacorporation
Copy link

alisacorporation commented Nov 12, 2024

Im testing in sandbox environment, using ngrok to local website, webhook's is coming all is good.. But I do not understand maybe fully flow of paypal payments.

  1. Buyer fill form
  2. Order created
  3. Buyer redirected to order approve link
  4. Buyer complete purchase
  5. Webhook is sent to server: CHECKOUT.ORDER.APPROVED
  6. Server captures order
  7. what should happens next, webhook notification with CHECKOUT.ORDER.COMPLETED ???
  8. also should i do something with payment from paymentOrderController?

now after i capture the order, i got status: PENDING and reason: RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION

So can someone please explain paypal payment flow and what that reason means? Thanks!

@alisacorporation
Copy link
Author

DEBUG - 2024-11-12 05:00:28 --> App\Libraries\Payment\Paypal\Paypal::processWebhook [$status]: APPROVED
INFO - 2024-11-12 05:00:28 --> Request Post https://api-m.sandbox.paypal.com/v1/oauth2/token 
INFO - 2024-11-12 05:00:28 --> Response 200  application/json
INFO - 2024-11-12 05:00:28 --> Request Post https://api-m.sandbox.paypal.com/v2/checkout/orders/62L9668634216261V/capture application/json
INFO - 2024-11-12 05:00:29 --> Response 201 1365 application/json
DEBUG - 2024-11-12 05:00:29 --> App\Libraries\Payment\Paypal\Paypal::processWebhook [APPROVED][ordersCapture]: 
DEBUG - 2024-11-12 05:00:29 --> App\Libraries\Payment\Paypal\Paypal::processWebhook [APPROVED:$result]: stdClass Object
(
    [id] => 62L9668634216261V
    [status] => COMPLETED
    [payment_source] => stdClass Object
        (
            [paypal] => stdClass Object
                (
                    [email_address] => [email protected]
                    [account_id] => H4KW28QZX2VKG
                    [account_status] => VERIFIED
                    [name] => stdClass Object
                        (
                            [given_name] => John
                            [surname] => Doe
                        )

                    [address] => stdClass Object
                        (
                            [country_code] => LV
                        )

                )

        )

    [purchase_units] => Array
        (
            [0] => stdClass Object
                (
                    [reference_id] => 4037
                    [payments] => stdClass Object
                        (
                            [captures] => Array
                                (
                                    [0] => stdClass Object
                                        (
                                            [id] => 4NP3318314834664N
                                            [status] => PENDING
                                            [status_details] => stdClass Object
                                                (
                                                    [reason] => RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION
                                                )

                                            [amount] => stdClass Object
                                                (
                                                    [currency_code] => EUR
                                                    [value] => 22.00
                                                )

                                            [final_capture] => 1
                                            [seller_protection] => stdClass Object
                                                (
                                                    [status] => ELIGIBLE
                                                    [dispute_categories] => Array
                                                        (
                                                            [0] => ITEM_NOT_RECEIVED
                                                            [1] => UNAUTHORIZED_TRANSACTION
                                                        )

                                                )

                                            [custom_id] => dec0d0d7
                                            [links] => Array
                                                (
                                                    [0] => stdClass Object
                                                        (
                                                            [href] => https://api.sandbox.paypal.com/v2/payments/captures/4NP3318314834664N
                                                            [rel] => self
                                                            [method] => GET
                                                        )

                                                    [1] => stdClass Object
                                                        (
                                                            [href] => https://api.sandbox.paypal.com/v2/payments/captures/4NP3318314834664N/refund
                                                            [rel] => refund
                                                            [method] => POST
                                                        )

                                                    [2] => stdClass Object
                                                        (
                                                            [href] => https://api.sandbox.paypal.com/v2/checkout/orders/62L9668634216261V
                                                            [rel] => up
                                                            [method] => GET
                                                        )

                                                )

                                            [create_time] => 2024-11-12T03:00:28Z
                                            [update_time] => 2024-11-12T03:00:28Z
                                        )

                                )

                        )

                )

        )

    [payer] => stdClass Object
        (
            [name] => stdClass Object
                (
                    [given_name] => John
                    [surname] => Doe
                )

            [email_address] => [email protected]
            [payer_id] => H4KW28QZX2VKG
            [address] => stdClass Object
                (
                    [country_code] => LV
                )

        )

    [links] => Array
        (
            [0] => stdClass Object
                (
                    [href] => https://api.sandbox.paypal.com/v2/checkout/orders/62L9668634216261V
                    [rel] => self
                    [method] => GET
                )

        )

)

@LeonarthusMectus
Copy link

Hey @alisacorporation

This is a good question. I had to dig a bit myself to find the answer. If you head here in the docs (via the navigation bar on the left Orders -> Definitions -> Purchase Unit), you can drill down further going through Payments -> Captures -> Status Details which lists the values and some common reasons.

In this case it's as follows:

RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION

The payee has not yet set up appropriate receiving preferences for their account. 
For more information about how to accept or deny this payment, visit your account online. 
This reason is typically offered in scenarios such as when the currency of the captured payment 
is different from the primary holding currency of the payee.

This seems to indicate that you've captured a payment in a currency outside the receiving preferences for your account (as the payee). For more help with your account setup, you'll need to reach out directly to support as our team doesn't have access to you or anyone's account, and can't view it's configuration or any related detail nor have we the knowledge to make any changes.

@alisacorporation
Copy link
Author

Thank you and sorry for long response time.

It is not my account I'm implementing for friend and it's payments preference looks like this which is good i think.

2024-11-17_23-17_paypal_preference_payment

That yellow note seems warning of something related to my problem.. Will investigate that links to get more info. Currently Paypal V1 is working good on that account but we are trying to migrate to V2.

Sadly that I can't just write support ticket to paypal..

Thanks for you time!

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

No branches or pull requests

2 participants