How can one get payers billing address ?

smanish88
Contributor
Contributor

I have done paypal integration on sandbox environment. 

I have used java sdk for that - https://developer.paypal.com/docs/api/quickstart/payments/#execute-payment

Following apis are used by sdk there

To get payment data - https://api.sandbox.paypal.com/v1/payments/payment/{PAYMENT-ID} 

To approve payment by user - https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token={TOKEN} 

To get sale data - https://api.sandbox.paypal.com/v1/payments/sale/{ID} 

 

The first api provide "shipping_address". If I wish to get billing address of the user, how could I get it?

Login to Me Too
2 REPLIES 2

shawnz
Contributor
Contributor

It looks like the payments v1 GET API returns the billing address in the "payer.funding_instruments[].credit_card.billing_address" field.

 

See: https://developer.paypal.com/docs/api/payments/v1/#payment_get , https://developer.paypal.com/docs/api/payments/v1/#definition-credit_card .

 

Do you have that field in your response?

Login to Me Too

smanish88
Contributor
Contributor

These attributes are null

createdPayment.getPayer().getPayerInfo().getBillingAddress()

createdPayment.getPayer().getFundingInstruments()

 

Could it be due to sandbox environment?

 

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.