Agency API. Payments
Содержание
Getting list of allowed payment gateways
WSDL is located on URL: http://CLIENT_DOMAIN/wsdev/wsdl.php?version=1.0&for=PaymentInitialization
This query allow to get list of payment gateways to pay specific order. For each gateway following parameters are retrieved:
- Name of gateway
- Payment charge that will be added to total price of an order
- URL on which user have to be redirected to enter payment data on gateway side
- Optional URL on which user is redirected after finish of payment.
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 should 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&one_time_booking_code=PZ7981&method=27</RedirectUrl>
12 <!--Пример ссылки-->
13 <UrlToCatch>http://CLIENT_DOMAIN/poffice__bookinfo?&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.