@paypal/paypal-js
    Preparing search index...

    Type Alias ApplePayOneTimePaymentSession

    Apple Pay one-time payment session interface.

    type ApplePayOneTimePaymentSession = {
        confirmOrder: (
            options: ConfirmOrderOptions,
        ) => Promise<ConfirmOrderResponse>;
        formatConfigForPaymentRequest: (
            config: ApplePayConfig,
        ) => {
            merchantCapabilities: ApplePayMerchantCapability[];
            supportedNetworks: ApplePaySupportedNetwork[];
        };
        validateMerchant: (
            options: ValidateMerchantOptions,
        ) => Promise<ApplePayMerchantSession>;
    }
    Index

    Properties

    confirmOrder: (options: ConfirmOrderOptions) => Promise<ConfirmOrderResponse>

    Confirms the order with PayPal after Apple Pay authorization.

    Type Declaration

    appleSdkSession.onpaymentauthorized = async (event) => {
    const order = await createOrder();
    await applePaySession.confirmOrder({
    orderId: order.orderId,
    token: event.payment.token,
    billingContact: event.payment.billingContact,
    shippingContact: event.payment.shippingContact,
    });
    appleSdkSession.completePayment({
    status: ApplePaySession.STATUS_SUCCESS,
    });
    };
    formatConfigForPaymentRequest: (
        config: ApplePayConfig,
    ) => {
        merchantCapabilities: ApplePayMerchantCapability[];
        supportedNetworks: ApplePaySupportedNetwork[];
    }

    Formats the Apple Pay configuration for use in an Apple Pay payment request.

    Type Declaration

    const paymentRequest = {
    ...applePaySession.formatConfigForPaymentRequest(config),
    countryCode: "US",
    currencyCode: "USD",
    total: {
    label: "Demo Store",
    amount: "100.00",
    type: "final",
    },
    };
    validateMerchant: (
        options: ValidateMerchantOptions,
    ) => Promise<ApplePayMerchantSession>

    Validates the merchant with Apple Pay.

    Type Declaration

    appleSdkSession.onvalidatemerchant = async (event) => {
    const payload = await applePaySession.validateMerchant({
    validationUrl: event.validationURL,
    displayName: "My Store",
    domainName: "example.com",
    });
    appleSdkSession.completeMerchantValidation(payload.merchantSession);
    };