Functions that allow an Eitri-App to initiate Apple Pay on iOS devices.

Methods

  • Checks whether Apple Pay is available on the current device. Returns true if Wallet can present Apple Pay

    Example:

    const available = await Eitri.exposedApis.applePay.isAvailable()
    if (!available) {
    // fallback
    }

    Returns Promise<boolean>

  • Presents the Apple Pay sheet and resolves with a payment token upon user authorization. Amounts are specified in integer cents (e.g., 1999 for $19.99).

    Example:

    // Apple Pay minimal example
    const result = await Eitri.exposedApis.applePay.pay({
    countryCode: "US",
    currencyCode: "USD",
    shippingMethods: [
    { identifier: "standard", label: "Standard Shipping", amount: 150, detail: "5-7 business days" }
    ],
    summaryItems: [
    { label: "Subtotal", amount: 300 },
    { label: "Shipping", amount: 150 },
    { label: "Total", amount: 450, type: "final" }
    ],
    })

    Output:

    {
    paymentData: "<REDACTED>",
    paymentMethod: {
    type: "credit",
    network: "MasterCard",
    displayName: "MasterCard 1111"
    },
    transactionIdentifier: "<REDACTED>"
    }

    Parameters

    Returns Promise<ApplePayOutput>