Knowledge Base

Get help for payment solutions. Search our articles or browse by category below.

7.2.1 Stored Subscription Creation Request

The following is an example of a Stored Subscription Registration request for a terminal:

<?xml version="1.0" encoding="UTF-8"?>
<ADDSTOREDSUBSCRIPTION>
	<MERCHANTREF>MR001</MERCHANTREF>
	<TERMINALID>6491002</TERMINALID>
	<DATETIME>30-07-2009:15:26:38:027</DATETIME>
	<NAME>Animal Life</NAME>
	<DESCRIPTION>Magazine membership</DESCRIPTION>
	<PERIODTYPE>MONTHLY</PERIODTYPE>
	<LENGTH>12</LENGTH>
	<CURRENCY>EUR</CURRENCY>
	<RECURRINGAMOUNT>15.87</RECURRINGAMOUNT>
	<INITIALAMOUNT>10.99</INITIALAMOUNT>
	<TYPE>AUTOMATIC</TYPE>
	<ONUPDATE>CONTINUE</ONUPDATE>
	<ONDELETE>CANCEL</ONDELETE>
	<HASH>750f7c545a3d63ecaf3b48c149b95555</HASH>
	<CUSTOMFIELD NAME=”ACCOUNTID”></CUSTOMFIELD>
	<CUSTOMFIELD NAME=”EVENTID” />
</ADDSTOREDSUBSCRIPTION>


Example of a Stored Subscription Updating request:

<?xml version="1.0" encoding="UTF-8"?>
<UPDATESTOREDSUBSCRIPTION>
	<MERCHANTREF>13231</MERCHANTREF>
	<TERMINALID>6491002</TERMINALID>
	<DATETIME>31-07-2009:16:07:21:000</DATETIME>
	<NAME>Animal Life</NAME>
	<DESCRIPTION>Magazine membership</DESCRIPTION>
	<LENGTH>12</LENGTH>
	<CURRENCY>EUR</CURRENCY>
	<RECURRINGAMOUNT>15.99</RECURRINGAMOUNT>
	<INITIALAMOUNT>10.99</INITIALAMOUNT>
	<TYPE>AUTOMATIC</TYPE>
	<ONUPDATE>CONTINUE</ONUPDATE>
	<ONDELETE>CANCEL</ONDELETE>
	<HASH>5023bbb6726d1b5d2dcb7c77fb11b94f</HASH>
	<CUSTOMFIELD NAME=”ACCOUNTID”></CUSTOMFIELD>
	<CUSTOMFIELD NAME=”EVENTID” />
</UPDATESTOREDSUBSCRIPTION>


Field description:

Filter:

Field Name Required Description
MERCHANTREF Y Unique merchant identifier per terminal. Length is limited to 48 chars.
TERMINALID Y A Terminal ID provided by Worldnet.
DATETIME Y Format: DD-MM-YYYY:HH:MM:SS:SSS.
NAME Y Display name for subscription.
DESCRIPTION Y Description explaining subscription.
LENGTH Y 0 for non ending/ multiplier of period. This does not take effect if (Subscription length * Period Type) > (End Date - Current Date).
CURRENCY Y Currency of subscription, this must either the base currency of the terminal or if supported, one of the configured allowed currencies.
RECURRINGAMOUNT Y Cost of each payment (will be ignored if manual).
INITIALAMOUNT Y Initial (set-up) payment to be taken off card. Payment will not be taken if 0.
TYPE Y MANUAL / AUTOMATIC / AUTOMATIC (WITHOUT AMOUNTS).
ONUPDATE Y UPDATE/CONTINUE (Update name, description, recurringprice, setupprice, subscriptionlength, periodtype, type for all subscriptions/ let them finish their subscription prior to update)
ONDELETE Y CANCEL/CONTINUE (Cancel all subscriptions/Continue subscription until cancelled manually or reach end date or length).
HASH Y An MD5 HASH. See note 1 below.
CUSTOMEFIELD N Use the “NAME” xml attribute to assign the name of the custom field. See section 3.4 for more info. No value is required and any value sent will be ignored.


Notes:

1. The MD5 HASH is generated using the following as an input string:

TERMINALID+MERCHANTREF+DATETIME+TYPE+NAME+CURRENCY+RECURRINGAMOUNT+INITIALAMOUNT+LENGTH+secret


If new stored subscription was successfully registered, response would be:

<ADDSTOREDSUBSCRIPTIONRESPONSE>
	<MERCHANTREF>13231</MERCHANTREF>
	<DATETIME>30-07-2009:15:26:39:745</DATETIME>
	<HASH>d04c3bab519095ecb046eff91722e8df</HASH>
</ADDSTOREDSUBSCRIPTIONRESPONSE>


Example of a successful stored subscription updating response:

<UPDATESTOREDSUBSCRIPTIONRESPONSE>
	<MERCHANTREF>13231</MERCHANTREF>
	<DATETIME>31-07-2009:16:07:21:329</DATETIME>
	<HASH>0af49616cad0fd1e19bc709de7d7c934</HASH>
</UPDATESTOREDSUBSCRIPTIONRESPONSE>


The following fields will be returned in the response:

Field Name Description
MERCHANTREF Original Merchant Reference sent in registration request.
DATETIME Format: DD-MM-YYYY:HH:MM:SS:SSS.
HASH An MD5 HASH. See note 1 below.


Notes:

1. The MD5 HASH is generated using the following as an input string:

TERMINALID+MERCHANTREF+DATETIME+secret


Errors handling
If stored subscription was not registered or updated, error code and error message will be returned:

<ERROR>
	<ERRORCODE>E08</ERRORCODE>
	<ERRORSTRING>INVALID MERCHANTREF</ERRORSTRING>
</ERROR>


Stored Subscription creation and updating error codes:

Filter:

Error Code Description
E01 SYSTEM ERROR - TRY AGAIN
E03 OPERATION NOT ALLOWED
E06 INVALID TERMINAL ID
E07 METHOD NOT SUPPORTED
E08 INVALID MERCHANTREF
E09 INVALID DATETIME
E13 INVALID HASH
E20 INVALID LENGTH
E21 INVALID PERIOD TYPE
E22 INVALID NAME
E23 INVALID DESCRIPTION
E24 INVALID RECURRINGAMOUNT
E25 INVALID INITIALAMOUNT
E26 INVALID TYPE
E27 INVALID ONUPDATE
E28 INVALID ONDELETE
E29 INVALID TERMINAL CURRENCY

Copyright © 2017 Worldnet Knowledge Base | Powered by DokuWiki
developer/integrator_guide/7._subscriptions/7.2._xml_subscriptions/7.2.1._stored_subscription_creation.txt · Last modified: 2016/07/26 13:04 (external edit)