Payment API

Error and Cancel Codes

Senest redigeret:

The following aims to narrow the hundreds of error codes and descriptions we find across the implemented gateways to as few as possible, so integrators more easily can implement different workflows depending on the situation and desired business logic. To provide full transparency into our interpretation of the chosen gateway’s error codes and descriptions, we apply these as gatewayErrorCode and gatewayErrorDescription onto the relevant entity whenever possible. This allows advanced integrators a much more nuanced workflow.

Vocabulary

Debtor

The payee also known as the customer or donor.

Creditor

The merchant also known as the organisation.

System

OnlineFundraising’s Payment Engine.

Gateway

The chosen Payment Gateway, such as Betalingsservice, MobilePay Subscriptions, NETS, Teller, Bambora etc.

Error Codes

Our Error Codes are applied to entities when unintentional errors occur either internally in System or at the Gateway.

Cancel Codes

Our Cancel Codes are applied to entities intentionally cancelled by either the Debtor or the Creditor.

 

Subscription

Subscription Error Codes and Descriptions

Please note that errorCode and errorDescription goes hand in hand, and are applied systemically depending on the situation.

Please also note that the state of the Subscription may depend on the connected Agreement’s definition of paymentRequired.

  • For example, if the Payment Method for a Subscription of a monthly donation (an Agreement) should be cancelled by the Debtor, then a Creditor may wish to abstain from pursuing the outstanding amount. In this case the Agreement does not have paymentRequired, thus the Subscription will be given the state Inactive.

  • In contrast this might be the very case, if the same Subscription was for an annual membership with customer privileges. In this case the Agreement does have paymentRequired, thus the Subscription will maintain the state Active.

Error Code

Description

State

100001

Subscription has no active Payment Method, but Payments are required by the Agreement.

Active

100002

Subscription has no active Payment Method, and Payments are not required.

Inactive

100003

Subscription Payment Method not found at the time of scheduling.

Inactive

Subscription Cancel Codes

Please note that both holdDescription and cancelDescription are custom, optional strings defined by the Creditor during cancellation, while cancelCode are applied systemically depending on the situation.

Cancel Code

Description

State

100101

Cancelled by Debtor.

Inactive

100102

Cancelled by Creditor in either UI or API integration.

Inactive

100103

Expired due to the defined expiresAfterDate.

Inactive

100104

Cancelled by System at the time og charge. Due to the Payment Method being cancelled at payment gateway.

Inactive

 

Payment Method

Payment Method Error Codes and Descriptions

Please note that errorCode and errorDescription goes hand in hand, and are applied systemically depending on the situation.

Error Code

Description

Examples

State

200001

Payment Method signup failed

Invalid data provided for either National ID, Business Number, Sort Code or Account Number with Betalingsservice.

Failed

200002

Payment Method was rejected during sign up

Involves Debtor rejection of a request i.e. in a mobile app.

Rejected

200003

Payment Method signup expired

Debtor did not approve request in mobile app in time.

SessionExpired

200004

Payment Method has expired

Involves expiration of Card or requirement of new SCA.

Expired

200005

Payment Method has failed

Errors with the Gateway without options to retry or reactive.

Failed

Payment Method Cancel Codes and Descriptions

Please note that cancelCode and cancelDescription goes hand in hand, and are applied systemically depending on the situation.

Cancel Code

Description

State

200101

Cancelled by Debtor

Cancelled

200102

Cancelled by Creditor

Cancelled

200103

Cancelled by System

Cancelled

 

Payment

Payment Error Codes and Descriptions

Please note that errorCode and errorDescription goes hand in hand, and are applied systemically depending on the situation.

Error Code

Description

Examples

State

300001

Payment Method is temporarily unavailable

Technical error or unresponsive gateway.
No funds currently, denied for ~24 hours due to incorrect PIN or similar. For Cards we retry over a period of 7 days.

AwaitingRetry

300002

Payment has failed to charge

Lost, stolen or closed Card.
Phone not available to SMS charges.
Unknown errors with the Gateway.

Failed

300003

Payment is expired.

The OneOff Payment was not accepted in time.

SessionExpired

300004

Payment was rejected by Debtor

Involves Debtor rejection of a request i.e. in a mobile app or home banking.

Rejected

300005

Payment was rejected by Gateway

Involves Gateway interaction.

Rejected

300006

Payment has failed to charge

Payment Method not active at the time of scheduling

Failed

Payment Cancel Codes and Descriptions

Please note that cancelDescription is a custom, optional string defined by the Creditor during cancellation, while cancelCode is applied systemically depending on the situation.

Cancel Code

Description

State

300101

Cancelled by Creditor in either UI or API integration.

Cancelled

 


Examples of common situations

The table below describes common situation in terms of error codes, cancel codes, state, and other relevant properties.

Examples (Click to expand)

Gateway rejects Payment Method signup due to invalid data

Payment Required by Agreement TRUE
Subscription state Active
Subscription errorCode 100001
Subscription cancelCode -
Payment Method state Failed
Payment Method errorCode 200001 + gatewayErrorCode + gatewayErrorCode
Payment Method cancelCode -

Gateway rejects Payment Method signup due to invalid data

Payment Required by Agreement FALSE
Subscription state Inactive
Subscription errorCode 100002
Subscription cancelCode -
Payment Method state Failed
Payment Method errorCode 200001 + gatewayErrorCode + gatewayErrorDescription
Payment Method cancelCode -

Debtor rejects Payment Method signup in mobile app

Payment Required by Agreement TRUE
Subscription state Active
Subscription errorCode 100001
Subscription cancelCode -
Payment Method state Rejected
Payment Method errorCode 200002 + gatewayErrorCode + gatewayErrorDescription
Payment Method cancelCode -

Debtor rejects Payment Method signup in mobile app

Payment Required by Agreement FALSE
Subscription state Inactive
Subscription errorCode -
Subscription cancelCode 100101
Payment Method state Rejected
Payment Method errorCode 200002 + gatewayErrorCode
Payment Method cancelCode -

Debtor cancels an active Payment Method in mobile app

Payment Required by Agreement TRUE
Subscription state Active
Subscription errorCode 100001
Subscription cancelCode -
Payment Method state Cancelled
Payment Method errorCode -
Payment Method cancelCode 200101

Debtor cancels an active Payment Method in mobile app

Payment Required by Agreement FALSE
Subscription state Inactive
Subscription errorCode -
Subscription cancelCode 100101
Payment Method state Cancelled
Payment Method errorCode -
Payment Method cancelCode 200101

Payment Method with Card is expired

Payment Required by Agreement TRUE
Subscription state Active
Subscription errorCode 100001
Subscription cancelCode -
Payment Method state Expired
Payment Method errorCode 200004 + gatewayErrorCode + gatewayErrorDescription
Payment Method cancelCode -

Payment Method with Card is expired

Payment Required by Agreement FALSE
Subscription state Inactive
Subscription errorCode 100002
Subscription cancelCode -
Payment Method state Expired
Payment Method errorCode 200004 + gatewayErrorCode + gatewayErrorDescription
Payment Method cancelCode -

Payment has failed to charge due to lost, stolen or closed Card.

Payment Required by Agreement TRUE
Subscription state Active
Subscription errorCode 100001
Subscription cancelCode -
Payment Method state Failed
Payment Method errorCode 200005 + gatewayErrorCode + gatewayErrorDescription
Payment Method cancelCode -

Payment has failed to charge due to lost, stolen or closed Card.

Payment Required by Agreement FALSE
Subscription state Inactive
Subscription errorCode 100002
Subscription cancelCode -
Payment Method state Failed
Payment Method errorCode 200005 + gatewayErrorCode + gatewayErrorDescription
Payment Method cancelCode -

Creditor put Subscription on hold

Payment Required by Agreement -
Subscription state Inactive
Subscription errorCode -
Subscription cancelCode -
Payment Method state as is
Payment Method errorCode -
Payment Method cancelCode -

Creditor cancels both Subscription and Payment Method using UI or API

Payment Required by Agreement -
Subscription state Inactive
Subscription errorCode -
Subscription cancelCode 100102
Payment Method state Cancelled
Payment Method errorCode -
Payment Method cancelCode 200102

Subscription is expired due to defined expiration date

Payment Required by Agreement -
Subscription state Inactive
Subscription errorCode -
Subscription cancelCode 100103
Payment Method state as is
Payment Method errorCode -
Payment Method cancelCode -

Was this article helpful?

0 out of 0 found this helpful