Examples Product Form Payment Amount
February 14, 2023 at 10:38 AMThe product price or amount entered is not always the final product price, some products have some fees or discounts that apply depending on the payment method used and other conditions.
The best way to know the final price of the payment is using the validation method before submit the transaction.
mutation validateTransaction($validate: ValidateTransactionInput!) {
transactions {
validate(input: $validate) {
grossTotal
adjustments {
name
amount
total
rateMode
isDiscount
}
total
}
}
}
{
"validate": {
"product": "ji12sd4c0a3D0=",
"inputs": {"accountNumber": "+13051231234"}
}
}
{
"data": {
"transactions": {
"validate": {
"grossTotal": 50,
"adjustments": [
{
"name": "E911 User Fee",
"amount": 0.4,
"total": 0.4,
"rateMode": false,
"isDiscount": false
}
],
"total": 50.4
}
}
}
}
If the validation is success; you get the list of adjustments to apply in the response and the total transaction amount.
Adjustments are calculated based on given information, in this example you get adjustments only for that product, but if the user is paying with Credit Card, must define the payment method in the query, check this documentation about fees and discounts
Display payment amount Example: