Document Status | Status |
---|
colour | Blue |
---|
title | in-progress |
---|
|
|
---|
Document Owner(s) | Capovilla, Evandro |
---|
Reviewers | |
---|
...
Whitelabel App (Already done)
The frontend will be responsible for displaying and retrieving the cardholderName field and sending this information to paycomet. Nowadays this information is already sent via Paycomet forms, but they also need it to be sent via the merchantData field.
...
Expand |
---|
title | src/modules/legacy/legacy.service.ts |
---|
|
Before Code Block |
---|
paycometSale = {
...,
fullName: paymentUserDetails.name!,
...,
}; |
After Code Block |
---|
paycometSale = {
...,
fullName: payment?.fullName || paymentUserDetails.name!,
...,
}; |
|
Payment Service (Already done)
Expand |
---|
title | src/functions/graphql/utils/make-payment.ts |
---|
|
Code Block |
---|
private mapPaymentMethod(
params: IPaycometPaymentSaleEvent,
): {
paymentMethodType: string;
paymentMethod: string;
} {
const isVaultedPayment = !params.storePaymentMethod && params.storedPaymentMethodId;
if (isVaultedPayment) {
return {
paymentMethodType: params.paymentType,
paymentMethod: JSON.stringify({
...,
cardholderName: params?.fullName,
...,
}),
};
}
return {
paymentMethodType: params.paymentType,
paymentMethod: JSON.stringify({
...,
cardholderName: params?.fullName,
...,
}),
};
} |
|
...
Whitelabel App (Already done)
Expand |
---|
title | src/pages/cart/payment/order-payment/paycomet-hosted-page-payment/paycomet-vaulted-card.tsx |
---|
|
Code Block |
---|
generateCreatePreAuthorization({
variables: {
input: {
...,
cardHolderName: paymentValues.nameOnCard,
...,
},
},
}); |
|
GraphQL (Already done)
Expand |
---|
title | src/functions/graphql/providers/payments.ts |
---|
|
Code Block |
---|
public async createPreAuthorizationPaycomet({...}){
const paycometPreauth =
await this.paymentsClient.paycometClient.request<ICreatePreAuthorizationResponse>((apis) =>
apis.paymentsApi.createPreAuthorization({
iCreatePreAuthorizationRequest: {
...,
cardHolderName,
...,
},
region: regionCountry,
}),
);
}
|
|
...
Expand |
---|
title | src/payment/preauth/preauth.service.ts |
---|
|
Code Block |
---|
| public async processPreAuth(...){
...
const customer = this.paycometHelper.buildUserDetails(region, cellphone, email, request);
...
} |
|
...
Vaulted
No update required
...
Vaulted - Pre-auth
No update required
...
Update phoneNumber field to use user accounts or delivery data
The idea here is to mainly use the phoneNumber from the cart page ( delivery mode ) and if it doesn't exist, we use the phoneNumber from the user data ( restaurant mode ). If neither of these fields exist, we are sending that data as empty.
...