ロボカッサについてはっきりと

昨夜、CMSでロボカッサとやり取りするためのインターフェイスを追加しました。

支払いシステムについて簡単に


ロボカッサは、決済システムのインテグレーターです。 多くの有名な電子通貨(Webmoney、VKontakte、YandexMoney、Money Mail.Ru、RBK Moneyなど)、支払い端末EleksNet、そして最も重要なのはSMSを介して、店舗に有利な支払いの受け入れを整理できます。

2つの接続オプションが利用可能です-法人および個人起業家、システムから当座預金口座へのお金の引き出し、および電子通貨への引き出しオプションを持つ個人向け。

登録


登録は非常に簡単です。 https://www.roboxchange.com/Environment/Partners/Login/Login.aspx?reg=Merchantにアクセスし、必要なすべてのフィールドに慎重に入力します。 登録が完了したら、しばらく(約5分)待ってからログインします。

最初は、アカウントのステータスは「非アクティブ」になります。これにより、リアルモードで有効にする前にストアを設定およびテストできます。

実際のコード-支払いの送信


キャッシュデスクは、GETまたはPOSTリクエストを介してストアからパラメーターを受け取ります。 支払いページで次のようなものを作成する必要があります(これが最小オプションです)。
< form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  1. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  2. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  3. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  4. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  5. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  6. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  7. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  8. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
  9. < form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .
< form method ="post" action ="http://test.robokassa.ru/Index.aspx" > <!-- action "https://merchant.roboxchange.com/Index.aspx" --> < input type ="hidden" name ="MrchLogin" value ="-- --" /> < input type ="hidden" name ="OutSum" value ="-- , - --" /> < input type ="hidden" name ="InvId" value ="-- -- " /> < input type ="hidden" name ="Desc" value ="-- , : -- " /> < input type ="hidden" name ="SignatureValue" value ="{SIGNATURE}" /> < input type ="submit" value ="" /> </ form > * This source code was highlighted with Source Code Highlighter .


{SIGNATURE}と指定したフォームにフィールドがあります。 これは、ストアの特別に形成された署名です。後で戻ります。

支払い試行に対するロボカッサの応答を処理するには、https://www.roboxchange.com/Environment/Partners/Login/Merchant/Administration.aspxのシステムの個人アカウントでこの回答を処理する3つのページにデータを入力する必要があります


そして、アドレスごとにパラメータ転送方法-GETまたはPOSTを選択します。 私は個人的にPOSTを選択しました。

さらに、#1と#2の2つのパスワードを入力する必要があります。 署名の作成に必要になります。 1つはロボカッサにデータを送信するためのもので、2つ目はロボカッサからのデータをチェックするためのものです。

フォームの{SIGNATURE}フィールドに戻ります。 次のように計算されます。
$login = " " ;
$amount = floatval(__); // floatval , "99.00" "99"
$id = ____;
$pwd1 = "__#1" ;
$signature = md5($login . ":" . $amount . ":" . $id . ":" . $pwd1);


* This source code was highlighted with Source Code Highlighter .


支払い要求フォームをコンパイルするたびに、この署名を計算し、フォームで送信する必要があります。

実際にコード-支払い処理


結果URLで、Robocassa応答ハンドラーを配置する必要があります。
コードをすぐに提供します。
$id = intval($_POST[ 'InvId' ]); //
$pwd2 = "__#2" ;
$sum = ________;

/*
.
- "ERR"
*/

if ( $sum != floatval($_POST[ 'OutSum' ]) ) {
//
echo "ERR: invalid amount" ;
exit();
}

if ( strtolower($_POST[ 'SignatureValue' ]) != strtolower(md5($_POST[ 'OutSum' ] . ":" . $id . ":" . $pwd2)) ) {
//
echo "ERR: invalid signature" ;
exit();
}

// :
// , ,
//
echo "OK" . $id;
exit();


* This source code was highlighted with Source Code Highlighter .


アクティベーション


ストアをテストします。 テスト支払いを行うと、特別な形式のインターフェース確認が表示されます。 そこで、結果URLの応答を確認し、Robocasserに送信された内容を確認し、成功URLと失敗URLの動作を確認できます。

テストが正常に完了したら、 アカウントのアクティベーションを申請します 。 肯定的な応答の後、支払いフォームのアクションを変更することを忘れないでください。

頑張って

PS Robokassaインターフェースの詳細な説明は、 http ://www.robokassa.ru/Doc/Ru/Interface.aspxにあります

Source: https://habr.com/ru/post/J82998/


All Articles