PAYMENT_CARD, the SDK renders the
card form without a pay button:
add your own button and call submit(). For PAYPAL, GOOGLE_PAY, and
APPLE_PAY, it renders the payment button at the element’s full width.
initMethod() is available only on the Billing object, so call it as
Billing.initMethod(). It doesn’t read configure():
pass orgId in its options.Parameters
The payment method to render:
PAYMENT_CARD, PAYPAL, GOOGLE_PAY, or
APPLE_PAY. Use the PaymentMethod enum or the string value.Callbacks
All callbacks are optional and go inoptions.
Called when the payment method can’t render, for example when Apple Pay isn’t
available in the browser.
Called when the buyer starts a payment. Clear any error message you show here.
Called when the payment fails. The error carries
declineCode and
declineCodeSource when the payment provider reports a decline. Learn more
about decline codes.Called with the total and tax when
FunnelFox Payments Taxes is on.
Returns
APromise<PaymentMethodInterface> with these methods:
setDisabled(disabled): Turn the payment method off or on.submit(): Validate the card form and start the payment. Card payments only.destroy(): Remove the payment method and end its checkout session.
PrimerError.
Example
Calls with the same
orgId, priceId, externalId, and email share one
order, so the card form and the payment buttons above pay for the same
purchase.