paymentSession
Overview
This query gets the active payment session information. The query works for payment and paymentForRequest sessions.
Special Considerations
- A payment session must be active before you can query
Inputs
N/A
Returns
Promise<PaymentSessionResult>
A promise containing the following object / data:
PaymentSessionResult: {
payer: PaymentPayer
beneficiary: PaymentBeneficiary
tempExchangeRate: TempFxRates
tempValueDate: DateTime
reviewPayment: ReviewPayment
}
Example
Running this query:
query {
paymentSession {
payer {
bankAccount {
id
currency
}
}
beneficiary {
currency
contact {
account {
slug
}
}
}
reviewPayment {
paymentObject {
payer {
totalAmount
}
}
}
}
}
Gives us:
{
"data": {
"paymentSession": {
"payer": {
"bankAccount": {
"id": "ckb6tx8tn00ho07723ir1f6ak",
"currency": "USD"
}
},
"beneficiary": {
"currency": "CAD",
"contact": {
"account": {
"slug": "testbusiness"
}
}
},
"reviewPayment": {
"paymentObject": {
"payer": {
"totalAmount": 35
}
}
}
}
}
}
Common Errors
When running this query some of the common errors encountered include:
- There is not a payment session with this id. (I-4716)
- You may not have created a payment session before trying to query information for the payment session