Enums and Type Aliases in the JavaScript SDK for Meta Pay

The following is the reference for the enums and type aliases in the JavaScript SDK for Meta Pay.

AuthorizationState

Indicates whether an attempt to authorize a payment succeeded or failed in an PaymentAuthorizationResult.

ConstantDescription

SUCCESS

The payment was authorized.

ERROR

The payment was not authorized.

ButtonThemeType

The visual theme for the Meta Pay button, specified in an ThemeOptions. The Meta Pay button must comply with branding guidelines.

ConstantDescription

light

A light-colored button.

dark

A dark-colored button.

Availability

Indicates whether Meta Pay is available. On some platforms availability can't be determined until the customer initiates checkout and you create an PaymentClient.

ConstantDescription

AVAILABLE

The customer is signed in and a payment method is available.

NOT_AVAILABLE

The customer is not signed in, or is signed in but must add a payment method.

MIGHT_BE_AVAILABLE

Unable to detect whether the customer is signed in.

NOT_SUPPORTED

Meta Pay is not supported on the platform.

ContainerType

Indicates supported payment container types in a PaymentConfiguration.

ConstantDescriptionConfiguration

basic-card-v1

A payment card.

No special configuration; use {}.

ecom-token-v1

A network payment token.

No special configuration; use {}.

PaymentBillingAddressMode

The amount of information about the billing address that's returned in an PaymentResponse. The default is MIN.

ConstantDescription

MIN

The country and postal code are returned.

FULL

The full billing address is returned.

PaymentCTAType

A call to action that appears on the payment sheet and is specified in PaymentOptions. Indicates whether the customer completes the transaction in the Meta Pay interface or on the merchant web site. The default is PAY.

ConstantDescription

PAY

The customer completes the transaction in the Meta Pay user interface.

CONTINUE

The customer completes the transaction on the merchant web site after interacting with the Pacebook Pay user interface.

PaymentDataErrorReason

Provides information about payment data errors in an PaymentDataError.

ConstantDescription

INVALID_PAYMENT_DATA

The payment data wasn't valid.

INVALID_SHIPPING_ADDRESS

The shipping address wasn't valid.

[deprecated]

INVALID_SHIPPING_OPTION

The shipping option wasn't valid.

NOTE: This field is now deprecated. Please use INVALID_FULFILLMENT_OPTION instead.

INVALID_FULFILLMENT_OPTION

The fulfillment option wasn't valid.

INVALID_BILLING_ADDRESS

The billing address wasn't valid.

INVALID_OFFER_CODE

one or more of the given offers wasn't valid.

OUT_OF_SERVICE_AREA

The shipping address is outside the merchant's service or delivery area.

TIMEOUT

A timeout occurred while processing the payment.

GENERIC_FAILURE

The payment failed for an unknown reason.

OTHER_ERROR

Another error occurred. When you use this error reason in your PaymentDataError, provide a localized message that appears to the customer.

PaymentDataErrorFields

Identifies a field from PaymentDetails or PaymentResponse which is the source of a PaymentDataError.

ConstantDescription

city

The city for a shipping or billing address.

country

The country for a shipping or billing address.

dependentLocality

The dependentLocality for a shipping or billing address.

organization

The organization for a shipping or billing address.

postalCode

The postalCode for a shipping or billing address.

recipient

The recipient for a shipping or billing address.

region

The region for a shipping or billing address.

sortingCode

The sortingCode for a shipping or billing address.

addressLine

The addressLine for a shipping or billing address.

payerPhone

The payerPhone requested from the user.

payerEmail

The payerEmail requested from the user.

offers

One or more of the offers applied to the payment.

[deprecated]

shippingOptionId

The shipping option id selected by the user.

NOTE: This field is now deprecated. Please use fulfillmentOptionId instead.

fulfillmentOptionId

The fulfillment option id selected by the user.

PaymentDetailChangeType

Indicates data that the customer changed in the payment sheet in an PaymentDetailsChangedEvent.

ConstantDescription

[deprecated]

SHIPPING_OPTION_ID

The customer changed the shipping option.

NOTE: This field is now deprecated. Please use FULFILLMENT_OPTION_ID instead.

FULFILLMENT_OPTION_ID

The customer changed the fulfillment option.

SHIPPING_ADDRESS

The customer changed the shipping address.

BILLING_ADDRESS

The customer changed the billing address.

OFFERS

The customer updated offers.

PICKUP_ZIP_CODE

The customer updated the pickup radius zip code.

PaymentErrorCode

Indicates the type of error in an PaymentError.

ConstantDescription

ABORTED

The customer cancelled the request.

TIMEOUT

The customer took too long to complete the payment.

INVALID_REQUEST

The payment request wasn't valid.

MERCHANT_ACCOUNT_ERROR

The merchant account wasn't valid.

INTERNAL_ERROR

Something else went wrong.

PaymentMode

Indicates whether an PaymentContainer or an PaymentConfiguration is for a real payment or a test payment.

ConstantDescription

LIVE

A real payment.

TEST

A test payment.

SessionUsageType

Indicates whether an PaymentConfiguration is for an on-session payment or an off-session payment.

ConstantDescription

ON_SESSION

Indicates that the customer is actively involved and initiated the checkout flow for this payment.

OFF_SESSION

Indicates that the customer may be charged outside of the checkout flow, for example: subscriptions or delayed purchases.

PaymentSheetStatus

Indicates whether a payment sheet was created successfully by an PaymentClient.

ConstantDescription

READY

The payment sheet was created successfully.

BLOCKED

The payment sheet was not created successfully.

[deprecated] PaymentShippingType

NOTE: This field is now deprecated. Please use FulfillmentType instead.

Indicates the fulfillment method for an order and is specified in PaymentOptions. The default is SHIPPING.

ConstantDescription

SHIPPING

The order is shipped to the customer. Next to an address this appears as Ship To.

DELIVERY

The order is delivered to the customer. Next to an address this appears as Deliver To.

PICKUP

The customer picks up the order. Next to an address this appears as Pickup At.

SummaryPaymentItemType

Indicates the type of an SummaryPaymentItem.

ConstantDescription

SUBTOTAL

The subtotal of items in the transaction before taxes, shipping, or fees.

ESTIMATED_TAX

Estimated tax for the transaction.

[deprecated]

SHIPPING

A shipping fee for the transaction.

NOTE: This field is now deprecated. Please use FULFILLMENT instead.

FULFILLMENT

A fulfillment fee for the transaction (e.g. shipping, pickup).

OFFER

A discount applied to the transaction.

FEE

A miscellaneous fee applied to the transaction, for example a fee for gift wrapping.

PaymentClient

Calls a PaymentClientConstructor and returns an PaymentClient.

ConstantDefinition

PaymentClient

PaymentClientConstructor

PaymentConsentEventHandler

Performs authorization of the PaymentContainer in an PaymentResponse after the customer consents to the payment, and returns an PaymentAuthorizationResult.

ConstantDefinition

PaymentConsentEventHandler

event: PaymentResponse

PaymentDetailsChangedEventHandler

Responds to changes in the payment sheet that the customer makes in an PaymentDetailsChangedEvent and returns an PaymentDetailsUpdate.

ConstantDefinition

PaymentDetailsChangedEventHandler

event: PaymentDetailsChangedEvent

SDK_VERSION

Indicates the version of the JavaScript SDK for Meta Pay.

ConstantDefinition

SDK_VERSION

js_v1.dev

FulfillmentType

FulfillmentType is a string representing the fulfillment type corresponding to the order.

ConstantDefinition

SHIPPING

The checkout will display shipping-related information.

PICKUP

The checkout will display pickup-related information.

FulfillmentTypeEnum

Defines the possible fulfillment types.

NOTE: Not meant to be used directly. Please use either FulfillmentType or PaymentShippingType.

ConstantDefinition

SHIPPING

The checkout will display shipping-related information.

PICKUP

The checkout will display pickup-related information.

DELIVERY

The checkout will display delivery-related information.

DistanceUnitType

DistanceUnitType is a string representing the unit of measurement used for the distance between two locations.

ConstantDefinition

miles

The checkout will display distance in miles (mi).

kilometers

The checkout will display distance in kilometers (km).