Skip to content

Commit 10442c6

Browse files
committed
CS-137 Set constants for the profile response codes
1 parent d1e7f10 commit 10442c6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Message/CIMCreateCardRequest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ public function createPaymentProfile(CIMCreateCardResponse $createCardResponse)
203203
$getProfileResponse = $this->makeGetProfileRequest($parameters);
204204

205205
// Check if there is a pre-existing profile for the given card numbers.
206-
$otherErrorCodes = array('E00039', 'E00042'); // For these codes we should check for duplicate payment profiles
206+
// For these codes we should check for duplicate payment profiles
207+
$otherErrorCodes = array(
208+
CIMGetProfileResponse::ERROR_DUPLICATE_PROFILE,
209+
CIMGetProfileResponse::ERROR_MAX_PAYMENT_PROFILE_LIMIT_REACHED
210+
);
207211
if (!$createPaymentProfileResponse->isSuccessful() &&
208212
in_array($createPaymentProfileResponse->getReasonCode(), $otherErrorCodes)
209213
) {

src/Message/CIMGetProfileResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*/
88
class CIMGetProfileResponse extends CIMCreatePaymentProfileResponse
99
{
10+
const ERROR_DUPLICATE_PROFILE = 'E00039';
11+
const ERROR_MAX_PAYMENT_PROFILE_LIMIT_REACHED = 'E00042';
12+
1013
protected $xmlRootElement = 'getCustomerProfileResponse';
1114

1215
/**

0 commit comments

Comments
 (0)