Repository navigation
fix: Request NO_SHIPPING from PayPal for digital-only orders - #1537
dgupta4-godaddy wants to merge 7 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: ee4839e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
pbennett1-godaddy
left a comment
There was a problem hiding this comment.
A few inline notes below. One broader point: the cause seems to be in use-build-payment-request.ts (around line 243, which isn't in this diff). buildPaymentRequests always builds a shippingAddress and fills in country_code from the session origin, even when the order has no shipping address. Leaving out shipping there when order.shipping.address.addressLine1 is missing, and choosing NO_SHIPPING from that, would cover pickup, digital, purchase mode and any future fulfillment mode in one place. Without that, every caller of payPalRequest has to repeat this exception.
Omit PayPal shipping when the order has no street address and decide the shipping preference from the delivery method read after the checkout flush, covering pickup, digital and purchase-mode orders. Co-authored-by: Cursor <cursoragent@cursor.com>
…dgupta4-godaddy/javascript into paypal-digital-only-no-shipping
|
Thanks @pbennett1-godaddy, all addressed in 1aa2874. PayPal shipping is now left out at the source when the order has no street address. createOrder reads deliveryMethod after the flush and sends NO_SHIPPING unless it's a SHIP order with an address, which covers digital, pickup and purchase mode as you suggested. |
Summary
isDigitalOnlyOrdershipping_preference: NO_SHIPPINGso PayPal no longer rejects digital checkout withPOSTAL_CODE_REQUIREDChangeset
Test Plan
purchase_units[].shippingand usesNO_SHIPPINGSET_PROVIDED_ADDRESSand includes shipping