Agency API. Payments: различия между версиями

Материал из Центр поддержки системы бронировании
Перейти к навигации Перейти к поиску
(Response)
(См. также)
Строка 294: Строка 294:
  
 
*[[Агентский АПИ]]
 
*[[Агентский АПИ]]
 +
*[[Nemo web services payment integration for mobile apps]]

Версия 13:41, 21 января 2015

Getting list of allowed payment gateways

WSDL is located on URL: http://CLIENT_DOMAIN/wsdev/wsdl.php?version=1.0&for=PaymentInitialization

This query allows to get a list of payment gateways to pay a specific order. For each gateway following parameters are retrieved:

  • ID of the payment method
  • Name of the gateway
  • Payment charge that will be added to the total price of the order
  • URL on which user have to be redirected to enter payment data on the gateway side
  • Optional URL on which user is redirected after the payment is finished.

Common request / response format

Request

 1 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DPaymentInitialization">
 2    <soapenv:Header/>
 3    <soapenv:Body>
 4       <ver:InitPayment>
 5          <RequestBin>
 6             <Request>
 7                <OrderId>?</OrderId>
 8                <!--OrderId — Id of booked order. Mandatory--> 
 9                <ReturnUrlToCatch>?</ReturnUrlToCatch>
10                <!--ReturnUrlToCatch - Indicate if it is needed to return URL address to which user will be redirected after payment.-->
11                <!--Optional:--> 
12             </Request>
13             <Source>
14                <ClientId>?</ClientId>
15                <!--ClientId — Client ID in Nemo. You can to see/add it Admin panel in section "Administration" - "Web service. Authorization". Mandatory--> 
16                <APIKey>?</APIKey>
17                <!--APIKey — Secret access key to Nemo API. You can to see/add it Admin panel in section "Administration" - "Web service. Authorization". Mandatory--> 
18                <Language>?</Language>
19                <!--Language — Example: RU--> 
20                <Currency>?</Currency>
21                <!-- Currency — Example: RUB, EUR--> 
22             </Source>
23          </RequestBin>
24       </ver:InitPayment>
25    </soapenv:Body>
26 </soapenv:Envelope>

Response

 1 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DPaymentInitialization">
 2    <SOAP-ENV:Body>
 3       <ns1:InitPaymentResponse>
 4          <ResponseBin>
 5             <Response>
 6                <Gateways>
 7                   <Gateway>
 8                      <PaymentMethodId>?</PaymentMethodId>
 9                      <!--PaymentMethodId - ID of the payment method. This parameter can be used in the SelectPayment request-->
10                      <GatewayName>?</GatewayName>
11                      <!--GatewayName — Name of payment gateway. For example: Uniteller -->
12                      <PaymentCharge Currency="?">?</PaymentCharge>
13 	             <!--PaymentCharge — charge which have to be added to the total price. Currency — ISO Currency code, have to be the same as in the request.-->
14                      <RedirectUrl>?</RedirectUrl>
15                      <!--RedirectUrl — URL on which user is redirected to get on gateway payment page-->
16                      <UrlToCatch>?</UrlToCatch>
17 	             <!--UrlToCatch — URL on which user is redirected after payment finishing-->
18                   </Gateway>
19                </Gateways>
20             </Response>
21          </ResponseBin>
22       </ns1:InitPaymentResponse>
23    </SOAP-ENV:Body>
24 </SOAP-ENV:Envelope>

Samples of using

Request

 1 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DPaymentInitialization">
 2    <soapenv:Header/>
 3    <soapenv:Body>
 4       <ver:InitPayment>
 5          <RequestBin>
 6             <Request>
 7                <OrderId>276965</OrderId>
 8                <ReturnUrlToCatch>true</ReturnUrlToCatch>
 9             </Request>
10             <Source>
11                <ClientId>---</ClientId>
12                <APIKey>---</APIKey>
13                <Language>RU</Language>
14                <Currency>RUB</Currency>
15             </Source>
16          </RequestBin>
17       </ver:InitPayment>
18    </soapenv:Body>
19 </soapenv:Envelope>

Response

 1 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DPaymentInitialization">
 2    <SOAP-ENV:Body>
 3       <ns1:InitPaymentResponse>
 4          <ResponseBin>
 5             <Response>
 6                <Gateways>
 7                   <Gateway>
 8                      <PaymentMethodId>1075</PaymentMethodId>
 9                      <GatewayName>Uniteller</GatewayName>
10                      <PaymentCharge Currency="RUB">81.54</PaymentCharge>
11                      <RedirectUrl>http://CLIENT_DOMAIN/payment__select_outside?booking_id=276965&amp;one_time_booking_code=PZ7981&amp;method=27</RedirectUrl>
12                      <!--Пример ссылки-->
13                      <UrlToCatch>http://CLIENT_DOMAIN/poffice__bookinfo?&amp;booking_id=276965</UrlToCatch>
14                      <!--Пример ссылки-->
15                   </Gateway>
16                      <Gateway>
17                      <PaymentMethodId>1079</PaymentMethodId>
18                      <GatewayName>Rapida</GatewayName>
19                      <PaymentCharge Currency="RUB">123</PaymentCharge>
20                      <RedirectUrl/>
21                      <UrlToCatch xsi:nil="true"/>
22                   </Gateway>
23                </Gateways>
24             </Response>
25          </ResponseBin>
26       </ns1:InitPaymentResponse>
27    </SOAP-ENV:Body>
28 </SOAP-ENV:Envelope>

Note: if the <RedirectUrl/> tag is empty, the SelectPayment method should be used.

Selecting a payment method

WSDL is located on URL: http://CLIENT_DOMAIN/wsdev/wsdl.php?version=1.0&for=SelectPayment

This query allows to select a specific payment method. Currently it is available for Rapida gateway.

Common request / response format

Request

 1 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DSelectPayment">
 2   <soapenv:Header/>
 3   <soapenv:Body>
 4     <ver:SelectPayment>
 5       <RequestBin>
 6         <Request>
 7           <OrderId>?</OrderId>
 8            <!--OrderId — Id of booked order. Mandatory-->
 9           <PaymentMethodId>?</PaymentMethodId>
10           <!--PaymentMethodId - ID of the payment method. This parameter can be taken from the PaymentInitialization response. Mandatory-->
11         </Request>
12         <Source>
13           <ClientId>?</ClientId>
14            <!--ClientId — Client ID in Nemo. You can to see/add it Admin panel in section "Administration" - "Web service. Authorization". Mandatory-->
15           <APIKey>?</APIKey>
16            <!--APIKey — Secret access key to Nemo API. You can to see/add it Admin panel in section "Administration" - "Web service. Authorization". Mandatory-->
17           <Language>?</Language>
18           <!--Language — Example: RU-->
19           <Currency>?</Currency>
20           <!-- Currency — Example: RUB, EUR-->
21         </Source>
22       </RequestBin>
23     </ver:SelectPayment>
24   </soapenv:Body>
25 </soapenv:Envelope>

Response

 1 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DSelectPayment">
 2   <SOAP-ENV:Body>
 3       <ns1:SelectPaymentResponse>
 4          <ResponseBin>
 5             <Response>
 6                <TransactionId>?</TransactionId>
 7                <!--TransactionId - ID of the payment transaction in the Nemo system-->
 8                <PaymentParameters>
 9                   <PaymentParameter>
10                      <Key>Code</Key>
11                      <Value>?</Value>
12                      <!--Value - payment code number. It is returned by the payment gateway.-->
13                   </PaymentParameter>
14                   <PaymentParameter>
15                      <Key>Timelimit</Key>
16                      <Value>?</Value>
17                      <!--Value - payment time limit for the order-->
18                   </PaymentParameter>
19                   <PaymentParameter>
20                      <Key>Description</Key>
21                      <Value>?</Value>
22                      <!--Value - a brief description for the client. It may contain the timelimit, payment code or some other information. Can be changed in the payment gateway settings in the Nemo system-->
23                   </PaymentParameter>
24                </PaymentParameters>
25             </Response>
26          </ResponseBin>
27       </ns1:SelectPaymentResponse>
28    </SOAP-ENV:Body>
29 </SOAP-ENV:Envelope>

Samples of using

Request

 1 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DSelectPayment">
 2   <soapenv:Header/>
 3   <soapenv:Body>
 4     <ver:SelectPayment>
 5       <RequestBin>
 6         <Request>
 7           <OrderId>279712</OrderId>
 8           <PaymentMethodId>1079</PaymentMethodId>
 9         </Request>
10         <Source>
11           <ClientId>--</ClientId>
12           <APIKey>--</APIKey>
13           <Language>RU</Language>
14           <Currency>RUB</Currency>
15         </Source>
16       </RequestBin>
17     </ver:SelectPayment>
18   </soapenv:Body>
19 </soapenv:Envelope>

Response

 1 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://CLIENT_DOMAIN/wsdev/?version%3D1.0%26for%3DSelectPayment">
 2   <SOAP-ENV:Body>
 3       <ns1:SelectPaymentResponse>
 4          <ResponseBin>
 5             <Response>
 6                <TransactionId>117608085</TransactionId>
 7                  <PaymentParameters>
 8                   <PaymentParameter>
 9                      <Key>Code</Key>
10                      <Value>a117608085a0CGN73</Value>
11                   </PaymentParameter>
12                   <PaymentParameter>
13                      <Key>Timelimit</Key>
14                      <Value>23:59 20.01.2015</Value>
15                   </PaymentParameter>
16                   <PaymentParameter>
17                      <Key>Description</Key>
18                      <Value>Your payment code is a117608085a0CGN73. You have to pay the order until 23:59 20.01.2015</Value>              
19                   </PaymentParameter>
20                </PaymentParameters>
21             </Response>
22          </ResponseBin>
23       </ns1:SelectPaymentResponse>
24    </SOAP-ENV:Body>
25 </SOAP-ENV:Envelope>

См. также