
The sms:bank is implemented like a transactional gateway; the end user is initiating the transaction by submitting the form found on your site, and afterwards commits the payment itself by sending a certain message to the given number. In this kind of implementation there are at least three userland keypoints:
- Form that initiates the transaction;
- Payment status pages (Success URL and Fail URL, must be given during the setup);
- Payment result processor (Result URL, must be given during the setup).
A sample form that gives the user an opportunity to initiate the transaction follows. Don't forget to replace xxxx with your group identifier, which is available from Control panel, under Purses, Gateway URL.
<form action="http://xxxx.bank.smscoin.com/language/english/bank/" method="POST">
<input name="s_purse" type="hidden" value="1" />
<input name="s_order_id" type="hidden" value="1234" />
<input name="s_amount" type="hidden" value="0.1" />
<input name="s_clear_amount" type="hidden" value="0" />
<input name="s_description" type="hidden" value="Demo payment" />
<input name="s_sign" type="hidden" value="0123456789abcdef0123456789abcdef" />
<input type="submit" value="Pay" />
</form>
The server accepts the following parameters:
| Parameter |
Type |
Description |
s_purse |
int |
Your sms:bank id. |
s_order_id |
int |
Operation id (any number; used primarily in order to differ one operation's results from another one's). |
s_amount |
float |
The payment amount, USD. |
s_clear_amount |
int(1) |
End user fee calculation algorithm. If 0, then s_amount is the end user price, else the s_amount is your profit from the operation; the price user pays is varied due to tarification issues in different countries. |
s_description |
char(127) |
Operation descriptor (whatever you want to be kept in your records; not used server-side). |
s_sign |
char(32) |
MD5 hash of a string consisting of s_purse, s_order_id, s_amount, s_clear_amount, s_description and secret_code (in that order) splitted by double colon ("::"), where secret_code is your sms:bank secret code. |
If the value of s_amount won't fit in some country's tarification grid, such country is automatically excluded from the list of serviceable by your sms:bank ones.
Payment status pages should accept the following parameters:
| Parameter |
Type |
Description |
s_purse |
int |
Your sms:bank id. |
s_order_id |
int |
Operation id (any number; used primarily in order to differ one operation's results from another one's). |
s_amount |
float |
The exact payment amount, with fee calculations applied (see below), USD. |
s_clear_amount |
int(1) |
End user fee calculation algorithm. If 0, then s_amount is the end user price, else the s_amount is your profit from the operation; the price user pays is varied due to tarification issues in different countries. |
s_status |
int(1) |
The payment status: 1 if success, 0 otherwise. |
s_sign |
char(32) |
MD5 hash of a string consisting of secret_code, s_purse, s_order_id, s_amount, s_clear_amount and s_status (in that order) splitted by double colon ("::"), where secret_code is your sms:bank secret code. |
Payment result processor should accept the following parameters:
| Parameter |
Type |
Description |
s_purse |
int |
Your sms:bank id. |
s_order_id |
int |
Operation id (any number; used primarily in order to differ one operation's results from another one's). |
s_amount |
float |
The exact payment amount, with fee calculations applied (see below), USD. |
s_clear_amount |
int(1) |
End user fee calculation algorithm. If 0, then s_amount is the end user price, else the s_amount is your profit from the operation; the price user pays is varied due to tarification issues in different countries. |
s_inv |
int |
An ordinal number of an operation. |
s_phone |
char(32) |
Phone number of a subscriber in question. |
s_sign_v2 |
char(32) |
MD5 hash of a string consisting of secret_code, s_purse, s_order_id, s_amount, s_clear_amount, s_inv and s_phone (in that order) splitted by double colon ("::"), where secret_code is your sms:bank secret code. |
You can find an example of the service here.
Download source code in PHP, Perl, ASP.NET.
Please note: code samples are purely illustrative, and thereby their use in production environments without substantial revision is highly unadvised.