Development
General integration - App with PSP:/wiki/spaces/IN/pages/3660185610
Certification, setup configuration:/wiki/spaces/IN/pages/753762326
Sequence Diagram
Based on:
https://developers.tabapay.com/docs/apple-pay
Code Changes
Frontend
It necessary add a new payment processor ( Paycomet ) validation inside the processOrderWithAccount
function to handle the apple pay response.
if (payment.isPaycomet) { return commitOrder({ ...commitInput, ...digitalPayDetails, creditType: CartPaymentCardType.APPLE_PAY, payment: { paycometInput: { fullName, paycometInput: { merchantAccount: '', pspReference: '', storePaymentMethod: false, }, }, }, }); }
Fulfillment
Create a applePayDetails
object in the paycometSale
object to send the apple payment data to PSP Service.
applePayDetails: applePayDetails ? { ...mapGQLApplePay(applePayDetails), paymentData: applePayDetails.paymentData ?? '', } : undefined,
Add the condition to add applePayDetails in Paycomet mapPaymentMethod
function
if (params.applePayDetails) { if (!params.applePayDetails.paymentData) { throw new Error('ApplePay payment is missing payment data'); } return { paymentMethod: JSON.stringify({ **: **, **: **, **: **, type: 'applepay', }), paymentMethodType: 'applepay', }; }
Payment Service
Update the PaymentMethod
and PaymentRequestDto
interface to handle Apple Pay
export type PaymentMethod = OneTimeSchemeDto | VaultedSchemeDto;
PaymentRequestDto oneOf: [{ $ref: getSchemaPath(OneTimeSchemeDto) }, { $ref: getSchemaPath(VaultedSchemeDto) }]
Update the makePayment
function to handle the apple pay payment and create a function to handle this payment type
public async makePayment
Possible Blockers
Paycomet apple pay coming soon
https://www.paycomet.com/en/payment-methods
Payment Refactor
Today, refactoring of the payment system is being studied to transform the commitOrder that occurs in the frontend so that it only occurs in the backend. Looking at the current code, the entire Apple Pay payment process takes place in the iPhone SDK and we get the direct response from the SDK. You need to validate how this process will be carried out after payment refactoring.
Reference: RFC-037 - Payments Refactor Proposal
Feature Flags
/wiki/spaces/TRX/pages/4110647593
CMS Configuration
You must fill this field with the merchant ID configured on the Apple Developers page in the CMS (CTG Configs → Front End Configuration)
Tests
Add Comment