API
Payment
A preliminary check of parameters
xml json |
The URL for sending a request: | defined by the seller in additional parameter settings (if the url contains "format=json" then the data is transferred in json format) | ||||||||||||||||||
Method: | POST | ||||||||||||||||||
Request format: |
|
||||||||||||||||||
Response parameters: |
|
||||||||||||||||||
Response format: |
|
||||||||||||||||||
Response parameters: |
|
Determining the values of the parameters of the goods upon purchase
xml json |
The URL for sending a request: | https://api.digiseller.com/api/purchases/options | ||||||||||||||||||||||||||||||
Method: | POST | ||||||||||||||||||||||||||||||
Request headers: |
Accept: "application/json" Content-Type: "application/json" Accept: "application/xml" Content-Type: "application/xml" |
||||||||||||||||||||||||||||||
Request format: |
|
||||||||||||||||||||||||||||||
Request parameters: |
|
||||||||||||||||||||||||||||||
Response format: |
|
||||||||||||||||||||||||||||||
Response parameters: |
|
Work with the shopping cart
1. Adding of products to the cart
The URL for sending a request: | //shop.digiseller.ru/xml/shop_cart_add.asp | |||||||||||||||||||||||||||||||||||||||
Method: |
POST Content-Type: application/x-www-form-urlencoded |
|||||||||||||||||||||||||||||||||||||||
Request format: | product_id=1239468&product_cnt=2&typecurr=wmr&email=buyer_@email@mail.com&lang=ru-RU&cart_uid=6420808B4ACC46BEBB04749EC63FF062&id_po=22418804 | |||||||||||||||||||||||||||||||||||||||
Request parameters: |
|
|||||||||||||||||||||||||||||||||||||||
JSON response format: | ||||||||||||||||||||||||||||||||||||||||
Response parameters: |
|
2. Getting a list of in-cart products + updating product quantities in the cart
URL and request format: | //shop.digiseller.ru/xml/shop_cart_lst.asp | ||||||||||||||||||
Method: |
POST Content-Type: application/x-www-form-urlencoded |
||||||||||||||||||
Request parameters: |
|
||||||||||||||||||
JSON response format:
response sample |
|||||||||||||||||||
Response parameters: |
|
Jump to payment
An example of sending the user through FORM POST: |
|
|||||||||||||||||||||||||||||||||
Request parameters: |
|
Setup individual payment methods
1. Initialize payment
The URL for sending a request: | Is taken from settings from the "Payment URL" field | ||||||||||||||||||||||||||||||
Method: |
POST Content-Type: application/x-www-form-urlencoded |
||||||||||||||||||||||||||||||
Request format: | invoice_id=12345&amount=10.00¤cy=USD&description=товар&lang=ru-RU&payment_id=8&return_url=https://www.digiseller.market/info/buy.asp?id_i=12345&uid=FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA | ||||||||||||||||||||||||||||||
Request parameters: |
|
2. Update payment status
URL and request format: | https://digiseller.market/callback/api | ||||||||||||||||||||||||||||||
Method: |
GET Content-Type: application/x-www-form-urlencoded |
||||||||||||||||||||||||||||||
Request format: | invoice_id=12345&amount=10.00¤cy=USD&status=paid&signature=FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA | ||||||||||||||||||||||||||||||
Request parameters: |
|
3. Receiving payment status
URL and request format: | Is taken from settings from the "Payment status URL" field | ||||||||||||||||||||||||||||||
Method: |
GET Content-Type: application/x-www-form-urlencoded |
||||||||||||||||||||||||||||||
Request format: | invoice_id=12345&amount=10.00¤cy=USD&seller_id=8531&signature=FB4902995B8EDC36D9DC66F743E9E9CF9607284928E3CD484A0AA | ||||||||||||||||||||||||||||||
Request parameters: |
|
||||||||||||||||||||||||||||||
JSON response format: |
|
||||||||||||||||||||||||||||||
Response parameters: |
|
4. Signature
To form a query/response signature, a string must be formed from the query/response data as follows: for each pair (key, value), in alphabetical order of keys, first the key is written, then the ":" character (colon), then the value. Each key:value pair ends with ";" (semicolon)
Parameters: |
1. The hash function is SHA256 2. The secret key is taken from the settings |
Signature generation |
1. Generate a string from the query data 2. Generate HMAC for this string, according to the common algorithm of HMAC generation RFC 2104. In PHP, for example, this is done with the hash_hmac function, using its private key and the hash function specified in the parameter set. Выходная строка должна быть в формате HEX. |
Sample: |
Request data: invoice_id=12345&amount=10.00¤cy=USD&seller_id=8531 Resulting string: amount:10.00;currency:USD;invoice_id:12345;seller_id:8531; Response data: {"invoice_id":"12345", "amount":"10.00", "currency":"USD", "status":"paid"} Resulting string: amount:10.00;currency:USD;invoice_id:12345;status:paid; |