Payment API

Payment Method

API Documentation

Senest redigeret:

Introduction

A Payment Method represents a valid method of charging the End User. This could either be an active card, an active Betalingsservice, or an active MobilePay Subscription.

Properties

Name

Type

Description

paymentMethodGuid

STRING

Unique GUID

paymentSessionGuid

STRING

GUID of Payment Session used internally

contactGuid

STRING

GUID of Contact

state

STRING

Please see list of Payment Method States below

paymentMethodType

STRING

Please see list of Payment Method Types below

paymentMethodAccountingCode

STRING

Accounting Code defined by Payment Method. Please see list below

paymentGatewayProvider

STRING

Please see list of Payment Gateway Providers below

paymentGatewayGuid

STRING

GUID of Payment Gateway used internally

paymentGatewaySubscriptionReferenceId

STRING

A token from the chosen Payment Gateway used for recurring payments

metaData

JSON Object

Contains metadata such as card type, masked card number etc.

createdTs

DATE

Timestamp of Payment Method creation

cancelledTs

DATE

Timestamp of cancellation

cancelCode

INTEGER

Please see list of Cancel Codes below

cancelDescription

STRING

User friendly description of cancellation

expireTs

DATE

Timestamp of expiration

errorCode

INTEGER

Please see list of Payment Method Error Codes below

errorDescription

STRING

User friendly description of the provided error

gatewayErrorCode

INTEGER

Error code from Payment Gateway. Please see: Error and Cancel Codes

gatewayErrorDescription

STRING

Error description from Payment Gateway. Please see: Error and Cancel Codes

rawErrorString

STRING

Uninterpreted error response provided by Payment Gateway

Endpoints

GET /paymentMethod/{guid}

Get a single Payment Method.

Response

HTTP 200 Example

{
  "paymentMethodGuid": "a863d62e-d53b-4651-9b7b-xxxxxxxxxxxx",
  "paymentSessionGuid": "",
  "contactGuid": "",
  "state": "",
  "paymentMethodType": "",
  "paymentMethodAccountingCode": "",
  "paymentGatewayProvider": "",
  "paymentGatewayGuid": "",
  "paymentGatewaySubscriptionToken": "",
  "createdTs": "",
  "cancelledTs": "",
  "cancelCode": "",
  "cancelDescription": "",
  "expireTs": "",
  "errorCode": "",
  "errorDescription": "",
  "metaData": {
    "card": {
      "type": "Dankort",
      "expiresTs": "2020-01",
      "cardNumber": "457150XXXXXX7478",
      "acquirer": "Nets/Teller"
    },
    "bs": {
      "mandate": "956964XXX",
      "customerNumber": "605XXX"
    },
    "mps": {
      "externalId": "1568581537XXX"
    },
    "sms": {
      "msisdn": "4512345678"
    }
  }
}

 

GET /paymentMethod/{guid}/subscriptions

Get a list of Subscriptions for a single Payment Method.

Response

HTTP

Description

200

OK

404

Payment Method was not found

HTTP 200 Example

[
  {
    "subscriptionGuid": "a863d62e-d53b-4651-9b7b-xxxxxxxxxxxx",
    "...": "..."
  },
  {
    "subscriptionGuid": "a863d62e-d53b-4651-9b7b-xxxxxxxxxxxx",
    "...": "..."
  }
]

 

POST /paymentMethod/{guid}/Cancel

Cancel a Payment Method. Please note this is not allowed if Pending Payments exists.
If the Payment Method is applied to a Subscription of an Agreement marked as Payment Required, the Subscription's state will remain as is. Otherwise the Subscription will change state to: "Inactive".

Request

The following must be provided as the request body:

{
  "cancelCode": "...",
  "cancelDescription": "..."
}

Response

HTTP

Description

202

Accepted

400

Bad Request

404

Payment Method not found

A callback is sent when the cancel operation either fails or succeeds.

 

Payment Gateway Providers

Payment Gateway Provider

Description

ePay

Delivers payments methods: Dankort, Visa, MasterCard, MobilePay Online etc. (recently bought by Bambora)

MobilePay

MobilePay Subscriptions

Betalingsservice

Betalingsservice (Basis and Total Solution)

LinkMobility

Delivers SMS payment method

SMSCPH

Delivers SMS payment method

Test

Used for testing purposes

Log

Only used in Sandbox for testing purposes

 

Payment Method Types

Payment Method

Description

Card

Single and Recurring payments via Dankort, Visa, MasterCard etc.

MobilePayOnline

Single payments via MobilePay Online

MobilePaySubscriptions

OneOff and Recurring payments via MobilePay Subscriptions

Betalingsservice

Recurring payments via Betalingsservice, inclusive Payment Slips (Indbetalingskort)

SMS

Single payments via SMS keywords

Test

Single and Recurring payments as Test

Log

Only used in Sandbox for testing purposes

 

Payment Method Accounting Codes (examples)

Payment Method Accounting Code

Description

BetalingsserviceMandate

Betalingsservice by bank

BetalingsservicePaymentSlip

Betalingsservice by payment slip (giro / FI-card)

Dankort

Dankort

Forbrugsforeningen

Forbrugsforeningen

Maestro (foreign)

Maestro from countries other than Denmark

Mastercard

Mastercard

Mastercard (foreign)

Mastercard from countries other than Denmark

MobilePay

MobilePay

Visa

Visa

Visa Electron

Visa Electron

Visa/Dankort

Visa or Dankort

Visa/Electron (foreign)

Visa/Electron from countries other than Denmark

 

Payment Method States

Following is a list of Payment Method states with a state diagram below:

State

Description

New

A Payment Method that has been created, but not yet sent to the payment gateway.

Pending

The request has been sent to chosen Payment Gateway

SessionExpired

Used for MobilePay Subscriptions that was not accepted in time.

Active

The Payment Method is active

Expired

The Payment Method is expired. Primarily used for cards.

Rejected

The Payment Method was rejected by the End User prior to activation.

Cancelled

The Payment Method was cancelled by the End User or Merchant.

Failed

The Payment Method reaches failed, if none of the above applies.

Inactive

The Payment Method is inactive

 

Payment Method State Diagram

Payment_State_Diagram-Payment_Method.png

Payment Method Error Codes and Descriptions

For further examples and ties to other entities, please see: Error and Cancel Codes

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

For further examples and ties to other entities, please see: Error and Cancel Codes

Cancel Code

Description

State

200101

Cancelled by Debtor

Cancelled

200102

Cancelled by Creditor

Cancelled

200103

Cancelled by System

Cancelled