Skip to content

Commit eba3774

Browse files
Use my authorize.net repo as I have changes
1 parent cb26109 commit eba3774

23 files changed

+581
-116
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"civicrm/omnipay-paypalstandard": "dev-master",
3737
"pointybeard/omnipay-nabtransact": "dev-transact",
3838
"fzaninotto/faker": "^1.6@dev",
39-
"omnipay/paymentexpress": "dev-master"
39+
"omnipay/paymentexpress": "dev-master",
40+
"omnipay/authorizenet": "dev-master"
4041
},
4142
"require-dev":
4243
{

composer.lock

Lines changed: 8 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.json

Lines changed: 54 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,67 +1973,6 @@
19731973
"payment"
19741974
]
19751975
},
1976-
{
1977-
"name": "omnipay/authorizenet",
1978-
"version": "2.4.2",
1979-
"version_normalized": "2.4.2.0",
1980-
"source": {
1981-
"type": "git",
1982-
"url": "https://github.com/thephpleague/omnipay-authorizenet.git",
1983-
"reference": "6e1990f5d22f0f8e4dfe363b89c9776d0d803c34"
1984-
},
1985-
"dist": {
1986-
"type": "zip",
1987-
"url": "https://api.github.com/repos/thephpleague/omnipay-authorizenet/zipball/6e1990f5d22f0f8e4dfe363b89c9776d0d803c34",
1988-
"reference": "6e1990f5d22f0f8e4dfe363b89c9776d0d803c34",
1989-
"shasum": ""
1990-
},
1991-
"require": {
1992-
"omnipay/common": "~2.2"
1993-
},
1994-
"require-dev": {
1995-
"omnipay/tests": "~2.0"
1996-
},
1997-
"time": "2016-07-16 21:00:00",
1998-
"type": "library",
1999-
"extra": {
2000-
"branch-alias": {
2001-
"dev-master": "2.0.x-dev"
2002-
}
2003-
},
2004-
"installation-source": "dist",
2005-
"autoload": {
2006-
"psr-4": {
2007-
"Omnipay\\AuthorizeNet\\": "src/"
2008-
}
2009-
},
2010-
"notification-url": "https://packagist.org/downloads/",
2011-
"license": [
2012-
"MIT"
2013-
],
2014-
"authors": [
2015-
{
2016-
"name": "Adrian Macneil",
2017-
"email": "[email protected]"
2018-
},
2019-
{
2020-
"name": "Omnipay Contributors",
2021-
"homepage": "https://github.com/thephpleague/omnipay-authorizenet/contributors"
2022-
}
2023-
],
2024-
"description": "Authorize.Net gateway for the Omnipay payment processing library",
2025-
"homepage": "https://github.com/thephpleague/omnipay-authorizenet",
2026-
"keywords": [
2027-
"authorize",
2028-
"authorize net",
2029-
"authorize.net",
2030-
"gateway",
2031-
"merchant",
2032-
"omnipay",
2033-
"pay",
2034-
"payment"
2035-
]
2036-
},
20371976
{
20381977
"name": "omnipay/buckaroo",
20391978
"version": "v2.1",
@@ -3250,5 +3189,59 @@
32503189
],
32513190
"description": "Symfony HttpFoundation Component",
32523191
"homepage": "https://symfony.com"
3192+
},
3193+
{
3194+
"name": "omnipay/authorizenet",
3195+
"version": "dev-master",
3196+
"version_normalized": "9999999-dev",
3197+
"source": {
3198+
"type": "git",
3199+
"url": "https://github.com/eileenmcnaughton/omnipay-authorizenet.git",
3200+
"reference": "a955beac72955c8077229728d64069f0061315d1"
3201+
},
3202+
"require": {
3203+
"omnipay/common": "~2.2"
3204+
},
3205+
"require-dev": {
3206+
"omnipay/tests": "~2.0"
3207+
},
3208+
"time": "2016-12-08 03:09:41",
3209+
"type": "library",
3210+
"extra": {
3211+
"branch-alias": {
3212+
"dev-master": "2.0.x-dev"
3213+
}
3214+
},
3215+
"installation-source": "source",
3216+
"autoload": {
3217+
"psr-4": {
3218+
"Omnipay\\AuthorizeNet\\": "src/"
3219+
}
3220+
},
3221+
"license": [
3222+
"MIT"
3223+
],
3224+
"authors": [
3225+
{
3226+
"name": "Adrian Macneil",
3227+
"email": "[email protected]"
3228+
},
3229+
{
3230+
"name": "Omnipay Contributors",
3231+
"homepage": "https://github.com/thephpleague/omnipay-authorizenet/contributors"
3232+
}
3233+
],
3234+
"description": "Authorize.Net gateway for the Omnipay payment processing library",
3235+
"homepage": "https://github.com/thephpleague/omnipay-authorizenet",
3236+
"keywords": [
3237+
"authorize",
3238+
"authorize net",
3239+
"authorize.net",
3240+
"gateway",
3241+
"merchant",
3242+
"omnipay",
3243+
"pay",
3244+
"payment"
3245+
]
32533246
}
32543247
]

vendor/omnipay/authorizenet/.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ php:
55
- 5.4
66
- 5.5
77
- 5.6
8+
- 7.0
89
- hhvm
910

1011
matrix:

vendor/omnipay/authorizenet/src/AIMGateway.php

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Omnipay\AuthorizeNet\Message\AIMAuthorizeRequest;
66
use Omnipay\AuthorizeNet\Message\AIMCaptureRequest;
7+
use Omnipay\AuthorizeNet\Message\AIMPaymentPlanQueryResponse;
78
use Omnipay\AuthorizeNet\Message\AIMPurchaseRequest;
89
use Omnipay\AuthorizeNet\Message\AIMRefundRequest;
910
use Omnipay\AuthorizeNet\Message\AIMVoidRequest;
@@ -26,7 +27,7 @@ public function getDefaultParameters()
2627
'transactionKey' => '',
2728
'testMode' => false,
2829
'developerMode' => false,
29-
'liveEndpoint' => 'https://api.authorize.net/xml/v1/request.api',
30+
'liveEndpoint' => 'https://api2.authorize.net/xml/v1/request.api',
3031
'developerEndpoint' => 'https://apitest.authorize.net/xml/v1/request.api',
3132
);
3233
}
@@ -61,6 +62,16 @@ public function setDeveloperMode($value)
6162
return $this->setParameter('developerMode', $value);
6263
}
6364

65+
public function setHashSecret($value)
66+
{
67+
return $this->setParameter('hashSecret', $value);
68+
}
69+
70+
public function getHashSecret()
71+
{
72+
return $this->getParameter('hashSecret');
73+
}
74+
6475
public function setEndpoints($endpoints)
6576
{
6677
$this->setParameter('liveEndpoint', $endpoints['live']);
@@ -141,4 +152,23 @@ public function refund(array $parameters = array())
141152
{
142153
return $this->createRequest('\Omnipay\AuthorizeNet\Message\AIMRefundRequest', $parameters);
143154
}
155+
156+
157+
/**
158+
* @param array $parameters
159+
* @return AIMPaymentPlanQueryResponse
160+
*/
161+
public function paymentPlanQuery(array $parameters = array())
162+
{
163+
return $this->createRequest('\Omnipay\AuthorizeNet\Message\AIMPaymentPlanQueryRequest', $parameters);
164+
}
165+
166+
/**
167+
* @param array $parameters
168+
* @return AIMRefundRequest
169+
*/
170+
public function query(array $parameters = array())
171+
{
172+
return $this->createRequest('\Omnipay\AuthorizeNet\Message\QueryRequest', $parameters);
173+
}
144174
}

vendor/omnipay/authorizenet/src/CIMGateway.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ public function createCard(array $parameters = array())
4646
return $this->createRequest('\Omnipay\AuthorizeNet\Message\CIMCreateCardRequest', $parameters);
4747
}
4848

49+
public function getPaymentProfile(array $parameters = array())
50+
{
51+
return $this->createRequest('\Omnipay\AuthorizeNet\Message\CIMGetPaymentProfileRequest', $parameters);
52+
}
53+
54+
public function deleteCard(array $parameters = array())
55+
{
56+
return $this->createRequest('\Omnipay\AuthorizeNet\Message\CIMDeletePaymentProfileRequest', $parameters);
57+
}
58+
4959
public function authorize(array $parameters = array())
5060
{
5161
return $this->createRequest('\Omnipay\AuthorizeNet\Message\CIMAuthorizeRequest', $parameters);

vendor/omnipay/authorizenet/src/Message/AIMAbstractRequest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public function setTransactionReference($value)
118118
$transactionRef = new TransactionReference();
119119
$transactionRef->setTransId($value);
120120
}
121+
121122
return $this->setParameter('transactionReference', $transactionRef);
122123
}
123124

@@ -130,6 +131,7 @@ public function setCardReference($value)
130131
if (!($value instanceof CardReference)) {
131132
$value = new CardReference($value);
132133
}
134+
133135
return parent::setCardReference($value);
134136
}
135137

@@ -140,15 +142,28 @@ public function setCardReference($value)
140142
public function getCardReference($serialize = true)
141143
{
142144
$value = parent::getCardReference();
145+
143146
if ($serialize) {
144147
$value = (string)$value;
145148
}
149+
146150
return $value;
147151
}
148152

153+
public function getInvoiceNumber()
154+
{
155+
return $this->getParameter('invoiceNumber');
156+
}
157+
158+
public function setInvoiceNumber($value)
159+
{
160+
return $this->setParameter('invoiceNumber', $value);
161+
}
162+
149163
public function sendData($data)
150164
{
151165
$headers = array('Content-Type' => 'text/xml; charset=utf-8');
166+
152167
$data = $data->saveXml();
153168
$httpResponse = $this->httpClient->post($this->getEndpoint(), $headers, $data)->send();
154169

@@ -162,10 +177,12 @@ public function sendData($data)
162177
public function getBaseData()
163178
{
164179
$data = new \SimpleXMLElement('<' . $this->requestType . '/>');
180+
165181
$data->addAttribute('xmlns', 'AnetApi/xml/v1/schema/AnetApiSchema.xsd');
166182
$this->addAuthentication($data);
167183
$this->addReferenceId($data);
168184
$this->addTransactionType($data);
185+
169186
return $data;
170187
}
171188

@@ -178,6 +195,7 @@ protected function addAuthentication(\SimpleXMLElement $data)
178195
protected function addReferenceId(\SimpleXMLElement $data)
179196
{
180197
$txnId = $this->getTransactionId();
198+
181199
if (!empty($txnId)) {
182200
$data->refId = $this->getTransactionId();
183201
}
@@ -189,6 +207,7 @@ protected function addTransactionType(\SimpleXMLElement $data)
189207
// The extending class probably hasn't specified an "action"
190208
throw new InvalidRequestException();
191209
}
210+
192211
$data->transactionRequest->transactionType = $this->action;
193212
}
194213

@@ -204,15 +223,23 @@ protected function addBillingData(\SimpleXMLElement $data)
204223
/** @var mixed $req */
205224
$req = $data->transactionRequest;
206225

226+
// The order must come before the customer ID.
227+
$req->order->invoiceNumber = $this->getInvoiceNumber();
228+
$req->order->description = $this->getDescription();
229+
207230
// Merchant assigned customer ID
208231
$customer = $this->getCustomerId();
209232
if (!empty($customer)) {
210233
$req->customer->id = $customer;
211234
}
212235

236+
//$req->order->description = $this->getDescription();
237+
213238
/** @var CreditCard $card */
214239
if ($card = $this->getCard()) {
215240
// A card is present, so include billing and shipping details
241+
$req->customer->email = $card->getEmail();
242+
216243
$req->billTo->firstName = $card->getBillingFirstName();
217244
$req->billTo->lastName = $card->getBillingLastName();
218245
$req->billTo->company = $card->getBillingCompany();
@@ -221,6 +248,7 @@ protected function addBillingData(\SimpleXMLElement $data)
221248
$req->billTo->state = $card->getBillingState();
222249
$req->billTo->zip = $card->getBillingPostcode();
223250
$req->billTo->country = $card->getBillingCountry();
251+
$req->billTo->phoneNumber = $card->getBillingPhone();
224252

225253
$req->shipTo->firstName = $card->getShippingFirstName();
226254
$req->shipTo->lastName = $card->getShippingLastName();

0 commit comments

Comments
 (0)