Skip to content

Commit

Permalink
0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Apr 10, 2017
1 parent fe90cba commit 634b2fa
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 2 deletions.
41 changes: 41 additions & 0 deletions Signer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
namespace Dfe\IPay88;
/**
* 2017-04-10
* @see \Dfe\IPay88\Signer\Request
* @see \Dfe\IPay88\Signer\Response
* @method Settings s()
*/
abstract class Signer extends \Df\PaypalClone\Signer {
/**
* 2017-04-10
* @used-by sign()
* @see \Dfe\IPay88\Signer\Request::values()
* @see \Dfe\IPay88\Signer\Response::values()
* @return string[]
*/
abstract protected function values();

/**
* 2017-04-10
* @override
* @see \Df\PaypalClone\Signer::adjust()
* @used-by \Df\PaypalClone\Signer::_sign()
* @see \Dfe\IPay88\Signer::adjust()
* @param array(string => mixed) $v
* @return array(string => mixed)
*/
final protected function adjust(array $v) {return
['Amount' => df_string_clean($v['Amount'], '.', ',')] + $v
;}

/**
* 2017-04-10
* @override
* @see \Df\PaypalClone\Signer::sign()
* @return string
*/
final protected function sign() {return sha1(df_cc('',
$this->s()->privateKey(), $this->v('MerchantCode'), $this->values()
));}
}
13 changes: 13 additions & 0 deletions Signer/Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace Dfe\IPay88\Signer;
// 2017-04-10
final class Request extends \Dfe\IPay88\Signer {
/**
* 2017-04-10
* @override
* @see \Dfe\IPay88\Signer::values()
* @used-by \Dfe\IPay88\Signer::sign()
* @return string[]
*/
protected function values() {return dfa_select_ordered($this->v(), ['RefNo', 'Amount', 'Currency']);}
}
15 changes: 15 additions & 0 deletions Signer/Response.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace Dfe\IPay88\Signer;
// 2017-04-10
final class Response extends \Dfe\IPay88\Signer {
/**
* 2017-04-10
* @override
* @see \Dfe\IPay88\Signer::values()
* @used-by \Dfe\IPay88\Signer::sign()
* @return string[]
*/
protected function values() {return dfa_select_ordered($this->v(), [
'PaymentId', 'RefNo', 'Amount', 'Currency', 'Status'
]);}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/ipay88"
,"version": "0.0.4"
,"version": "0.0.5"
,"description": "The «iPay88» payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/ipay88"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.4.40"}
,"require": {"mage2pro/core": ">=2.4.41"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\IPay88\\": ""}}
,"keywords": [
"API"
Expand Down

0 comments on commit 634b2fa

Please sign in to comment.