Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Step 7. OpenTrade Commerce will send back the payment data in response to the GetPaymentParameters method invocation. 

Раскрыть

...

titleClick here to expand
PaymentFormAnswer response sample

 

Блок кода
<?xml version="1.0" encoding="utf-8"?>
<PaymentFormAnswer>
  <ErrorCode>Ok</ErrorCode>
  <Result>
    <RequestMethod>POST</RequestMethod>
    <RequestUrl>http://example.com/test.php</RequestUrl>
    <Parameters>
      <Parameter>
        <Name>paymentId</Name>
        <Value>222</Value>
      </Parameter>
      <Parameter>
        <Name>userId</Name>
        <Value>0000000001</Value>
      </Parameter>
      <Parameter>
        <Name>amount</Name>
        <Value>500.15</Value>
      </Parameter>
      <Parameter>
        <Name>currency</Name>
        <Value>643</Value>
      </Parameter>
      <Parameter>
        <Name>description</Name>
        <Value>Top up the account USR-0000000001 (user 0000000001, payment 222)</Value>
      </Parameter>
    </Parameters>
  </Result>
</PaymentFormAnswer>

where

Parameter

Description

 

RequestUrl

Test page address for testing a custom payment system to be implemented

 

RequestMethod

Communication method

GET/POST

Parameter

Payment parameter which is KeyValuePair

 

Parameter.Name

Parameter name

 

Parameter.Value

Parameter value

 

Variants of parameters names (for description see 3.3.1)

Parameter name

Optional

orderID

+

PaymentID

 

UserID

 

Amount

 

Currency

 

Description

 

SuccessUrl

 

failUrl

 

resultUrl

 

...

Step 15. The contractor will notify OpenTrade Commerce of the completed payment.

Раскрыть
titleClick here to

...

expand

It is necessary to pass the following parameters to the notification address (resultUrl provided to OpenTrade Commerce in Step7) using the HTTP transport.

Parameters (for description see 3.3.1):

Parameter Name

Optional

instancekey

 

orderID

+

payment ID

 

userID

 

amount

 

currency

 

status

 

signature

...

 


Step 16. OpenTrade Commerce will verify the notification parameters. If everything checks out and the payment status is considered “Completed”, OpenTrade Commerce will enter a sum to the payer’s account.

Step 17. OpenTrade Commerce will confirm the contractor that the payment notification has been received.

Раскрыть
titleExamples of responses to notifications

 

Error-free notification processing response

Блок кода
languagephp
linenumberstrue
<?xml version="1.0" encoding="utf-8"?>
<NoticeAnswer>
  <PaymentId>222</PaymentId>
  <ErrorCode>Ok</ErrorCode>
</NoticeAnswer>

 

Response with error code

Блок кода
languagephp
linenumberstrue
<?xml version="1.0" encoding="utf-8"?>
<NoticeAnswer>
  <PaymentId>222</PaymentId>
  <ErrorCode>VerificationError</ErrorCode>
  <ErrorDescription>Unknown notification status: 'Overpaid'</ErrorDescription>
</NoticeAnswer>

 

Where

Parameter

Description

Payment ID

Unique ID identifying payment at OpenTrade Commerce internal billing system

ErrorCode

Error code. For details refer to 3.3.2

ErrorDescription

Error description

...


Step 18. The contractor will confirm the PS that the payment notification has been received 

3.3 Tables

3.3.1 Payment parameters

Parameter

Description

Allowed Values

Note

Instancekey

Unique ID identifying contractor

 

 

secret

Payment secret

 

Required for creation of a digital signature 3.4.

Provided to the Contractor by Opentrade Commerce

orderId

Unique ID identifying order for payment

 

Available if a customer pays for an order

Unavailable when replenishing

paymentId

Unique ID identifying payment at OpenTrade Commerce internal billing system

 

 

userId

Unique ID identifying OpenTrade Commerce user

 

 

Amount

Amount of payment

 

The point as a decimal mark and two digits after it

Currency

ISO 4217 (3-letter currency code)

643 - RUB

http://en.wikipedia.org/wiki/ISO_4217

Status

Payment status

Completed

 

Canceled

 

Signature

MD5-hash of digital signature

 

32 hexadecimal uppercase symbols

description

Payment description

 

 

 

3.3.2 NoticeErrorCode description

...

Code

Description

OK

A notification has been processed.

VerificationError

Incoming data verification error

SignatureVerificationError

There is a mismatch between the digital signature received from the contractor and the one calculated by OpenTrade Commerce

 

InternalError

OpenTrade Commerce service internal error. Unhandled error

 

...

3.4.Rules for elaborating a digital signature when the contractor notifies Opentrade Commerce

 

The MD5-hash algorithm is applied to a text represented as a sequence of parameter values separated by semicolon.

Orderld; paymentld; amount; currency; status; secret

 


Example:

String

Result

111;222;0000000001;500.15;643;Completed;secret

11AE0ABC8F0CF443F950D84C278F1C51

 

 

 

 

 

...