Skip to content

Releases: paypal/paypal-js

@paypal/react-paypal-js@10.1.2

Choose a tag to compare

@github-actions github-actions released this 07 Jul 20:12
3caece5

Patch Changes

  • 110a043: ApplePayOneTimePaymentButton no longer writes a disabled attribute to Apple's <apple-pay-button>, which ignored it and manages its own enabled/disabled state internally via canMakePayments(). The non-functional disabled prop has been removed — merchants control presentation themselves.
  • a987b2e: Adds 1 enum value to the paypal messages element logoType property.
  • Updated dependencies [4619c74]
    • @paypal/paypal-js@10.0.3

@paypal/paypal-js@10.0.3

Choose a tag to compare

@github-actions github-actions released this 07 Jul 20:13
3caece5

Patch Changes

  • 4619c74: Adding v6 types for Venmo vault-without-payment (SavePayment)

@paypal/react-paypal-js@10.1.1

Choose a tag to compare

@github-actions github-actions released this 29 Jun 15:34
3d72ac9

Patch Changes

  • 6714f3f: Migrate the v5 React SDK Storybook from Storybook 6 to Storybook 10 (@storybook/react-vite) and extract it out of this package into its own @paypal/react-paypal-js-storybook-v5 workspace (mirroring the v6 storybook). This is a tooling/dev-dependency change only — the published package output is unchanged; it removes the Storybook toolchain from this library's devDependencies.
  • Updated dependencies [cfcb985]
    • @paypal/paypal-js@10.0.2

@paypal/paypal-js@10.0.2

Choose a tag to compare

@github-actions github-actions released this 29 Jun 15:34
3d72ac9

Patch Changes

  • cfcb985: Add a default export condition to the ./sdk-v6 subpath so bundlers/tracers (e.g. @vercel/nft) resolve it correctly and don't fall back to the v5 entry.

@paypal/react-paypal-js@10.1.0

Choose a tag to compare

@github-actions github-actions released this 25 Jun 15:44
59cb2ce

Minor Changes

  • 0ae4e9d: Add Braintree PayPal Pay Later (BNPL) support and a companion eligibility hook for v6.

    • useBraintreePayPalPayLaterSession — manages a Pay Later session (error, isPending, handleClick), consistent with the existing one-time-payment, billing-agreement, and checkout-with-vault hooks.
    • useBraintreeEligibleMethods — fetches eligibility via findEligibleMethods and caches it on the provider, deduplicating by checkout instance + options and refetching when either changes.
    • Provider-level failures are now surfaced separately and labeled (Braintree provider error: …, with the original error as cause), distinct from "checkout instance not available", so consumers can tell which layer failed.
    • Add shippingCallbackUrl, shippingAddressOverride (now typed as BraintreeShippingAddressOverride instead of Record<string, unknown>), and contactPreference options to the one-time, Pay Later, and checkout-with-vault session types.
    • BraintreeEligibilityResult.getDetails is now strongly typed per funding source.
  • fba3cff: Add BraintreePayPalPayLaterButton, a prebuilt v6 button that renders
    <paypal-pay-later-button> and drives the Braintree PayPal Pay Later (BNPL) flow via
    useBraintreePayPalPayLaterSession, sourcing countryCode/productCode from provider
    eligibility.

    Docs: clarify that the Pay Later and Credit buttons require eligibility to be fetched first —
    via useEligibleMethods (client) or useFetchEligibleMethods (server) — with updated JSDoc
    and README examples.

Patch Changes

  • b6e0982: Fix jest-environment-dom package migration bug.

  • d4f6cdc: Type the <paypal-basic-card-button> JSX element's buyer-country input as the kebab-case buyer-country attribute instead of a camelCase buyerCountry prop. The element's observed attribute is buyer-country, so a camelCase JSX prop is lowercased to buyercountry on React <19 and never reaches it. Buyer country is normally determined by the SDK; this only corrects the JSX type for the case where a merchant sets the attribute directly.

  • edf33ab: Raises an error when the Google Pay script has not loaded when the React component has mounted.

  • a648de2: Fix stale error and potential perpetual loader bug in useEligibleMethods.

  • 3b84cd6: Fix: useFetchEligibleMethods now requires the environment option, matching the loadCoreSdkScript / PayPalProvider change in v10.0.0. Previously, omitting environment silently fell through to the sandbox eligibility API (https://api-m.sandbox.paypal.com), which could cause a production server-rendered checkout to hydrate PayPalProvider with sandbox eligibility data while the client loaded the production SDK — surfacing as missing or incorrect payment buttons. TypeScript users will now see a compile error if environment is omitted; runtime callers will see a thrown Error. Pass environment: "production" or environment: "sandbox" explicitly.

    // Before (silently used sandbox)
    const response = await useFetchEligibleMethods({ headers, payload });
    
    // After (required)
    const response = await useFetchEligibleMethods({
      environment: "production", // or "sandbox"
      headers,
      payload,
    });
  • Updated dependencies [d7f697b]

  • Updated dependencies [983beb7]

  • Updated dependencies [7d44dcc]

    • @paypal/paypal-js@10.0.1

@paypal/paypal-js@10.0.1

Choose a tag to compare

@github-actions github-actions released this 25 Jun 15:44
59cb2ce

Patch Changes

  • d7f697b: Migrates Vitest to v4.

  • 983beb7: Add v6 web component DOM element types so non-React TypeScript integrations get strongly-typed access to the PayPal SDK custom elements. HTMLElementTagNameMap is augmented for <paypal-button>, <venmo-button>, <paypal-pay-later-button>, <paypal-credit-button>, <paypal-basic-card-button>, <paypal-basic-card-container>, <paypal-message>, and <apple-pay-button> (registered by Apple's Apple Pay JS SDK).

    const btn = document.createElement("paypal-pay-later-button");
    btn.countryCode = "US"; // typed: "AU" | "CA" | "DE" | "ES" | "FR" | "GB" | "IT" | "US"
    btn.productCode = "PAYLATER"; // typed: "PAYLATER" | "PAY_LATER_SHORT_TERM"
  • 7d44dcc: Add vaultSetupToken to OnApproveData and expand createVaultSetupToken and onApprove JSDoc to cover Venmo vault-without-purchase flows.

@paypal/react-paypal-js@10.0.0

Choose a tag to compare

@github-actions github-actions released this 04 Jun 16:45
4bd05ab

Major Changes

  • 114d09c: BREAKING: The v6 environment option is now required in the PayPalProvider. Previously, omitting environment silently defaulted to sandbox, which could cause production builds to load the sandbox SDK with a live clientId. Pass environment: "production" or environment: "sandbox" explicitly. TypeScript users will see a compile error; runtime callers will see a thrown Error.

    v6 PayPalProvider

    Update the PayPalProvider to pass the environment property

    <PayPalProvider
      clientId={clientId}
      environment="sandbox" // "production"
      components={["paypal-payments",]}
      pageType="checkout"
    >
      <CheckoutPage />
    </PayPalProvider>
    

Patch Changes

  • Updated dependencies [114d09c]
    • @paypal/paypal-js@10.0.0

@paypal/paypal-js@10.0.0

Choose a tag to compare

@github-actions github-actions released this 04 Jun 16:45
4bd05ab

Major Changes

  • 114d09c: BREAKING: The v6 environment option is now required on loadCoreSdkScript. Previously, omitting environment silently defaulted to sandbox, which could cause production builds to load the sandbox SDK with a live clientId. Pass environment: "production" or environment: "sandbox" explicitly. TypeScript users will see a compile error; runtime callers will see a thrown Error.

    v6 loadCoreSdkScript

    Update usage of loadCoreSdkScript to pass the environment property correctly

    const paypalGlobalNamespace = await loadCoreSdkScript({
      environment: "sandbox", // "production"
    });
    

@paypal/react-paypal-js@9.3.0

Choose a tag to compare

@github-actions github-actions released this 03 Jun 15:02
31eb658

Minor Changes

  • 145d3c5: Adds the Braintree with PayPal Checkout with Vault button component.
  • 2bcb79d: Add a new static UI component for braintree paypal one time payment.
  • 63d8fca: Add the Braintree-PayPal Billing Agreement Hook
  • 61ee8ca: Makes presentationMode optional for v6 buttons and hooks, and sets a default value for each hook.
  • 3d3b60e: Add Braintree-PayPal integration documentation.
  • 0ff45b7: Implementing GooglePay hook and the button component
  • 82da8dd: Adds Braintree Checkout with Vault hook
  • 1974cd9: Adds Braintree-PayPal Billing Agreement button component.

Patch Changes

  • 6e97c29: Fix onError type intersection in ApplePayButtonElementProps by adding Omit<HTMLAttributes, "onError"> consistent with ButtonProps pattern
  • 658db62: Fixing ApplePay styling issue
  • ee72ab1: Update README with Apple component documentation.
  • 5112bf2: Fix to prevent ApplePaySession completePayment twice
  • Updated dependencies [9007a82]
  • Updated dependencies [6e1de75]
  • Updated dependencies [0ff45b7]
  • Updated dependencies [164d373]
    • @paypal/paypal-js@9.8.0

@paypal/paypal-js@9.8.0

Choose a tag to compare

@github-actions github-actions released this 03 Jun 15:02
31eb658

Minor Changes

  • 0ff45b7: Consolidating the shared GooglePay types to paypal-js package.

Patch Changes

  • 9007a82: Add optional submit options to CardFields submit() method, including billingAddress and name fields for 3DS authentication support
  • 6e1de75: Fix a typescript bug that was making .start options required.
  • 164d373: Update paypal one time payment session start options to be optional.