Skip to content

Commit cd176a7

Browse files
committed
Fixed Community Issue - Error when Zero CIM profiles
Issue: #45 Reproduced the issue by creating a sandbox account with zero customer profiles. Error for getCustomerProfileIds() : Notice: Undefined index: numericString in C:\..local_path...\authorizenet\authorizenet\lib\AuthorizeNetCIM.php on line 491 Fixed the issue by adding a check for empty array.
1 parent 8133aee commit cd176a7

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

lib/AuthorizeNetCIM.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,10 @@ public function getValidationResponse()
488488
public function getCustomerProfileIds()
489489
{
490490
$ids = (array)$this->xml->ids;
491-
return $ids["numericString"];
491+
if(!empty($ids))
492+
return $ids["numericString"];
493+
else
494+
return $ids;
492495
}
493496

494497
/**
@@ -497,7 +500,10 @@ public function getCustomerProfileIds()
497500
public function getCustomerPaymentProfileIds()
498501
{
499502
$ids = (array)$this->xml->customerPaymentProfileIdList;
500-
return $ids["numericString"];
503+
if(!empty($ids))
504+
return $ids["numericString"];
505+
else
506+
return $ids;
501507
}
502508

503509
/**
@@ -506,7 +512,10 @@ public function getCustomerPaymentProfileIds()
506512
public function getCustomerShippingAddressIds()
507513
{
508514
$ids = (array)$this->xml->customerShippingAddressIdList;
509-
return $ids["numericString"];
515+
if(!empty($ids))
516+
return $ids["numericString"];
517+
else
518+
return $ids;
510519
}
511520

512521
/**

0 commit comments

Comments
 (0)