Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal Missing Payer Address with Orders API V2 / Sandbox

I am setting up a payment integration with PayPal Checkout Buttons and Paypal Orders API V2, which I test in the sandbox environment (no fancy shop system in use).

When an order is paid and status is completed, the Paypal Orders API V2 returns a valid response, but I do not completely receive the payer address from my sandbox buyer account.

Payer looks like this:

 "payer": {
        "name": {
            "given_name": "<given_name>",
            "surname": "<surname>"
        },
        "email_address": "<email>",
        "payer_id": "HEU6X43KU231",
        "address": {
            "country_code": "DE"
        }
    }

but the payer definition says that the payer should also contain:

  • address_line_1,
  • address_line_2,
  • admin_area_1,
  • postal code

I would like to use this information to send an invoice to the customer after payment is completed.

First, I thought, the address information is not available in my sandbox buyer account, because you do not find this information in the paypal dashboard (in the details of the respective sandbox account), but the address information is available at https://www.sandbox.paypal.com/businessprofile/settings/address

The whole thing would work with a shipping address, but this look like conceptual mismatch. My order item has the "category": 'DIGITAL_GOODS' and I've set the "shipping_preference": 'NO_SHIPPING', because I sell a digital product, which is automatically delivered after the payment process.

As a workaround I could also ask for the address information in the dialog in our part of the order process (in our GUI, before checkout), and prefill the paypal payment dialog with the userdata entered in our GUI, but in terms of user experience I would prefer to use the paypal data.

Does someone have a clue how to receive the payer address data?

Thanks a lot in advance

like image 762
Stefan Avatar asked Nov 14 '19 16:11

Stefan


People also ask

Is sandbox PayPal different from PayPal?

The PayPal sandbox mirrors the features on the PayPal production servers. While some PayPal features do not apply to the sandbox, such as closing an account, issuing monthly statements, storing shipping preferences, and PayPal Shops support, the sandbox has the same PayPal API feature set as the live environment.

How do I check my sandbox account on PayPal?

Once you're logged in, look under the Sandbox section in the lefthand menu and click Accounts. PayPal will have already created two test accounts for you: one for a Business account and one for a Personal account.


1 Answers

I will get the documentation clarified.

But to just answer your question, by default the address of the payer is not shared, just the country_code - to get the complete payer.address you will need to call your account manager or merchant support and they can enable it for your account if you meet their criteria.

like image 152
Rahul Dighe Avatar answered Sep 28 '22 01:09

Rahul Dighe