submitPaymentSession
Overview
This mutation validates and submits current payment session. This can be done once, and then the payment session is deleted.
Special Considerations
- To run this mutation, you must have an active payment session that has been updated via updatePaymentSession
Inputs
N/A
Returns
Promise<SubmitPaymentResult>
A promise containing the following object / data:
SubmitPaymentResult: {
payerCurrency: CURRENCY
payerSubAmount: float
payerTotalFeeAmount: float
payerTotalAmount: float
paymentSessionType: PaymentSessionType
beneficiaryCurrency: CURRENCY
beneficiarySubAmount: float
beneficiaryTotalFeeAmount: float
beneficiaryTotalAmount: float
payerToBeneficiaryFX: float
description: string
emailMessage: string
valueDate: DateTime
afexTradeNumber: string
id: string
paymentRedirectUrl: string
}
Example
Running this mutation:
mutation {
submitPaymentSession {
payerCurrency
payerSubAmount
payerTotalFeeAmount
payerTotalAmount
paymentSessionType
beneficiaryCurrency
beneficiarySubAmount
beneficiaryTotalFeeAmount
beneficiaryTotalAmount
payerToBeneficiaryFX
description
emailMessage
valueDate
afexTradeNumber
id
paymentRedirectUrl
}
}
Gives us:
{
"data": {
"submitPaymentSession": {
"payerCurrency": "CAD",
"payerSubAmount": 35,
"payerTotalFeeAmount": 0,
"payerTotalAmount": 35,
"paymentSessionType": "MAKE_PAYMENT",
"beneficiaryCurrency": "USD",
"beneficiarySubAmount": 25.34,
"beneficiaryTotalFeeAmount": 1,
"beneficiaryTotalAmount": 24.34,
"payerToBeneficiaryFX": 0.7239,
"description": "test123",
"emailMessage": null,
"valueDate": "2020-06-18T07:00:00.000Z",
"afexTradeNumber": "373911",
"id": "ckbiv4rmj01w407728tqt1xdo",
"paymentRedirectUrl": null
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
This is not a valid session. (I-4710)
- A payment session is not active, so you must create a payment session
This payment request is not valid. (I-4711)
- The payment request is not active, so you must create a payment request session
This payment request is no longer valid. (I-4712)
- The payment request is either completed or cancelled