Subscription web service
The following is a detailed description of the input and output values for the subscription web service, which handles subscriptions. The web service for subscriptions is found here:
https://ssl.ditonlinebetalingssystem.dk/remote/subscription.asmx
How to read the documentation
Every description of a function consists of input and output fields. Input fields are all the fields the web service expects you to set as you call it. Mandatory fields must be entered - the rest can be empty values. The output fields are the ones returned by the web service.
Data flow
-
CreateSubscription - requires PCI certification. Instead, use our payment window or a payment request (by saving the payment card).
-
When the subscription is created, you can do ordinary authorisations on the subscription by using the authorize function. Here the card holder's credit card is validated (and stored in ePay's system), and a payment is created. When the payment is created, you must process it by using the webservice payment.asmx, which handles normal payments (capture, credit, delete). You can use authorize as often as needed, and you choose the amount yourself.
-
If a customer wants to quit his/her subscription, the DeleteSubscription must be called, and ePay deletes the subscription.
authorize
input
Input | Type | Values | Description | Mandatory |
---|---|---|---|---|
merchantnumber | Integer | 7 digits | Your unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration. | Yes |
subscriptionid | Long | The unique number that identifies the subscriber. | Yes | |
orderid | String | Max 20 characters. (Nets recommends that the order ID is 8 digits max. Numbers from 0-9) | The order ID from your own system. Used as a reference between your system and ePay. | Yes |
amount | Integer | Use minor units | The amount in minor units. E.g. DKK 125.75 must be specified as 12575 in the amount field. | Yes |
currency | String | 208 = DKK 978 = EUR 840 = USD | The currency of the transaction. See all currency codes here. | Yes |
instantcapture | Integer | 0 = Manually 1 = Automatically | If you put this at 1, the payment is captured automatically. By default, it is set at 0 and you have to capture the payment from the ePay administration or through our API/web service. | Yes |
group | String | Max 100 characters. | The group to which the payment is associated. | No |
description | String | Max 1024 characters. | A description of the payment. You can see it in your ePay administration. | No |
String | Max 100 characters. | If you enter an email address here, you'll receive an email when the payment is authorised. This is NOT for your customer's order confirmation. | No | |
ipaddress | String | Max 15 characters. | Card holder's IP address. This is used by Fraud Fighter. | No |
Output
Output | Type | Values | Description |
---|---|---|---|
authorizeResult | Boolean | See description of output values. | |
transactionid | Long | The unique number which identifies the payment. It is returned at authorisation. | |
pbsresponse | Integer | If Nets rejects the capture, you can find the error code here. If the capture is successful, the value is 0. | |
epayresponse | Integer | If ePay rejects the capture, you can find the error code in epayresponse. | |
Output values | If the payment is successful, authorizeResult is returned as true. If not, the value is false. When you get a false, you can use epayresponse and pbsresponse to determine the source of error. If, for instance, this function returns a false, and epayresponse is (-1) and pbsresponse is 118, the reason is that Nets declined the payment because they don't recognise the card number. But if the function returns a false, and epayresponse is (-1002), it's because ePay doesn't recognise the merchant number. |
deletesubscription
Input
Input | Type | Values | Description | Mandatory |
---|---|---|---|---|
merchantnumber | Integer | 7 digits | Your unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration. | Yes |
subscriptionid | Long | The unique number which identifies the subscriber. | Yes |
Output
Output | Type | Values | Description |
---|---|---|---|
deletesubscriptionResult | Boolean | See description of output values. | |
epayresponse | Integer | If ePay rejects the deletion, you can find the error code in epayresponse. | |
Output values | If the subscription is deleted, deletesubscriptionResult is returned as true. If not, the value is false. When the value is false, please use epayresponse to determine the source of error. |
getEpayError
Input
Input | Type | Values | Description | Mandatory |
---|---|---|---|---|
merchantnumber | Integer | 7 digits | Your unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration. | Yes |
language | Integer | 1 | The labguage in which the result is returned: (1) for Danish (2) for English (3) for Swedish | Yes |
epayresponsecode | Integer | The error code you receive from Nets in pbsresponse. | No |
Output
Output | Type | Values | Description |
---|---|---|---|
getEpayErrorResult | Boolean | See description of output values. | |
epayResponseString | String | The error returned as a string from ePay. | |
epayresponse | Integer | If ePay rejects the call, you can find the error code in epayresponse. | |
Output values | If it is possible to retrieve information about the error code, getEpayErrorResult is returned as true. If not, the returned value is false. When the returned value is false, epayresponse must be used to determine the source of error. |
getPbsError
Input
Input | Type | Values | Description | Mandatory |
---|---|---|---|---|
merchantnumber | Integer | 7 digits | Your unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration. | Yes |
language | Integer | 1 | The language in which the result is returned: (1) for Danish (2) for English (3) for Swedish | Yes |
pbsresponsecode | Integer | The error code you receive from Nets in pbsresponse. | No |
Output
Output | Type | Values | Description |
---|---|---|---|
getPbsErrorResult | Boolean | See description of output values. | |
pbsResponseString | String | The error returned as a string from ePay. | |
epayresponse | Integer | If ePay rejects the call, you can find the error code in epayresponse. | |
Output values | If it is possible to retrieve information about the error code, getPbsErrorResult is returned as true. If not, the returned value is false. When the returned value is false, epayresponse must be used to determine the source of error. |
getsubscriptions
Input
Input | Type | Values | Description | Mandatory |
---|---|---|---|---|
merchantnumber | Integer | 7 digits | Your unique merchant number. The number is located on your agreement with the acquirer or in your ePay administration. | Yes |
subscriptionid | Long | The unique number which identifies the subscriber. If this value is put at 0, all created subscriptions are returned. If the value is > 0, only the subscription matching the ID is returned. | Yes |
Output
Output | Type | Values | Description |
---|---|---|---|
getsubscriptionsResult | Boolean | See description of output values. | |
subscriptionAry | An array of the type SubscriptionInformationType. The object consists of the following elements: subscriptionid, description, created and transactionList, which is an array containing payments completed on the subscription. | ||
subscriptionid | Long | The unique number which identifies the subscription. | |
description | String | Max 1024 characters | Description of the payment. You can find the description on the payment in the ePay administration. |
created | Datetime | The time stamp for the creation of the subscription. | |
transactionList | TransactionInformationType | An array of type TransactionInformationType. Find information about his type in the gettransactionlist for ordinary payments. | |
Output values | If it's possible to retrieve a list of subscriptions, the value is returned as true. If not, the returned value is false. When the value is returned as false, please use epayresponse to determine the source of error. |
Troubleshooting
All deviations in the system are stored in a separate log which is accessed from the ePay administration. If you're having problems when calling our web service, information for troubleshooting (debugging) is available in this log.
The log is located in your ePay administration in the menu API/Web services
-> Remote log. All error codes are available in Support
-> System error codes and Support
-> Error codes from PBS
.