Skip to content

Commit

Permalink
1.1.0: #17
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Nov 19, 2019
1 parent 544018f commit 049fcbf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
namespace RWCandy\Core\Plugin\Pmclain\AuthorizenetCim\Model\Adapter;
use Pmclain\Authnet\CustomerProfile as CP;
use Pmclain\Authnet\TransactionRequest as TR;
use Pmclain\Authnet\TransactionRequest\Order as TRO;
use Pmclain\AuthorizenetCim\Gateway\Request\CustomerDataBuilder as CDB;
use Pmclain\AuthorizenetCim\Gateway\Request\PaymentDataBuilder as PDB;
use Pmclain\AuthorizenetCim\Model\Adapter\AuthorizenetAdapter as Sb;
// 2019-11-19
final class AuthorizenetAdapter {
/**
* 2019-11-19
* 1) «Undefined offset: 0 in /vendor/pmclain/magento2-autherizenetcim/Model/Adapter/AuthorizenetAdapter on line 160»:
* https://github.com/royalwholesalecandy/core/issues/17
* 2) https://developer.authorize.net/api/reference/features/customer_profiles.html#Duplicate_Profile_Verification
* 3) https://community.developer.authorize.net/t5/Integration-and-Testing/E00039-A-duplicate-record-already-exists/m-p/60748/highlight/true#M35260
* 4) https://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-profile
* @see \Pmclain\AuthorizenetCim\Model\Adapter\AuthorizenetAdapter::saleForNewProfile()
* @used-by \Pmclain\AuthorizenetCim\Gateway\Http\Client\TransactionSale::process()
* @param Sb $sb
* @param array(string => mixed) $d
*/
function beforeSaleForNewProfile(Sb $sb, array $d) {
$cp = $d[CDB::CUSTOMER_PROFILE]; /** @var CP $cp */
$tr = $d[PDB::TRANSACTION_REQUEST]; /** @var TR $tr */
$cp->setDescription($tr->toArray()[TR::FIELD_ORDER][TRO::FIELD_INVOICE_NUMBER]);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "royalwholesalecandy/core"
,"version": "1.0.1"
,"version": "1.1.0"
,"description": "A custom module for royalwholesalecandy.com (Magento 2)"
,"type": "magento2-module"
,"homepage": "https://github.com/royalwholesalecandy/core"
Expand Down
15 changes: 15 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version='1.0'?>
<config
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='urn:magento:framework:ObjectManager/etc/config.xsd'
>
<!-- 2019-11-19
«Undefined offset: 0 in /vendor/pmclain/magento2-autherizenetcim/Model/Adapter/AuthorizenetAdapter on line 160»:
https://github.com/royalwholesalecandy/core/issues/17 -->
<type name='Pmclain\AuthorizenetCim\Model\Adapter\AuthorizenetAdapter'>
<plugin
name='RWCandy\Core\Plugin\Pmclain\AuthorizenetCim\Model\Adapter\AuthorizenetAdapter'
type='RWCandy\Core\Plugin\Pmclain\AuthorizenetCim\Model\Adapter\AuthorizenetAdapter'
/>
</type>
</config>

0 comments on commit 049fcbf

Please sign in to comment.