@paypal/react-paypal-js
Version:
React components for the PayPal JS SDK
30 lines (29 loc) • 1.33 kB
TypeScript
import type { UsePayLaterOneTimePaymentSessionProps } from "../hooks/usePayLaterOneTimePaymentSession";
export type PayLaterOneTimePaymentButtonProps = UsePayLaterOneTimePaymentSessionProps & {
autoRedirect?: never;
disabled?: boolean;
};
/**
* `PayLaterOneTimePaymentButton` is a button that provides a PayLater payment flow.
*
* `PayLaterOneTimePaymentButtonProps` combines the arguments for {@link UsePayLaterOneTimePaymentSessionProps}
* with a `disabled` prop.
*
* The `countryCode` and `productCode` are automatically populated from the eligibility API response
* (available via `usePayPal().eligiblePaymentMethods`). The button requires eligibility to be configured
* in the parent `PayPalProvider`.
*
* Note, `autoRedirect` is not allowed because if given a `presentationMode` of `"redirect"` the button
* would not be able to provide back `redirectURL` from `start`. Advanced integrations that need
* `redirectURL` should use the {@link usePayLaterOneTimePaymentSession} hook directly.
*
* @example
* <PayLaterOneTimePaymentButton
* onApprove={() => {
* // ... on approve logic
* }}
* orderId="your-order-id"
* presentationMode="auto"
* />
*/
export declare const PayLaterOneTimePaymentButton: ({ disabled, ...hookProps }: PayLaterOneTimePaymentButtonProps) => JSX.Element | null;