Apple Payments

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


To view the diagram copy and paste the code on the following site:

Mermaid Live

sequenceDiagram
autonumber
actor PlatformSite as PlatformSite (Front)
actor PlatformServer as PlatformServer (Server)
participant Webservice
participant CardService as CardService<br/>[XPayModule]
participant Vault as Vault<br/>Apple Certificates
participant PayplugService
actor Apple
PlatformServer->>+Webservice: MoneyInWebInit
Webservice->>-PlatformServer: WebkitToken
alt Only if using Lemonway Apple Account
PlatformSite->>PlatformSite: Display ApplePay button
PlatformSite->>+CardService: POST /direct-payments/xpay/apple/session (NEW) <br> [webkitToken, displayName, domainName]
CardService->>Vault: Fetch AppleMerchantIdentityCertificate<br/>(with PrivateKey)
CardService->>Apple: POST /paymentSession
CardService->>-PlatformSite: ApplePaymentSession
PartnerSite->>PartnerSite: GET ApplePayData
end
alt Payment Flow
PartnerSite->>+CardService: POST /direct-payments/xpay/apple <br> [webkitToken,merchantCheckoutUrl, payerName, <br> rawPaymentResponse, partnerDecryptedPaymentData (optional)] 
CardService->>Vault: Fetch ApplePaymentProcessingCertificate<br/>(with PrivateKey)
CardService-->>CardService: [XPayModule] Decrypt and Map to XPayData
CardService->>+PayplugService: POST /direct-payments [XPayData]
PayplugService->>-CardService: TransactionResult (Success or Fail)
CardService->>-PartnerSite: WebRedirection (SuccessURL or ErrorUrl)
end