Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Update Bank Account Payment #1

Open
wants to merge 333 commits into
base: master
Choose a base branch
from
Open
Changes from 4 commits
Commits
Show all changes
333 commits
Select commit Hold shift + click to select a range
7fa9d7e
Fix for BC break of returning messages when asking for codes
Jun 10, 2015
272b7b0
Issue #19 Main changes.
judgej Jul 5, 2015
152959c
Issue #19 Add getTransactionId() to SIMcompleteAuthorize.php for acce…
judgej Jul 5, 2015
56e1cec
Issue #22 and Issue #16 implementation
judgej Jul 7, 2015
4a4da57
Issue #16 Test for use of notifyUrl.
judgej Jul 7, 2015
1c6e4d6
Issue #16 Further test for DPM.
judgej Jul 7, 2015
21b39c6
Issue #22 test coverage, some fixes and simplification now much of DP…
judgej Jul 7, 2015
e2c25ff
Issue #22 Typo and additional comment.
judgej Jul 7, 2015
142a95f
Merge pull request #23 from judgej/issue_19
greydnls Jul 15, 2015
1aad9da
Update Endpoint
greydnls Jul 27, 2015
ccf3229
Merge pull request #26 from thephpleague/kayladnls-patch-1
greydnls Jul 27, 2015
16140f8
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet
anush Aug 20, 2015
70e6c9c
XOL-2533 Adding extraOptions payload to request XML
sachinsudheendra Aug 27, 2015
23fbedc
Include omnipay_transaction_id in hidden fields for the DPM form.
judgej Aug 27, 2015
87a39f0
XOL-2533 Parameterizing x_duplicate_window value and using it across …
sachinsudheendra Aug 28, 2015
6bfdef7
XOL-2533 Using the value of the parameter passed in for x_duplicate_w…
sachinsudheendra Sep 10, 2015
9344b3e
Merge pull request #7 from sachinsudheendra/XOL-2533
rushi Sep 10, 2015
9af958e
Fix CodeSniffer issue. Line should be <= 120 chars
rushi Feb 23, 2016
131d7cf
Fix test that failed due to change in SIMGateway's parent
rushi Feb 23, 2016
44e7a06
SIMGateway should inherit AIMGateway
rushi Feb 23, 2016
566cddd
[AIMRefund] Pass credit card expiration date only when an expiration …
mikealmond Feb 25, 2016
b24ebe8
AIMRefund fix PHP < 5.5 bugs
mikealmond Feb 25, 2016
84b2c3f
Make CVV optional
anush Feb 29, 2016
90329a3
Merge pull request #9 from rushi/fix_codesniffer
anush Feb 29, 2016
6f24297
Merge branch 'master' of github.com:xola/authorizenet into optional-cvv
anush Feb 29, 2016
a0de700
Fix codesniffer and namespace issues
rushi Mar 1, 2016
35fc3a7
Do not validate card if no cvv provided
anush Mar 1, 2016
68d4382
CS-137 Look for duplicate payment profiles even if you reach maximum …
rushi Mar 2, 2016
4d5c93a
CS-137 Use PHP 5.3 array() syntax so tests pass
rushi Mar 2, 2016
d1e7f10
CS-137 Add tests for verification of duplicate payment profile logic
rushi Mar 2, 2016
10442c6
CS-137 Set constants for the profile response codes
rushi Mar 2, 2016
d9d1156
Merge pull request #11 from rushi/CS-137
anush Mar 2, 2016
0d5b940
XOL-2788 Ability to void a transaction and auto-void if refund fails
rushi Mar 3, 2016
b6edd12
XOL-2788 Fix transactionReference bug
rushi Mar 3, 2016
599386e
XOL-2788 Fix array syntax for PHP 5.3 compatibility
rushi Mar 3, 2016
2b5ad5e
Merge branch 'master' of github.com:xola/authorizenet into optional-cvv
rushi Mar 3, 2016
adfd19b
Merge pull request #10 from anushr/optional-cvv
rushi Mar 3, 2016
f9f1397
XOL-2788 Update test name
rushi Mar 3, 2016
c7d9a71
XOL-2788 Address code review comment
rushi Mar 3, 2016
f4fc378
Merge pull request #12 from rushi/XOL-2788
anush Mar 4, 2016
e54383a
[AIMRefundRequest] Add test when no credit card expiry dates are set
mikealmond Mar 7, 2016
391c1f3
Merge pull request #33 from mikealmond/patch-1
delatbabel Mar 10, 2016
e2e813b
Merge pull request #27 from academe/master
judgej Mar 10, 2016
dde369f
Merge pull request #15 from dstockto/acicali/master
delatbabel Mar 11, 2016
b4d3d09
Consolidate common functionality between AIM and CIM
anush Mar 12, 2016
c95d0fc
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet…
anush Mar 12, 2016
a5c0a92
Fix merge - make expiry optional for refund
anush Mar 12, 2016
9b1a225
Fixed code style failures
anush Mar 12, 2016
4458875
Merge branch 'master' into xml-api
anush Mar 12, 2016
8ace4bf
Fix duplicate window setting
anush Mar 14, 2016
cfe0227
Point to the origin omnipay-common
anush Mar 18, 2016
95f2899
Fix code style
anush Mar 18, 2016
39542c3
Peg to a proper omnipay-common version dependency
anush Mar 18, 2016
e35e615
Use correct endpoints form DPM and SIM
anush Apr 2, 2016
bd9523c
Merge pull request #34 from anushr/xml-api
judgej Apr 30, 2016
bcb4369
Issue 38 move order of billTo and customerIp elements in AIM authoris…
judgej May 28, 2016
184c5f3
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet…
judgej May 28, 2016
77729dc
Forgot to save file before last commit.
judgej May 28, 2016
45c85fc
Issue #38 new test to confirm order of transactionRequest elements.
judgej May 28, 2016
439bb6e
Merge pull request #39 from thephpleague/issue38
judgej Jun 16, 2016
a8cafa8
DeleteCustomerPaymentProfile Request
alberto1el Jul 2, 2016
2cf352e
Create CIMDeletePaymentProfileResponse.php
alberto1el Jul 2, 2016
b81954d
Create CIMDeletePaymentProfileRequest.php
alberto1el Jul 2, 2016
7512846
Update CIMDeletePaymentProfileRequest.php
alberto1el Jul 7, 2016
bfd7b84
Update CIMDeletePaymentProfileResponse.php
alberto1el Jul 7, 2016
d1efead
Update CIMGateway.php
alberto1el Jul 7, 2016
9f62df5
Update CIMGatewayIntegrationTest.php
alberto1el Jul 7, 2016
17d1a90
Update CIMDeletePaymentProfileResponse.php
alberto1el Jul 7, 2016
07e5af2
Fixed getShippingLastName() was being used to seed shipTo->firstName.
Jul 16, 2016
6e1990f
Merge pull request #46 from fenzig27/pr-invalid-shipping-firstname
judgej Jul 16, 2016
1a699aa
Merge pull request #45 from alberto1el/alberto1el-feature-deleteCusto…
delatbabel Aug 24, 2016
5863e57
Set phoneNumber billTo and phoneNumber shipTo on AIM requests.
mwisner Aug 30, 2016
c0b361d
Remove phoneNumber from shipTo
mwisner Aug 31, 2016
4cef58d
Merge pull request #47 from mwisner/master
judgej Sep 2, 2016
fd15aea
Update composer.json
VinceG Oct 13, 2016
d0b51eb
#50 - AIMResponse->getTransactionReference
vincentavn Oct 13, 2016
96358ab
#50 - AIMResponse->getTransactionReference
vincentavn Oct 13, 2016
bd0851d
Use new Akamai SureRoute endpoint for AIM and CIM
rherriman Oct 18, 2016
fa4fce2
fixed tests and added php 7.0 to travis yaml file
vincentavn Oct 19, 2016
564da01
Add description to AIM request and update related tests
balexander Oct 21, 2016
6501825
set customer email in AIMAbstractRequest
Nov 1, 2016
5369725
Small code tidy-up.
judgej Nov 9, 2016
497ea02
Added test for AIM XML customer email.
judgej Nov 9, 2016
587d5fa
Restored "createMock" back to deprecated "getMock". It worked for me,…
judgej Nov 9, 2016
ab9cac1
Merge pull request #63 from academe/pr60
judgej Nov 9, 2016
9259136
Merge branch 'Issue44-Descriptions_not_sent' of https://github.com/ba…
judgej Nov 9, 2016
ef36670
Change postion of the AIM "order" element in the request.
judgej Nov 10, 2016
e719a3a
Position of "order" in tests in relation to "customer".
judgej Nov 10, 2016
104290d
Merge pull request #64 from academe/pr57
judgej Nov 10, 2016
01c55f6
Merge branch 'issue42' of https://github.com/rherriman/omnipay-author…
judgej Nov 10, 2016
c05dad2
Merge pull request #54 from rherriman/issue42
judgej Nov 10, 2016
1a3cdb8
Issue 16: support invoiceNumber for both CIM and DPM.
judgej Nov 10, 2016
4f4c03c
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet…
judgej Nov 10, 2016
485b3f5
Issue #16 Test for correct setting of invoice number.
judgej Nov 10, 2016
5b5c9f0
Merge pull request #66 from academe/issue16
judgej Nov 10, 2016
3abad70
Merge branch 'expose-transaction-object' of https://github.com/avninc…
judgej Nov 10, 2016
7eb50e1
Merge pull request #52 from avninc/expose-transaction-object
judgej Nov 10, 2016
15a7025
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet
judgej Nov 10, 2016
6021309
Getting malformed guzzle URL
zmonteca Feb 5, 2017
7e61c15
Merge pull request #71 from academe/issue69
judgej Feb 5, 2017
645a25b
Revert "Issue69"
judgej Feb 5, 2017
db5c067
Merge pull request #72 from thephpleague/revert-71-issue69
judgej Feb 5, 2017
36c567c
Issue #69 Include invoiceNumber if supplied in CIM Authorize.
judgej Feb 5, 2017
2da3dfa
Merge pull request #73 from academe/issue69fix
judgej Feb 5, 2017
7f09e7e
Merge branch 'dev-my-bugfix' of https://github.com/zmonteca/omnipay-a…
judgej Feb 6, 2017
48eb3a7
Issue #40 Collect result code, reason code and reason message from th…
judgej Feb 6, 2017
b195c82
Issue #40 switch the "0" result code to "3" (error).
judgej Feb 6, 2017
2db9dd5
Issue #40 Test for AIM Authorize with invalid request data.
judgej Feb 6, 2017
3a06788
Merge pull request #74 from academe/issue40
judgej Feb 10, 2017
d22c493
Small tidy-up of a few scripts.
judgej Feb 21, 2017
f871149
Unit test for fetching error message
felixmaier1989 Mar 2, 2017
66d7b4a
Support for tokenized credit card (Accept.js)
felixmaier1989 Mar 2, 2017
a41d069
Support for tokenized credit card (Accept.js) - unit test
felixmaier1989 Mar 2, 2017
1676edd
Support for tokenized credit card (Accept.js) - PHP doc
felixmaier1989 Mar 2, 2017
e090a13
Do not take opaque data from $_GET
felixmaier1989 Mar 2, 2017
24763d9
Issue #41 Some simple notes on Accept.JS
judgej Mar 3, 2017
902287a
Add getters and setters for hashSecret, an optional authorization par…
eileenmcnaughton Mar 6, 2017
5b9fde9
Typo in readme
Mark-H Mar 7, 2017
229bdb2
Merge pull request #80 from Mark-H/patch-1
judgej Mar 7, 2017
90bceaf
Added solution id
hillelcoren Oct 3, 2017
2850353
Added solution id
hillelcoren Oct 3, 2017
ab2ff86
Add solution id
hillelcoren Oct 4, 2017
7211453
Add solution id
hillelcoren Oct 4, 2017
b36d3c1
Remove PHP5.3 from failing travis tests.
judgej Oct 4, 2017
906d5d2
Merge remote-tracking branch 'upstream/master'
hillelcoren Oct 4, 2017
a508b56
Merge pull request #87 from hillelcoren/master
judgej Oct 7, 2017
af76ebd
Test solutionId for PR #87
judgej Oct 7, 2017
235a0d5
Add PHP 7.1 to the automated tests.
judgej Oct 7, 2017
c1794cd
Merge pull request #88 from academe/master
judgej Oct 7, 2017
97862b7
Merge pull request #78 from eileenmcnaughton/hash_anet
judgej Oct 7, 2017
8216074
Test for PR #78 hashSecret set at AIM gateway level
judgej Oct 7, 2017
ff9dc9d
Extended PR #78 test to CIM gateway.
judgej Oct 7, 2017
30d1d1d
Add actions for querying Authorize.net.
eileenmcnaughton Mar 6, 2017
0388163
Add parent classes into query requests & responses, folderise #79
eileenmcnaughton Nov 6, 2017
2d0b1de
Merge pull request #79 from eileenmcnaughton/anet_query
judgej Nov 27, 2017
379574e
Fix autoloader fatal errors from class reorganization
MegaphoneJon Dec 19, 2017
59fa792
Merge pull request #92 from MegaphoneJon/master
barryvdh Dec 20, 2017
d091c9c
Add capture only tests
Jan 5, 2018
f589329
Add capture only request
Jan 5, 2018
0af67af
Update request based on discussion on issue-93
Jan 7, 2018
5db0086
Update tests
Jan 7, 2018
cea1634
Update capture only request field order
Jan 7, 2018
e755e26
Add capture only to aim gateway
Jan 7, 2018
38a4c4f
Correct spacing
Jan 7, 2018
ac173a1
Merge pull request #94 from samlitowitz/issue-93
judgej Jan 8, 2018
e7cefe2
Add getCVVCode
Jan 12, 2018
29d33aa
Add tests for getCVVCode
Jan 12, 2018
ea732d1
Add getAccountType
Jan 12, 2018
b1a1dda
Add tests for getAccountType
Jan 12, 2018
ecb7665
Reduce line length
Jan 12, 2018
dedf2e3
Merge pull request #100 from samlitowitz/issue-99
judgej Jan 13, 2018
f2f8481
Merge branch 'master' into issue-97
judgej Jan 13, 2018
99c332f
Merge branch 'master' into issue-97
judgej Jan 13, 2018
c2ed236
Merge pull request #98 from samlitowitz/issue-97
judgej Jan 13, 2018
4bb8e18
Add retail data to authOnlyTransactions and authCaptureTransactions
Jan 15, 2018
eb59611
Seperate retail into deviceType and marketType
Jan 16, 2018
898f7b0
Make array object
Jan 17, 2018
d56df20
Add error messages
Jan 17, 2018
5d0f9f6
Add test for retail values in AIMAuthorizeRequest
Jan 17, 2018
ac570da
Issue #105 fix.
judgej Jan 31, 2018
50a3bc2
Introduce PHP7.2 tests
judgej Jan 31, 2018
db39270
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet…
judgej Jan 31, 2018
0064e7c
Removed a var_dump that escaped.
judgej Jan 31, 2018
138fd48
Update to v3
barryvdh May 17, 2018
3aa8002
Better travisci
barryvdh May 17, 2018
0ffbd6c
Fix codestyle
barryvdh May 17, 2018
05ae4b2
Merge branch 'academe-issue105' into upgrade-v3
barryvdh May 17, 2018
4af9581
Merge pull request #106 from academe/issue105
barryvdh May 17, 2018
efe8ba9
Fix cs
barryvdh May 17, 2018
6d8f56a
Merge pull request #110 from thephpleague/upgrade-v3
barryvdh May 17, 2018
c8e03ff
Update README.md
barryvdh May 17, 2018
04de992
Update README.md
barryvdh May 17, 2018
2e9d853
CVV is optional
May 21, 2018
c109d81
Merge pull request #111 from robertology/cvv-optional
barryvdh May 21, 2018
b8bb904
Merge pull request #1 from thephpleague/master
alberto1el Dec 30, 2018
b66ea0d
Add opaqueData to createCard on CIM
alberto1el Dec 30, 2018
af657ce
Fix psr2 style errors
alberto1el Dec 30, 2018
fe3f20c
go back to previous getData order on CIMCreateCardRequest
alberto1el Dec 30, 2018
87d07ae
remove data variable not used on validateCard method
alberto1el Dec 30, 2018
989fedd
leave validate card which only validates the presence of the card param
alberto1el Dec 30, 2018
b6a881d
Issue #118 merge together "split lines" aka "line folding"
judgej Dec 30, 2018
9ce6b52
Merge pull request #119 from thephpleague/issue118
judgej Dec 30, 2018
c3efc21
Merge pull request #2 from thephpleague/master
alberto1el Dec 30, 2018
5276ada
Merge branch 'issue-101' of https://github.com/samlitowitz/omnipay-au…
judgej Dec 30, 2018
202c660
Move some mystery numbers to constants.
judgej Dec 31, 2018
a9738c3
Merge pull request #120 from thephpleague/issue101
judgej Dec 31, 2018
408773a
remove duplicated methods from extended AIMAbstractRequest
alberto1el Dec 31, 2018
55b6038
Add tests for CIM create card feature using Opaque Data
alberto1el Dec 31, 2018
5988948
adds example of opaque data on CIM createCard
alberto1el Dec 31, 2018
8c7ca9c
Merge pull request #117 from alberto1el/master
judgej Dec 31, 2018
d39b025
Merge pull request #3 from thephpleague/master
alberto1el Jan 5, 2019
079a991
Allow CreatePaymentProfile from opaque data
alberto1el Jan 5, 2019
55b6f52
Fix psr2 style
alberto1el Jan 5, 2019
66a83f1
Enable CIM UpdatePaymentProfile
alberto1el Jan 5, 2019
23458a4
Merge pull request #121 from alberto1el/master
judgej Jan 5, 2019
6ac192d
Fix the HttpClient for tests on CIMIntegrationTests and fix a couple …
alberto1el Jan 8, 2019
3135045
Enabled CIMGetProfile on CIMGateway and added a test for it
alberto1el Jan 8, 2019
1bce345
Enabled CIMCreatePaymentProfile as createAdditionalCard on CIMGateway
alberto1el Jan 8, 2019
7e118ad
Issue #123 support HMAC SHA-512 signatureKey
judgej Jan 20, 2019
bbf1985
Merge branch 'master' of github.com:thephpleague/omnipay-authorizenet…
judgej Jan 20, 2019
7871bd3
Issue #123 add test for generation of signature key.
judgej Jan 20, 2019
089d6b0
Merge pull request #124 from thephpleague/issue123
judgej Jan 20, 2019
39594a6
Merge remote-tracking branch 'thephpleague/master'
alberto1el Jan 21, 2019
a86fd7f
Merge pull request #122 from alberto1el/master
judgej Feb 4, 2019
9e8eeae
Add track data to authOnlyTransactions and authCaptureTransactions
judgej Feb 4, 2019
58948ff
Add track2 support to AIM request.
judgej Feb 4, 2019
4d6c14f
Issue #125 fix query message paths.
judgej Feb 5, 2019
475085a
Issue #125 plus some general tidy up of references and docblocks
judgej Feb 5, 2019
aa43c8b
Issue #125 mask "action" validation error in "query" functions.
judgej Feb 6, 2019
671c8de
Bit of formatting to aid readability.
judgej Feb 6, 2019
bd23ae4
Merge pull request #126 from thephpleague/issue125
judgej Feb 6, 2019
7db3b2f
Fix issues related to xml2Array
Feb 7, 2019
5c43a19
Upadte composer.json home page
Feb 11, 2019
a9d460a
Update home page in composer.json
Feb 11, 2019
1fe6f4e
Merge pull request #127 from dmgctrlr/master
judgej Feb 13, 2019
27d01b6
issue-123: add sha512 support for SIMCompleteAuthorizeRequest
odolbin-altexsoft Mar 12, 2019
f288156
issue-123: add getTransactionId method to SIMAuthorizeResponse
odolbin-altexsoft Mar 12, 2019
40b9871
issue-123: fix getTransactionId method to SIMAuthorizeResponse
odolbin-altexsoft Mar 12, 2019
519011b
issue-123: fix getPostedHash method in SIMCompleteAuthorizeRequest
odolbin-altexsoft Mar 12, 2019
de5eb0c
issue-123: fix SIMCompleteAuthorizeRequest
odolbin-altexsoft Mar 12, 2019
6b97fbd
Refactor PR 128 for adding tests.
judgej Mar 16, 2019
07a1a26
Issue #123 / PR #128 Some general refactoring and SHA hash tests added.
judgej Mar 16, 2019
ffe153d
Added PHP 7.3 to tests
judgej Mar 17, 2019
e0098a4
CS-3726 handle XML to JSON array conversion issue when a single payme…
anush Apr 25, 2019
e919ec0
Updated tests to use new GetProfileSuccess response mock
anush Apr 26, 2019
9145e44
Merge together split `Content-Type` header mock
anush Apr 26, 2019
bf5412b
Minor formatting; no functional changes.
judgej Apr 27, 2019
1c2c341
Merge pull request #130 from anush/xml_array
judgej Apr 27, 2019
8ccce31
Merge pull request #129 from thephpleague/pr128
judgej Apr 27, 2019
9c820ba
Merge remote-tracking branch 'thephpleague/master'
tszulc Jan 9, 2020
8eadc03
fix: move under models folder
tszulc Jan 9, 2020
cda37bc
feat: add BankAccount
tszulc Jan 9, 2020
72d2903
fix: update to work with current API requirements & package setup
tszulc Jan 9, 2020
59cc26c
feat: add billing & shipping address for echeck
tszulc Jan 9, 2020
7620022
fix: incorrect function & variable + return-early
tszulc Jan 10, 2020
c0705d9
fix: update valid accountTypes
tszulc Jan 10, 2020
ba6360a
feat: add bank account to transaction reference
tszulc Jan 10, 2020
d81f4f2
feat: add mock eCheck purchase success and failure responses
tszulc Jan 10, 2020
f7fce96
fix: update to mirror Omnipay/Common/CreditCard
tszulc Jan 10, 2020
de154cb
fix: update to use tweaked BankAccount
tszulc Jan 10, 2020
f780e12
feat: add eCheck testing
tszulc Jan 10, 2020
e85fd2e
feat: add BankAccount testing - similar to Omnipay/Common/CreditCard
tszulc Jan 10, 2020
77053da
feat: custom exception
tszulc Jan 14, 2020
11e54be
feat: add regex for routing number
tszulc Jan 14, 2020
af7de01
feat: use custom exception
tszulc Jan 14, 2020
23e286c
feat: validate the routing number matches regex & passes checksum
tszulc Jan 14, 2020
09493b4
feat: add testing for routing number validation
tszulc Jan 14, 2020
319d671
fix: swap elements to be in the correct order
tszulc Jan 15, 2020
1b9c64e
Issue #135 added clarificartion to help example.
judgej Oct 25, 2020
7f35274
Merge remote-tracking branch 'thephpleague/master'
tszulc Mar 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Message/CIMGetProfileResponse.php
Original file line number Diff line number Diff line change
@@ -26,6 +26,11 @@ public function getMatchingPaymentProfileId($last4)
return null;
}

// Handle quirkiness with XML -> JSON conversion
if (!array_key_exists(0, $this->data['profile']['paymentProfiles'])) {
$this->data['profile']['paymentProfiles'] = [$this->data['profile']['paymentProfiles']];
}

foreach ($this->data['profile']['paymentProfiles'] as $paymentProfile) {
// For every payment profile check if the last4 matches the last4 of the card in request.
$cardLast4 = substr($paymentProfile['payment']['creditCard']['cardNumber'], -4);
10 changes: 5 additions & 5 deletions tests/CIMGatewayTest.php
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ public function testCreateCardFromOpaqueDataSuccess()
public function testShouldCreateCardIfDuplicateCustomerProfileExists()
{
$this->setMockHttpResponse(array('CIMCreateCardFailureWithDuplicate.txt', 'CIMCreatePaymentProfileSuccess.txt',
'CIMGetProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));
'CIMGetMultipleProfilesSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));

$response = $this->gateway->createCard($this->createCardOptions)->send();

@@ -133,7 +133,7 @@ public function testShouldCreateCardIfDuplicateCustomerProfileExists()
public function testShouldCreateCardFromOpaqueDataIfDuplicateCustomerProfileExists()
{
$this->setMockHttpResponse(array('CIMCreateCardFailureWithDuplicate.txt', 'CIMCreatePaymentProfileSuccess.txt',
'CIMGetProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));
'CIMGetMultipleProfilesSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));

$response = $this->gateway->createCard($this->createCardFromOpaqueDataOptions)->send();

@@ -149,7 +149,7 @@ public function testShouldUpdateExistingPaymentProfileIfDuplicateExistsAndForceC
{
// Duplicate **payment** profile
$this->setMockHttpResponse(array('CIMCreateCardFailureWithDuplicate.txt', 'CIMCreatePaymentProfileFailure.txt',
'CIMGetProfileSuccess.txt', 'CIMUpdatePaymentProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));
'CIMGetMultipleProfilesSuccess.txt', 'CIMUpdatePaymentProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));

$response = $this->gateway->createCard($this->createCardOptions)->send();

@@ -165,7 +165,7 @@ public function testDoesntUpdateExistingPaymentProfileFromOpaqueData()
{
// Duplicate **payment** profile
$this->setMockHttpResponse(array('CIMCreateCardFailureWithDuplicate.txt', 'CIMCreatePaymentProfileFailure.txt',
'CIMGetProfileSuccess.txt', 'CIMUpdatePaymentProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));
'CIMGetMultipleProfilesSuccess.txt', 'CIMUpdatePaymentProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));

$response = $this->gateway->createCard($this->createCardFromOpaqueDataOptions)->send();

@@ -175,7 +175,7 @@ public function testDoesntUpdateExistingPaymentProfileFromOpaqueData()
public function testShouldUpdateExistingPaymentProfileIfDuplicateExistsAndMaxPaymentProfileLimitIsMet()
{
$this->setMockHttpResponse(array('CIMCreateCardFailureWithDuplicate.txt',
'CIMCreatePaymentProfileFailureMaxProfileLimit.txt', 'CIMGetProfileSuccess.txt',
'CIMCreatePaymentProfileFailureMaxProfileLimit.txt', 'CIMGetMultipleProfilesSuccess.txt',
'CIMUpdatePaymentProfileSuccess.txt', 'CIMGetPaymentProfileSuccess.txt'));

$response = $this->gateway->createCard($this->createCardOptions)->send();
14 changes: 11 additions & 3 deletions tests/Message/CIMGetProfileResponseTest.php
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@

namespace Omnipay\AuthorizeNet\Message;

use Omnipay\Common\Exception\InvalidResponseException;
use Omnipay\Tests\TestCase;

class CIMGetProfileResponseTest extends TestCase
@@ -15,13 +14,22 @@ public function testConstructEmpty()
new CIMGetProfileResponse($this->getMockRequest(), '');
}

public function testGetMatchingPaymentProfileId()
public function testGetMultipleMatchingPaymentProfileId()
{
$httpResponse = $this->getMockHttpResponse('CIMGetProfileSuccess.txt');
$httpResponse = $this->getMockHttpResponse('CIMGetMultipleProfilesSuccess.txt');
$response = new CIMGetProfileResponse($this->getMockRequest(), $httpResponse->getBody());

$this->assertEquals('26455656', $response->getMatchingPaymentProfileId('1111'));
$this->assertEquals('26455709', $response->getMatchingPaymentProfileId('8888'));
$this->assertNull($response->getMatchingPaymentProfileId('8889'));
}

public function testGetSingleMatchingPaymentProfileId()
{
$httpResponse = $this->getMockHttpResponse('CIMGetSingleProfileSuccess.txt');
$response = new CIMGetProfileResponse($this->getMockRequest(), $httpResponse->getBody());

$this->assertEquals('26455656', $response->getMatchingPaymentProfileId('1111'));
$this->assertNull($response->getMatchingPaymentProfileId('8889'));
}
}
13 changes: 13 additions & 0 deletions tests/Mock/CIMGetSingleProfileSuccess.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 746
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Access-Control-Allow-Headers: x-requested-with,cache-control,content-type,origin,method
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,OPTIONS
Date: Thu, 18 Sep 2014 03:59:27 GMT

<?xml version="1.0" encoding="utf-8"?><getCustomerProfileResponse><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><profile><email>[email protected]</email><customerProfileId>28775801</customerProfileId><paymentProfiles><billTo><firstName/><lastName/><company/><address/><city/><state/><zip>12345</zip><country/></billTo><customerPaymentProfileId>26455656</customerPaymentProfileId><payment><creditCard><cardNumber>XXXX1111</cardNumber><expirationDate>XXXX</expirationDate></creditCard></payment></paymentProfiles></profile></getCustomerProfileResponse>