diff --git a/Controller/CallbackController.php b/Controller/CallbackController.php
index 3d6fdbc..fcd8d92 100644
--- a/Controller/CallbackController.php
+++ b/Controller/CallbackController.php
@@ -48,6 +48,15 @@ public function urlcAction(Request $request, PaymentInstruction $instruction)
$client = $this->get('payment.dotpay.client.token');
$logger = $this->get('logger');
+ $ppc = $this->get('payment.plugin_controller');
+
+ $logger->info(
+ '[Dotpay - URLC - {dotpayTransactionId}] Callback received: {request}',
+ [
+ 'paymentInstructionId' => $instruction->getId(),
+ 'request' => $request->request->all(),
+ ]
+ );
$transactionId = $request->request->get('t_id');
$transactionStatus = $request->request->get('t_status');
@@ -70,26 +79,40 @@ public function urlcAction(Request $request, PaymentInstruction $instruction)
if ($control !== $request->request->get('md5')) {
$logger->error(
- '[Dotpay - URLC] pin verification failed',
- array(
+ '[Dotpay - URLC - {dotpayTransactionId}] pin verification failed',
+ [
'paymentInstructionId' => $instruction->getId(),
'dotpayTransactionId' => $transactionId,
'dotpayTransactionStatus' => $transactionStatus,
- )
+ ]
);
- return new Response('FAIL', 500);
+ return new Response('FAIL SIGNATURE', 500);
}
if (null === $transaction = $instruction->getPendingTransaction()) {
// this could happen if the transaction is already validated via http redirection
+
+ if ($instruction->getAmount() < $instruction->getDepositedAmount()) {
+ $logger->info(
+ '[Dotpay - URLC - {dotpayTransactionId}] unable to create new transaction, all of amount has been deposited',
+ [
+ 'paymentInstructionId' => $instruction->getId(),
+ 'dotpayTransactionId' => $transactionId,
+ 'dotpayTransactionStatus' => $transactionStatus,
+ ]
+ );
+
+ return new Response('FAIL, TRANSACTION IS COMPLETED', 500);
+ }
+
$logger->info(
- '[Dotpay - URLC] no pending transaction found for the payment instruction',
- array(
+ '[Dotpay - URLC - {dotpayTransactionId}] no pending transaction found for the payment instruction',
+ [
'paymentInstructionId' => $instruction->getId(),
'dotpayTransactionId' => $transactionId,
'dotpayTransactionStatus' => $transactionStatus,
- )
+ ]
);
return new Response('FAIL', 500);
@@ -103,31 +126,31 @@ public function urlcAction(Request $request, PaymentInstruction $instruction)
$transaction->getExtendedData()->set('amount', $amount);
try {
- $this->get('payment.plugin_controller')->approveAndDeposit($transaction->getPayment()->getId(), $amount);
+ $ppc->approveAndDeposit($transaction->getPayment()->getId(), $amount);
} catch (\Exception $exception) {
$logger->error(
- '[Dotpay - URLC] error {exceptionClass} {exceptionMessage}',
- array(
+ '[Dotpay - URLC - {dotpayTransactionId}] error {exceptionClass} {exceptionMessage}',
+ [
'paymentInstructionId' => $instruction->getId(),
'dotpayTransactionId' => $transactionId,
'dotpayTransactionStatus' => $transactionStatus,
'exceptionClass' => get_class($exception),
- 'exceptionMessage' => $e->getMessage()
- )
+ 'exceptionMessage' => $exception->getMessage(),
+ ]
);
- return new Response('FAIL', 500);
+ return new Response('FAIL APPROVE AND DEPOSIT', 500);
}
$this->getDoctrine()->getManager()->flush();
$logger->info(
- '[Dotpay - URLC] Payment instruction {paymentInstructionId} successfully updated',
- array(
+ '[Dotpay - URLC - {dotpayTransactionId}] Payment instruction {paymentInstructionId} successfully updated',
+ [
'paymentInstructionId' => $instruction->getId(),
'dotpayTransactionId' => $transactionId,
- 'dotpayTransactionStatus' => $transactionStatus
- )
+ 'dotpayTransactionStatus' => $transactionStatus,
+ ]
);
return new Response('OK');
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index ee69114..7e5da95 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -52,18 +52,30 @@ public function getConfigTreeBuilder()
->defaultValue('https://ssl.dotpay.pl/')
->cannotBeEmpty()
->validate()
- ->ifNotInArray(array('https://ssl.dotpay.pl/', 'https://ssl.dotpay.eu/'))
+ ->ifNotInArray(['https://ssl.dotpay.pl/', 'https://ssl.dotpay.eu/'])
->thenInvalid('Invalid dotpay url "%s"')
->end()
->end()
->scalarNode('type')
->defaultValue(2)
->validate()
- ->ifNotInArray(array(0, 1, 2, 3))
+ ->ifNotInArray([0, 1, 2, 3])
->thenInvalid('Invalid type "%s"')
->end()
->end()
->scalarNode('return_url')->defaultNull()->end()
+ ->booleanNode('chk')
+ ->defaultFalse()
+ ->end()
+ ->booleanNode('recipientChk')
+ ->defaultFalse()
+ ->end()
+ ->booleanNode('onlineTransfer')
+ ->defaultFalse()
+ ->end()
+ ->integerNode('expirationTime')
+ ->defaultValue(0)
+ ->end()
->end()
->end()
->end()
diff --git a/DependencyInjection/ETSPaymentDotpayExtension.php b/DependencyInjection/ETSPaymentDotpayExtension.php
index 93f8825..59adc5c 100644
--- a/DependencyInjection/ETSPaymentDotpayExtension.php
+++ b/DependencyInjection/ETSPaymentDotpayExtension.php
@@ -49,5 +49,9 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('payment.dotpay.direct.url', $config['direct']['url']);
$container->setParameter('payment.dotpay.direct.type', $config['direct']['type']);
$container->setParameter('payment.dotpay.direct.return_url', $config['direct']['return_url']);
+ $container->setParameter('payment.dotpay.direct.chk', $config['direct']['chk']);
+ $container->setParameter('payment.dotpay.direct.recipientChk', $config['direct']['recipientChk']);
+ $container->setParameter('payment.dotpay.direct.onlineTransfer', $config['direct']['onlineTransfer']);
+ $container->setParameter('payment.dotpay.direct.expirationTime', $config['direct']['expirationTime']);
}
}
diff --git a/Plugin/DotpayDirectPlugin.php b/Plugin/DotpayDirectPlugin.php
index c8ce9d2..54a9f24 100644
--- a/Plugin/DotpayDirectPlugin.php
+++ b/Plugin/DotpayDirectPlugin.php
@@ -51,45 +51,45 @@ class DotpayDirectPlugin extends AbstractPlugin
const STATUS_REFUND = 4;
const STATUS_COMPLAINT = 5;
- public static $statuses = array(
+ public static $statuses = [
self::STATUS_CLOSED => 'Closed',
self::STATUS_NEW => 'New',
self::STATUS_DONE => 'Done',
self::STATUS_REJECTED => 'Rejected',
self::STATUS_REFUND => 'Refund',
self::STATUS_COMPLAINT => 'Complaint',
- );
+ ];
- /**
- * @var Router
- */
+ /** @var Router */
protected $router;
- /**
- * @var \ETS\Payment\DotpayBundle\Client\Token
- */
+ /** @var \ETS\Payment\DotpayBundle\Client\Token */
protected $token;
- /**
- * @var \ETS\Payment\DotpayBundle\Tools\StringNormalizer
- */
+ /** @var \ETS\Payment\DotpayBundle\Tools\StringNormalizer */
protected $stringTools;
- /**
- * @var string
- */
+ /** @var string */
protected $url;
- /**
- * @var string
- */
+ /** @var string */
protected $returnUrl;
- /**
- * @var integer
- */
+ /** @var integer */
protected $type;
+ /** @var bool */
+ protected $chk;
+
+ /** @var bool */
+ protected $recipientChk;
+
+ /** @var bool */
+ protected $onlineTransfer;
+
+ /** @var bool */
+ protected $expirationTime;
+
/**
* @param Router $router The router
* @param Token $token The client token
@@ -97,15 +97,33 @@ class DotpayDirectPlugin extends AbstractPlugin
* @param string $url The urlc
* @param int $type The type
* @param string $returnUrl The return url
+ * @param bool $chk Using DotPay CHK parameter, by default false
+ * @param bool $recipientChk
+ * @param bool $onlineTransfer
+ * @param int $expirationTime
*/
- public function __construct(Router $router, Token $token, StringNormalizer $stringTools, $url, $type, $returnUrl)
- {
+ public function __construct(
+ Router $router,
+ Token $token,
+ StringNormalizer $stringTools,
+ $url,
+ $type,
+ $returnUrl,
+ $chk = false,
+ $recipientChk = false,
+ $onlineTransfer = false,
+ $expirationTime = 0
+ ) {
$this->router = $router;
$this->token = $token;
$this->stringTools = $stringTools;
$this->returnUrl = $returnUrl;
$this->url = $url;
$this->type = $type;
+ $this->chk = $chk;
+ $this->recipientChk = $recipientChk;
+ $this->onlineTransfer = $onlineTransfer;
+ $this->expirationTime = $expirationTime;
}
/**
@@ -143,41 +161,145 @@ public function createDotpayRedirectActionException(FinancialTransactionInterfac
$instruction = $transaction->getPayment()->getPaymentInstruction();
$extendedData = $transaction->getExtendedData();
- $urlc = $this->router->generate('ets_payment_dotpay_callback_urlc', array(
- 'id' => $instruction->getId()
- ), true);
+ $urlc = $this->router->generate(
+ 'ets_payment_dotpay_callback_urlc',
+ ['id' => $instruction->getId()],
+ true
+ );
- $datas = array(
+ $data = [
'id' => $this->token->getId(),
- 'url' => $this->getReturnUrl($extendedData),
+ 'URL' => $this->getReturnUrl($extendedData),
'URLC' => $urlc,
'type' => $this->type,
+ 'onlinetransfer' => $this->onlineTransfer ? 1 : 0,
+ 'amount' => $transaction->getRequestedAmount(),
+ 'currency' => $instruction->getCurrency(),
+ 'description' => sprintf('Payment Instruction #%d', $instruction->getId()),
+ 'data_waznosci' => $this->expirationTime > 0 ? date('Y-m-d H:i:s', time() + $this->expirationTime * 60) : null,
+ 'data_zapadalnosci' => null,
+ ];
+
+ $additionalData = [
+ 'street', 'phone', 'postcode', 'lastname', 'firstname',
+ 'email', 'country', 'city', 'grupykanalow', 'street_n1', 'street_n2', 'description',
+ ];
+
+ if ($this->recipientChk) {
+ $additionalData = array_merge($additionalData, [
+ 'recipientAccountNumber', 'recipientCompany', 'recipientFirstName', 'recipientLastName', 'recipientAddressStreet',
+ 'recipientAddressBuilding', 'recipientAddressApartment', 'recipientAddressPostcode', 'recipientAddressCity',
+ ]);
+ }
- 'amount' => $transaction->getRequestedAmount(),
- 'currency' => $instruction->getCurrency(),
- 'description' => sprintf('Payment Instruction #%d', $instruction->getId()),
- );
-
- $additionalDatas = array(
- 'street', 'phone', 'postcode', 'lastname',
- 'firstname', 'email', 'country', 'city', 'grupykanalow',
- );
-
- foreach ($additionalDatas as $value) {
+ foreach ($additionalData as $value) {
if ($extendedData->has($value)) {
- $datas[$value] = $this->stringTools->normalize($extendedData->get($value));
+ $data[$value] = $this->stringTools->normalize($extendedData->get($value));
}
}
if ($extendedData->has('lang')) {
- $datas['lang'] = substr($extendedData->get('lang'), 0, 2);
+ $data['lang'] = substr($extendedData->get('lang'), 0, 2);
+ }
+
+ if ($this->recipientChk) {
+ $data['recipientChk'] = $this->generateRecipientChk($data, $this->token->getPin());
+ }
+
+ if ($this->chk) {
+ $data['chk'] = $this->generateChk($data, $this->token->getPin());
}
- $actionRequest->setAction(new VisitUrl($this->url . '?' . http_build_query($datas)));
+ $actionRequest->setAction(new VisitUrl($this->url . '?' . http_build_query($data)));
return $actionRequest;
}
+ /**
+ * This method generates chk parameter user to sign request to dotpay
+ *
+ * @param array $data
+ * @param string $pin
+ *
+ * @return string
+ */
+ protected function generateChk(array $data, $pin)
+ {
+ $key = $data['id'];
+ $key .= number_format($data['amount'], 2, '.', '');
+ $key .= $data['currency'];
+ $key .= rawurlencode($data['description']);
+
+ if (isset($data['control'])) {
+ $key .= $data['control'];
+ }
+
+ $key .= $pin;
+
+ if (isset($data['channel'])) {
+ $key .= $data['channel'];
+
+ if (isset($data['chlock'])) {
+ $key .= $data['chlock'];
+ }
+ }
+
+ if (isset($data['data_waznosci'])) {
+ if (isset($data['data_zapadalnosci'])) {
+ $key .= $data['data_zapadalnosci'];
+ }
+
+ $key .= $data['data_waznosci'];
+ }
+
+ if (isset($data['recipientChk'])) {
+ $key .= $data['recipientChk'];
+ }
+
+ return md5($key);
+ }
+
+ /**
+ * This method generates recipientChk parameter user to sign request with recipient data to dotpay
+ *
+ * @param array $data
+ * @param string $pin
+ *
+ * @return string
+ */
+ protected function generateRecipientChk(array $data, $pin)
+ {
+ $key = $data['id'];
+ $key .= number_format($data['amount'], 2, '.', '');
+ $key .= $data['currency'];
+
+ if (isset($data['control'])) {
+ $key .= $data['control'];
+ }
+
+ $recipientFields = [
+ 'recipientAccountNumber',
+ 'recipientCompany',
+ 'recipientFirstName',
+ 'recipientLastName',
+ 'recipientAddressStreet',
+ 'recipientAddressBuilding',
+ 'recipientAddressApartment',
+ 'recipientAddressPostcode',
+ 'recipientAddressCity',
+ ];
+
+ foreach ($recipientFields as $f) {
+ if (isset($data[$f])) {
+ $key .= $data[$f];
+ }
+ }
+
+ $key .= $pin;
+
+ return hash('sha256', $key);
+ }
+
/**
* This method executes an approve transaction.
*
diff --git a/README.md b/README.md
index dfd746a..5b1f5e5 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ ETSPaymentDotpayBundle [
Usage:
diff --git a/Resources/config/services.xml b/Resources/config/services.xml
index 7f2b282..d1945d2 100644
--- a/Resources/config/services.xml
+++ b/Resources/config/services.xml
@@ -26,6 +26,10 @@
%payment.dotpay.direct.url%
%payment.dotpay.direct.type%
%payment.dotpay.direct.return_url%
+ %payment.dotpay.direct.chk%
+ %payment.dotpay.direct.recipientChk%
+ %payment.dotpay.direct.onlineTransfer%
+ %payment.dotpay.direct.expirationTime%
diff --git a/Resources/doc/install.rst b/Resources/doc/install.rst
index 755c388..02e5a05 100644
--- a/Resources/doc/install.rst
+++ b/Resources/doc/install.rst
@@ -36,3 +36,5 @@ Routing
//YAML routing.yml
ets_payment_dotpay_bundle:
resource: "@ETSPaymentDotpayBundle/Resources/config/routing.yml"
+
+.. _JMSPaymentCoreBundle: https://github.com/schmittjoh/JMSPaymentCoreBundle/blob/master/Resources/doc/index.rst
diff --git a/Resources/doc/usage.rst b/Resources/doc/usage.rst
index 0a228c7..3e3e842 100644
--- a/Resources/doc/usage.rst
+++ b/Resources/doc/usage.rst
@@ -15,12 +15,12 @@ You can configure some custom fields :
{
...
- $form = $this->getFormFactory()->create('jms_choose_payment_method', null, array(
+ $form = $this->getFormFactory()->create('jms_choose_payment_method', null, [
'amount' => $order->getAmount(),
'currency' => 'EUR',
'default_method' => 'dotpay_direct', // Optional
- 'predefined_data' => array(
- 'dotpay_direct' => array(
+ 'predefined_data' => [
+ 'dotpay_direct' => [
'street' => 'Customer\'s address street line', // Optional
'phone' => 'Customer phone number', // Optional
'postcode' => 'Customer address postal code', // Optional
@@ -33,9 +33,9 @@ You can configure some custom fields :
'return_url' => $this->router->generate('payment_complete', array(
'orderNumber' => $order->getOrderNumber(),
), true),
- ),
- ),
- ));
+ ],
+ ],
+ ]);
...
}
@@ -49,4 +49,4 @@ an easy way to communicate with the Dotpay API, then you can use the plugin dire
$plugin = $container->get('payment.plugin.dotpay');
-.. _JMSPaymentCoreBundle: https://github.com/schmittjoh/JMSPaymentCoreBundle/blob/master/Resources/doc/index.rst
+
diff --git a/Tests/Plugin/DotpayDirectPluginTest.php b/Tests/Plugin/DotpayDirectPluginTest.php
index ea0d5f7..d2702a8 100644
--- a/Tests/Plugin/DotpayDirectPluginTest.php
+++ b/Tests/Plugin/DotpayDirectPluginTest.php
@@ -32,6 +32,9 @@
*/
class DotpayDirectPluginTest extends TestCase
{
+ /** @var DotpayDirectPlugin */
+ private $dotpayDirectPlugin;
+
public function setUp()
{
$this->router = $this->prophesize('Symfony\Component\Routing\Router');
@@ -268,4 +271,387 @@ public function testDepositExceptionBadStatus()
$this->dotpayDirectPlugin->deposit($financialTransaction->reveal(), false);
}
+
+ /**
+ * @param array $data
+ * @param $pin
+ * @param $expected
+ *
+ * @dataProvider provideDataForGenerateChk
+ */
+ public function testGenerateChk(array $data, $pin, $expected)
+ {
+ $chk = $this->invokeMethod($this->dotpayDirectPlugin, 'generateChk', [$data, $pin]);
+
+ $this->assertEquals($expected, $chk);
+ }
+
+ public function provideDataForGenerateChk()
+ {
+ return [
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'control' => 'my_fake_control',
+ 'channel' => 'my_fake_chanel',
+ 'chlock' => 'my_fake_chlock',
+ 'data_waznosci' => 'my_fake_data_waznosci',
+ 'data_zapadalnosci' => 'my_fake_data_zapadalnosci',
+ 'recipientChk' => 'my_fake_recipientChk',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_controlmy_fake_pinmy_fake_chanelmy_fake_chlockmy_fake_data_zapadalnoscimy_fake_data_waznoscimy_fake_recipientChk'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'control' => 'my_fake_control',
+ 'channel' => 'my_fake_chanel',
+ 'chlock' => 'my_fake_chlock',
+ 'data_waznosci' => 'my_fake_data_waznosci',
+ 'data_zapadalnosci' => 'my_fake_data_zapadalnosci',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_controlmy_fake_pinmy_fake_chanelmy_fake_chlockmy_fake_data_zapadalnoscimy_fake_data_waznosci'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'control' => 'my_fake_control',
+ 'channel' => 'my_fake_chanel',
+ 'chlock' => 'my_fake_chlock',
+ 'data_zapadalnosci' => 'my_fake_data_zapadalnosci',
+ 'recipientChk' => 'my_fake_recipientChk',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_controlmy_fake_pinmy_fake_chanelmy_fake_chlockmy_fake_recipientChk'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'control' => 'my_fake_control',
+ 'channel' => 'my_fake_chanel',
+ 'chlock' => 'my_fake_chlock',
+ 'data_waznosci' => 'my_fake_data_waznosci',
+ 'recipientChk' => 'my_fake_recipientChk',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_controlmy_fake_pinmy_fake_chanelmy_fake_chlockmy_fake_data_waznoscimy_fake_recipientChk'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'control' => 'my_fake_control',
+ 'chlock' => 'my_fake_chlock',
+ 'data_waznosci' => 'my_fake_data_waznosci',
+ 'data_zapadalnosci' => 'my_fake_data_zapadalnosci',
+ 'recipientChk' => 'my_fake_recipientChk',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_controlmy_fake_pinmy_fake_data_zapadalnoscimy_fake_data_waznoscimy_fake_recipientChk'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'control' => 'my_fake_control',
+ 'channel' => 'my_fake_chanel',
+ 'data_waznosci' => 'my_fake_data_waznosci',
+ 'data_zapadalnosci' => 'my_fake_data_zapadalnosci',
+ 'recipientChk' => 'my_fake_recipientChk',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_controlmy_fake_pinmy_fake_chanelmy_fake_data_zapadalnoscimy_fake_data_waznoscimy_fake_recipientChk'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ 'channel' => 'my_fake_chanel',
+ 'chlock' => 'my_fake_chlock',
+ 'data_waznosci' => 'my_fake_data_waznosci',
+ 'data_zapadalnosci' => 'my_fake_data_zapadalnosci',
+ 'recipientChk' => 'my_fake_recipientChk',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_pinmy_fake_chanelmy_fake_chlockmy_fake_data_zapadalnoscimy_fake_data_waznoscimy_fake_recipientChk'),
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.11111,
+ 'currency' => 'EUR',
+ 'description' => 'my_fake_description',
+ ],
+ 'my_fake_pin',
+ md5('my_fake_id11.11EURmy_fake_descriptionmy_fake_pin'),
+ ],
+ ];
+ }
+
+ /**
+ * @param array $data
+ * @param $pin
+ * @param $expected
+ *
+ * @dataProvider provideDataForGenerateRecipientChk
+ */
+ public function testGenerateRecipientChk(array $data, $pin, $expected)
+ {
+ $recipientChk = $this->invokeMethod($this->dotpayDirectPlugin, 'generateRecipientChk', [$data, $pin]);
+
+ $this->assertEquals($expected, $recipientChk);
+ }
+
+ public function provideDataForGenerateRecipientChk()
+ {
+ return [
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientAccountNumbermy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'control' => 'my_fake_control',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_controlmy_fake_pin')
+ ],
+ [
+ [
+ 'id' => 'my_fake_id',
+ 'amount' => 11.1111,
+ 'currency' => 'EUR',
+ 'recipientAccountNumber' => 'my_fake_recipientAccountNumber',
+ 'recipientCompany' => 'my_fake_recipientCompany',
+ 'recipientFirstName' => 'my_fake_recipientFirstName',
+ 'recipientLastName' => 'my_fake_recipientLastName',
+ 'recipientAddressStreet' => 'my_fake_recipientAddressStreet',
+ 'recipientAddressBuilding' => 'my_fake_recipientAddressBuilding',
+ 'recipientAddressApartment' => 'my_fake_recipientAddressApartment',
+ 'recipientAddressPostcode' => 'my_fake_recipientAddressPostcode',
+ 'recipientAddressCity' => 'my_fake_recipientAddressCity',
+ ],
+ 'my_fake_pin',
+ hash('sha256', 'my_fake_id11.11EURmy_fake_recipientAccountNumbermy_fake_recipientCompanymy_fake_recipientFirstNamemy_fake_recipientLastNamemy_fake_recipientAddressStreetmy_fake_recipientAddressBuildingmy_fake_recipientAddressApartmentmy_fake_recipientAddressPostcodemy_fake_recipientAddressCitymy_fake_pin')
+ ],
+ ];
+ }
+
+ /**
+ * Call protected/private method of a class.
+ *
+ * @param object &$object Instantiated object that we will run method on.
+ * @param string $methodName Method name to call
+ * @param array $parameters Array of parameters to pass into method.
+ *
+ * @return mixed Method return.
+ */
+ private function invokeMethod(&$object, $methodName, array $parameters = array())
+ {
+ $reflection = new \ReflectionClass(get_class($object));
+ $method = $reflection->getMethod($methodName);
+ $method->setAccessible(true);
+
+ return $method->invokeArgs($object, $parameters);
+ }
}