Skip to content

fix(types): add shipping address change errors#942

Open
jdjioe5-cpu wants to merge 2 commits into
paypal:mainfrom
jdjioe5-cpu:fix-shipping-address-change-types
Open

fix(types): add shipping address change errors#942
jdjioe5-cpu wants to merge 2 commits into
paypal:mainfrom
jdjioe5-cpu:fix-shipping-address-change-types

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Summary

Fixes #824 by updating the onShippingAddressChange button callback types to match the documented JavaScript SDK shape:

  • adds data.errors with the documented shipping address error keys
  • updates actions.reject to accept an error message string
  • adds a type test that rejects unsupported countries with data.errors.COUNTRY_ERROR

PayPal docs reference: https://developer.paypal.com/docs/regional/th/checkout/reference/customize-sdk/#onshippingaddresschange

Validation

npx prettier --check packages/paypal-js/types/components/buttons.d.ts packages/paypal-js/types/tests/buttons.test.ts
npm run typecheck --workspace=@paypal/paypal-js
npm run lint --workspace=@paypal/paypal-js
git diff --check

@jdjioe5-cpu
jdjioe5-cpu requested a review from a team as a code owner June 3, 2026 09:42
@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f1268fe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@paypal/paypal-js Patch

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

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

Successfully merging this pull request may close these issues.

[Bug] Incorrect types for onShippingAddressChange

1 participant