Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 9 Next »

Development

General integration - App with PSP:/wiki/spaces/IN/pages/3660185610

Certification, setup configuration:/wiki/spaces/IN/pages/753762326

Sequence Diagram

image-20240304-140305.png

 SequenceDiagram Code

title Apple Pay ( PassKit )

User->Frontend: User click to pay with Apple Pay
Frontend->Mobile: Request Payment
User<-Mobile: Request to Authorize Payment
User->Mobile: Authorize via FaceID
Mobile->PassKit: Send payment request
PassKit->AppleServer: Make Payment
AppleServer->PassKit: Payment Response
Mobile<-PassKit: Payment Response
Frontend<-Mobile: Payment Response
Frontend->Backend: Verify Payment Status
Frontend<-Backend: Payment Status

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

image-20240220-204547.png

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

/wiki/spaces/FEP/pages/3772383301

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.