Orders API V2 - Formatting shipping address

GeoffD3
Contributor
Contributor

I am currently upgrading from an implementation that used PHP and checkout.js to the Javascript SDK and Orders API V2. In the previous implementation I used paypal-response-wrapper.php (which I think I got from github) that provided a function getAddress() that returned the shipping address in the correct format for label printing taking into account each countries address formatting rules.

 

I have looked for something similar for the Orders V2 response but without success. As this must be a common requirement has anyone found something that could save me re-inventing the wheel? Thanks.

Login to Me Too
1 REPLY 1

GeoffD3
Contributor
Contributor

I have updated the original code to match the Orders API V2 response. It seems to work OK for me but no guarantees.

paypal-response-wrapper-v2.php 

 

 

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.