Apple Payments

Endpoints: POST /moneyins/card/webinit/ and POST /direct-payments/xpay/apple/


sequenceDiagram
  autonumber
  participant PartnerSite as App/Website (Front)
  participant Partner as Platform (Server)
  participant Lemonway as Lemonway API
  participant Apple

  PartnerSite->>PartnerSite: Display Apple Pay button
  Partner->>+Lemonway: MoneyInWebInit
  Lemonway-->>-Partner: WebkitToken

  PartnerSite->>PartnerSite: Payer chooses Apple Pay

  alt Only if using Lemonway Apple Account (OPTION 1)
    Partner->>Lemonway: Session creation (POST /xpay/apple/session)
    Lemonway-->>Partner: ApplePaymentSessionId
  end

  PartnerSite->>Apple: Send payment request
  Apple-->>PartnerSite: Return Apple PaymentData
  PartnerSite-->>Partner: Send Apple PaymentData

  Partner->>Lemonway: Send Apple payment request (POST /xpay/apple)
  Lemonway-->>Partner: TransactionResult (success/fail)
  Lemonway-->>PartnerSite: Web redirection