updateQuote
Overview
This mutation updates the current payment session with new quote, which is necessary for payment sessions to be valid. The payment session must be updated with a new quote every 30-45 seconds or AFEX will fail with an expired quote.
Special Considerations
N/A
Inputs
N/A
Returns
Promise<UpdatePaymentSessionResult>
A promise containing either a success message:
message: string
or a call for more data:
dataNeeded: dataNeededForPayment
balanceRefreshRequired: balanceRefresh
Example
Running this mutation:
mutation {
updateQuote {
... on SuccessResult {
message
}
... on ActionRequiredForPayment {
dataNeeded {
idUpload
personalTaxId
}
balanceRefreshRequired {
providerAccountId
bankAccountId
type
}
}
}
}
Gives us:
{
"data": {
"updatePaymentSession": {
"message": "Quote updated!"
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
Invalid session id (I-4714)
- You may not have created a payment session before trying to update the quote
You can only update the quote if the payment has been defined. (I-4715)
- Payment must be updated before trying to update the quote