Skip to content

Commit

Permalink
Merge pull request #24 from PowerSync/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
eermolaev authored May 22, 2019
2 parents 818e244 + 4037e15 commit 4a4cb77
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
command: |
cd /var/www/html/
git clone https://github.com/magento/marketplace-eqp magento-coding-standard
cd magento-coding-standard
cd magento-coding-standard && git checkout -q "2.0.1"
composer install
- run:
name: Wait for DB
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
command: |
cd /var/www/html/
git clone https://github.com/magento/marketplace-eqp magento-coding-standard
cd magento-coding-standard
cd magento-coding-standard && git checkout -q "2.0.1"
composer install
- run:
name: Wait for DB
Expand Down
24 changes: 24 additions & 0 deletions Gateway/Validator/TransactionResponseValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use net\authorize\api\contract\v1\CreateTransactionResponse;
use net\authorize\api\contract\v1\TransactionResponseType\MessagesAType\MessageAType;
use net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType;

/**
* Validate response data
Expand All @@ -28,6 +29,11 @@ function (CreateTransactionResponse $response) {
$messages = $transactionResponse->getMessages();
$errorMessages = array_map([$this, 'map'], array_filter($messages, [$this, 'filter']));

if (!$errorMessages) {
$messages = $transactionResponse->getErrors();
$errorMessages = array_map([$this, 'errorMap'], array_filter($messages, [$this, 'errorFilter']));
}

return [
!count($errorMessages),
$errorMessages
Expand All @@ -53,4 +59,22 @@ private function map(MessageAType $message)
{
return __($message->getDescription());
}

/**
* @param MessageAType $message
* @return bool
*/
private function errorFilter(ErrorAType $message)
{
return $message->getErrorCode() != 1;
}

/**
* @param MessageAType $message
* @return string
*/
private function errorMap(ErrorAType $message)
{
return __($message->getErrorText());
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tnw/module-authorizenetcim",
"description": "Authorize.net CIM for Magento 2",
"type": "magento2-module",
"version": "2.1.7",
"version": "2.1.9",
"license": [
"proprietary"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<sdk_url_test_mode><![CDATA[https://jstest.authorize.net/v1/Accept.js]]></sdk_url_test_mode>
<sdk_url><![CDATA[https://js.authorize.net/v1/Accept.js]]></sdk_url>
<verify_sdk_url><![CDATA[https://includestest.ccdc02.com/cardinalcruise/v1/songbird.js]]></verify_sdk_url>
<cctypes_mapper><![CDATA[{"american-express":"AE","discover":"DI","jcb":"JCB","mastercard":"MC","master-card":"MC","visa":"VI","maestro":"MI","diners-club":"DN","unionpay":"CUP"}]]></cctypes_mapper>
<cctypes_mapper><![CDATA[{"americanexpress":"AE","american-express":"AE","discover":"DI","jcb":"JCB","mastercard":"MC","master-card":"MC","visa":"VI","maestro":"MI","dinersclub":"DN","diners-club":"DN","unionpay":"CUP"}]]></cctypes_mapper>
</tnw_authorize_cim>
<tnw_authorize_cim_vault>
<model>AuthorizeCimVaultFacade</model>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="TNW_AuthorizeCim" setup_version="2.1.7">
<module name="TNW_AuthorizeCim" setup_version="2.1.9">
<sequence>
<module name="Magento_Customer"/>
<module name="Magento_Sales"/>
Expand Down

0 comments on commit 4a4cb77

Please sign in to comment.