Below is an example of an xml message that should be sent using the POST method to https://anketa.alfabank.ru/alfaform-pos/endpoint

Suppose I have a form on the site

<form action="https://anketa.alfabank.ru/alfaform-pos/endpoint" method="post"> <button>Отправить</button> </form> 

how to implement sending?

 <inParams> <brokerInfo> <Id>1</ Id> <logotype> http://www.logo.ru/logotype.png</logotype> </brokerInfo> <companyInfo> <inn>1111111111</inn> <referer>http://ulmart.ru/my_endpoint</referer> </companyInfo> <creditInfo> <reference>RFE003453PO</reference> <firstPayment>0</firstPayment> <creditPeriod>15</creditPeriod> <creditProductCode>ILEF</creditProductCode> <shopCode>AABB01_IS1</shopCode> </creditInfo> <clientInfo> <lastname>Арсентьев</lastname> <firstname>Антон</firstname> <middlename>Андреевич</middlename> <passportSeries>1212</passportSeries> <passportNumber>123456</passportNumber> <email>lol4e@gmail.com</email> <mobphone>9197262902</mobphone> </clientInfo> <specificationList> <specificationListRow> <category>CRT_TV</category> <code>#123</code> <description>Samsung</description> <amount>1</amount> <price>25000</price> <action>10/10/10</action> </specificationListRow> <specificationListRow> <category>MOBILE_PHONE</category> <code>#1222</code> <description>HTC</description> <amount>2</amount> <price>15000</price> <image>http://www.photo.ru/product.png</image> © 2001–2016 Альфа-Банк 8 </specificationListRow> </specificationList> </inParams> 
  • So what did you fail? How are you trying to solve this problem? - Nilsan
  • how to implement sending, how - Ivan Orlov
  • cURL php.net/curl - Nilsan
  • I do not understand what it is to implement it? - Ivan Orlov
  • At least throw an example - Ivan Orlov

1 answer 1

You should have documentation on this API bank. It has all the examples of how and what better to send, if you do not have it, request it from the bank or google it may be in the public domain.
Usually, for such a request, you need to register with the bank and get a closed unique access token and usually for such requests, banks write API to SOAP .
If it was not possible to get the documentation, you can try cURL PHP
Sample code for sending XML via POST :
$input_xml = '<inParams> <brokerInfo> <Id>1</Id> <logotype> http://www.logo.ru/logotype.png</logotype> </brokerInfo> <companyInfo> <inn>1111111111</inn> <referer>http://ulmart.ru/my_endpoint</referer> </companyInfo> <creditInfo> <reference>RFE003453PO</reference> <firstPayment>0</firstPayment> <creditPeriod>15</creditPeriod> <creditProductCode>ILEF</creditProductCode> <shopCode>AABB01_IS1</shopCode> </creditInfo> <clientInfo> <lastname>Арсентьев</lastname> <firstname>Антон</firstname> <middlename>Андреевич</middlename> <passportSeries>1212</passportSeries> <passportNumber>123456</passportNumber> <email>lol4e@gmail.com</email> <mobphone>9197262902</mobphone> </clientInfo> <specificationList> <specificationListRow> <category>CRT_TV</category> <code>#123</code> <description>Samsung</description> <amount>1</amount> <price>25000</price> <action>10/10/10</action> </specificationListRow> <specificationListRow> <category>MOBILE_PHONE</category> <code>#1222</code> <description>HTC</description> <amount>2</amount> <price>15000</price> <image>http://www.photo.ru/product.png</image> © 2001–2016 Альфа-Банк 8 </specificationListRow> </specificationList> </inParams>'; $url = "https://anketa.alfabank.ru/alfaform-pos/endpoint"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS,"xmlRequest=" . $input_xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300); $data = curl_exec($ch); curl_close($ch);