Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
/
[Solution] new mandatory parameters VISA/Master/Sibs - new mandatory fields
This solution does not include the “browser height/width” information because paycomet did not implement and does not provide access to send this new field.
The address fields provided are not optional and are a new request for Visa/master/Sibs payments as a way of detecting fraud.
The email will be mandatory and telephone number optional, but both will be sent to paycomet.
Only the delivery service mode will show the checkbox to use billing address.
For all card brands we send all the information in the mastercard column in the table below.
Payments Mandatory Fields
Fields
Visa
Mastercard
Fields
Visa
Mastercard
Card Number
Name on Card
Expiry
CVV
IP Address
Address Line 1
(new field)
Address Line 2
(new field)
Postal Code
(new field)
City
(new field)
State
(new field)
Country
(new field)
Email (user data)
(new field)
Cellphone (user data)
(if email is sent)
Legend
Mandatory fields
Optional fields
#1 - Create new fields for the new data needed.
The idea is to create a new input for the user to fill in and we send this information in addition to other relevant information such as the height and width of the browser (Paycomet is working to include height and width in their system, so this solution does not include those properties yet.). It was also agreed that the email and telephone fields will be sent via backend without showing these fields to the user and getting this information in user details.
The user will fill in the correct information.
We guarantee that all information provided to Paycomet/Visa/master/Sibs belongs to the user.
The user has more fields to fill in.
#2 - Send the pre-filled data of user details.
The idea is to use the user's pre-filled information and send it as a request to paycomet.
The user does not need to fill out all the forms.
The user data may not be the same as their Visa/master credit card information.
Proposed Solution
#1 - Create new fields for the new data needed.
Whitelabel App
Implement new input fields for users to provide additional data necessary for payment processing, specifically: billing address, email, and phone number. This data will be captured, validated, and transmitted to the Payment Service Provider (PSP) Paycomet.
Diagram
title Make purchase/No pre-auth
FE->Graphql:CommitOrder
Graphql->Payment-Service:MakePayment
Payment-Service->Paycomet-Service:MakePayment
Paycomet-Service->Paycomet: executePurchase
Paycomet-Service<-Paycomet: result
Payment-Service<-Paycomet-Service:result
Graphql<-Payment-Service:result
FE<-Graphql:result
title Pre-auth
FE->Graphql:CreatePreAuth
Graphql->Paycomet-Service:CreatePreAuth
Paycomet-Service->Paycomet: createPreauthorization
Paycomet-Service<-Paycomet: result
Graphql<-Paycomet-Service:result
FE<-Graphql:result
For this solution, we will only modify the payment request part, as shown in the diagram above. The entire flow after sending payment to paycomet will not be modified.
For postal/zip code we already have a field for this purpose, and it is hidden by the payment variation fields. We can use the same flag to enable or disable these new fields.
input AdditionalPayment {
"""
Represents the phone number of the user who owns the requested payment
"""
phoneNumber: String
"""
Represents the email of the user who owns the requested payment
"""
email: String
}
input PaycometPayment {
...
"""
Additional Payment Information
"""
userPaymentDetails: UserPaymentDetails
}
The idea of this story is to follow the same flow that VRPayment did to save the billing address on their side. One of the ways they did this is to send the billingAddress information and add it to the user's account along with the card. We can follow the processVrCreditPayment function in src/functions/graphql/providers/payments.ts.
For the existing vaulted card, we can add the option for the user to add the billingAddress below the vaulted card option, if they do not already have this information. Vaulted cards are obtained throughgetUserAccounts - src/functions/graphql/providers/payments.ts
We will need to create a new method to add the Paycomet accounts in the PaycometClient class:
In the end, we will update the addAccount method changing the params type, adding the IPaycometAddAccountParams, and adding the new condition to call the add account for Paycomet.
For the WL front-end solution, we’ll just reuse the form that we have inside the “add new credit card” form:
Reinforcing the expected behavior:
If the vaulted card doesn’t have the mandatory fields we need to show the form below the selected dropdown
If the vaulted card has the mandatory fields we’ll not show the form
If this process need some time to get the necessary data we should consider add a loading/shimmer effect to this new part of the UI
Tasks breakdown
Isolate the billing address form to a new reusable component (+ container component to use it)
File where the original form is: src/pages/cart/payment/order-payment/paycomet-hosted-page-payment/paycomet-credit-card-form/paycomet-credit-card-form.tsx
Here we want to reuse the same form in both places (inside the original form and now below the dropdown)
Add the necessary query and logic to show the form in the container component
Here we’ll get the necessary data to discover if the vaulted card has the mandatory field or not. If not, show the form as expected
To get the account data, we can use the Query UserAccounts
We will need to add the billingAddress in the query