Skip to content

Commit

Permalink
Test mode. Closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Гонимар Сергей committed Nov 18, 2016
1 parent e1db525 commit cea1c73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Merchant.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class Merchant extends Object
public $sMerchantPass1;
public $sMerchantPass2;

public $isTest = false;

public $baseUrl = 'https://auth.robokassa.ru/Merchant/Index.aspx';

public function payment($nOutSum, $nInvId, $sInvDesc = null, $sIncCurrLabel=null, $sEmail = null, $sCulture = null, $shp = [], $returnLink = false)
Expand All @@ -33,6 +35,7 @@ public function payment($nOutSum, $nInvId, $sInvDesc = null, $sIncCurrLabel=null
'IncCurrLabel' => $sIncCurrLabel,
'Email' => $sEmail,
'Culture' => $sCulture,
'IsTest' => (int)$this->isTest,
]);

if (!empty($shp) && ($query = http_build_query($shp)) !== '') {
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ composer require yii-cms/yii2-robokassa
'components' => [
'robokassa' => [
'class' => '\robokassa\Merchant',
'baseUrl' => YII_ENV_PROD ? 'https://auth.robokassa.ru/Merchant/Index.aspx' : 'http://test.robokassa.ru/Index.aspx',
'baseUrl' => 'https://auth.robokassa.ru/Merchant/Index.aspx',
'sMerchantLogin' => '',
'sMerchantPass1' => '',
'sMerchantPass2' => '',
'isTest' => !YII_ENV_PROD,
]
...
]
Expand Down

0 comments on commit cea1c73

Please sign in to comment.