borderless Docs

borderless Docs

  • Account Setup
  • Account Services
  • Verification
  • Payments
  • Refunds
  • Developer Tools

›Mutations

Account Setup

    Queries

    • accountIdentificationTypes
    • accountSetupSession
    • allCountries
    • businessTypes
    • isValidBusinessTaxId
    • isValidPersonalTaxId
    • isValidSlug
    • jobTitles
    • naics
    • supportedCountries
    • zoneCodes

    Mutations

    • addAccountToPerson
    • addCompanyOfficerToAccount
    • createAccountSetupSession
    • createLoginPersonAndAccount
    • deactivateAccount
    • resendEmailVerification
    • submitAccountSetupSession
    • submitCompanyOfficers
    • updateAccountSetupSession

Account Services

    Queries

    • account
    • accounts
    • bankAccounts
    • companyOfficers
    • person
    • publicAccountBySlug

    Mutations

    • addBankAccount
    • changePassword
    • changePreferredBankAccount
    • login
    • logout
    • requestPasswordReset
    • sendInvitationEmail
    • sendInvitedRegisterEmail
    • switchAccounts
    • updateAccount
    • updatePerson

Verification

    Mutations

    • addOnfidoDocumentToPerson
    • embedOnfido

Payments

    Queries

    • contacts
    • paymentActivity
    • paymentActivityById
    • paymentRequestById
    • paymentSession
    • requestedPayments
    • tradeConfirmationForPayment

    Mutations

    • clearPaymentSession
    • createPaymentForRequestSession
    • createPaymentSession
    • declinePaymentRequest
    • generatePayMeRequest
    • requestPayment
    • resendPaymentRequest
    • submitPaymentSession
    • updatePaymentSession
    • updateQuote

Refunds

    Queries

    • refundSession

    Mutations

    • clearRefundSession
    • createRefundSession
    • submitRefundSession
    • updateRefundSession

Developer Tools

    Queries

    • accountWebhooks
    • embedVerificationService

    Mutations

    • createWebhook
    • healthCheck
    • testWebhook

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
← resendPaymentRequestupdatePaymentSession →
  • Overview
  • Special Considerations
  • Inputs
  • Returns
    • Promise<SubmitPaymentResult>
  • Example
  • Common Errors
borderless Docs
Docs
Account SetupAccount ServicesVerificationPaymentsRefundsDeveloper Tools
More
LoginBlogGitLabLinkedInInstagramTwitter
Facebook Open Source
Copyright © 2022 borderless