Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Code Block
if (payment.isPaycomet) {
  return commitOrder({
    ...commitInput,
    ...digitalPayDetails,
    creditType: CartPaymentCardType.APPLE_PAY,
    payment: {
      paycometInput: {
        fullName,
        paycometInput: {
          merchantAccount: '',
          pspReference: '',
          storePaymentMethod: false,
        },
      },
    },
  });
}

GraphQL/Fulfillment

Create a applePayDetails object in the paycometSale object to send the apple payment data to PSP Service.

Code Block
applePayDetails: applePayDetails
              ? {
                  ...mapGQLApplePay(applePayDetails),
                  paymentData: applePayDetails.paymentData ?? '',
                }
              : undefined,

Add the condition to add applePayDetails in Paycomet mapPaymentMethod function

Code Block
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

Code Block
export type PaymentMethod = OneTimeSchemeDto | VaultedSchemeDto;
Code Block
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

Code Block
public async makePayment

Possible Blockers

Paycomet apple pay coming soon

...