File tree Expand file tree Collapse file tree 5 files changed +67
-8
lines changed Expand file tree Collapse file tree 5 files changed +67
-8
lines changed Original file line number Diff line number Diff line change 99 */
1010class CIMGateway extends AIMGateway
1111{
12+ public function getDefaultParameters ()
13+ {
14+ return array (
15+ 'apiLoginId ' => '' ,
16+ 'transactionKey ' => '' ,
17+ 'testMode ' => false ,
18+ 'developerMode ' => false ,
19+ 'forceCardUpdate ' => false ,
20+ 'defaultBillTo ' => [[]]
21+ );
22+ }
23+
1224 public function getName ()
1325 {
1426 return 'Authorize.Net CIM ' ;
1527 }
1628
29+ public function setForceCardUpdate ($ forceCardUpdate )
30+ {
31+ return $ this ->setParameter ('forceCardUpdate ' , $ forceCardUpdate );
32+ }
33+
34+ public function getForceCardUpdate ()
35+ {
36+ return $ this ->getParameter ('forceCardUpdate ' );
37+ }
38+
39+ public function setDefaultBillTo ($ defaultBillTo )
40+ {
41+ return $ this ->setParameter ('defaultBillTo ' , $ defaultBillTo );
42+ }
43+
44+ public function getDefaultBillTo ()
45+ {
46+ return $ this ->getParameter ('defaultBillTo ' );
47+ }
48+
1749 /**
1850 * Create a new debit or credit card
1951 *
@@ -45,4 +77,9 @@ public function refund(array $parameters = array())
4577 {
4678 return $ this ->createRequest ('\Omnipay\AuthorizeNet\Message\CIMRefundRequest ' , $ parameters );
4779 }
80+
81+ public function void (array $ parameters = array ())
82+ {
83+ return $ this ->createRequest ('\Omnipay\AuthorizeNet\Message\CIMVoidRequest ' , $ parameters );
84+ }
4885}
Original file line number Diff line number Diff line change @@ -67,14 +67,14 @@ public function getForceCardUpdate()
6767 return $ this ->getParameter ('forceCardUpdate ' );
6868 }
6969
70- public function setPopulateBillTo ( $ populateBillTo )
70+ public function setDefaultBillTo ( $ defaultBillTo )
7171 {
72- return $ this ->setParameter ('populateBillTo ' , $ populateBillTo );
72+ return $ this ->setParameter ('defaultBillTo ' , $ defaultBillTo );
7373 }
7474
75- public function getPopulateBillTo ()
75+ public function getDefaultBillTo ()
7676 {
77- return $ this ->getParameter ('populateBillTo ' );
77+ return $ this ->getParameter ('defaultBillTo ' );
7878 }
7979
8080 /**
Original file line number Diff line number Diff line change @@ -88,10 +88,10 @@ protected function addBillingData(\SimpleXMLElement $data)
8888 $ req ->zip = $ card ->getBillingPostcode ();
8989 $ req ->country = $ card ->getBillingCountry ();
9090
91- $ populateBillTo = $ this ->getParameter ('populateBillTo ' );
92- if (is_array ($ populateBillTo )) {
91+ $ defaultBillTo = $ this ->getParameter ('defaultBillTo ' );
92+ if (is_array ($ defaultBillTo )) {
9393 // A configuration parameter to populate billTo has been specified
94- foreach ($ populateBillTo as $ field => $ value ) {
94+ foreach ($ defaultBillTo as $ field => $ value ) {
9595 if (empty ($ req ->{$ field }) && !empty ($ value )) {
9696 // This particular field is empty and default value in populateBillTo has been specified
9797 // so use it
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Omnipay \AuthorizeNet \Message ;
4+
5+ /**
6+ * Authorize.Net CIM Void Request
7+ */
8+ class CIMVoidRequest extends CIMAbstractRequest
9+ {
10+ protected $ action = 'voidTransaction ' ;
11+
12+ public function getData ()
13+ {
14+ $ this ->validate ('transactionReference ' );
15+
16+ $ data = $ this ->getBaseData ();
17+ $ data ->transactionRequest ->refTransId = $ this ->getTransactionReference ();
18+ $ this ->addTestModeSetting ($ data );
19+
20+ return $ data ;
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function testGetDataShouldHaveCustomBillTo()
4242 'card ' => $ card ,
4343 'developerMode ' => true ,
4444 'forceCardUpdate ' => true ,
45- 'populateBillTo ' => [
45+ 'defaultBillTo ' => [
4646 'address ' => '1234 Test Street ' ,
4747 'city ' => 'Blacksburg '
4848 ]
You can’t perform that action at this time.
0 commit comments