Skip to content

Commit 264f35e

Browse files
authored
Merge branch 'master' into master
2 parents 7c351e9 + 89691de commit 264f35e

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

lib/AuthorizeNetCIM.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,13 @@ public function getCustomerProfileIds()
181181
*
182182
* @return AuthorizeNetCIM_Response
183183
*/
184-
public function getCustomerProfile($customerProfileId)
184+
public function getCustomerProfile($customerProfileId, $unmaskExpirationDate = false)
185185
{
186186
$this->_constructXml("getCustomerProfileRequest");
187187
$this->_xml->addChild("customerProfileId", $customerProfileId);
188+
if ( $unmaskExpirationDate ) {
189+
$this->_xml->addChild("unmaskExpirationDate", true);
190+
}
188191
return $this->_sendRequest();
189192
}
190193

lib/AuthorizeNetCP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function __construct($response, $delimiter, $encap_char, $custom_fields)
119119
// If it's an XML response
120120
if (substr($response, 0, 5) == "<?xml") {
121121

122-
$this->xml = @simplexml_load_string($response);
122+
$this->xml = @simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOWARNING);
123123
// Set all fields
124124
$this->version = array_pop(array_slice(explode('"', $response), 1,1));
125125
$this->response_code = (string)$this->xml->ResponseCode;

lib/shared/AuthorizeNetXMLResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function __construct($response)
2626
{
2727
$this->response = $response;
2828
if ($response) {
29-
$this->xml = @simplexml_load_string($response);
29+
$this->xml = @simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOWARNING);
3030

3131
// Remove namespaces for use with XPath.
32-
$this->xpath_xml = @simplexml_load_string(preg_replace('/ xmlns:xsi[^>]+/','',$response));
32+
$this->xpath_xml = @simplexml_load_string(preg_replace('/ xmlns:xsi[^>]+/','',$response),'SimpleXMLElement', LIBXML_NOWARNING);
3333
}
3434
}
3535

@@ -125,4 +125,4 @@ protected function _getElementContents($elementName)
125125
}
126126
}
127127

128-
}
128+
}

tests/AuthorizeNetCIM_Test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ public function testAll()
353353
$paymentProfile = new AuthorizeNetPaymentProfile;
354354
$paymentProfile->customerType = "individual";
355355
$paymentProfile->payment->creditCard->cardNumber = "4111111111111111";
356+
356357
$paymentProfile->payment->creditCard->expirationDate = (date("Y") + 5) ."-10";
358+
357359
$response = $request->createCustomerPaymentProfile($customerProfileId, $paymentProfile);
358360
$this->assertTrue($response->isOk());
359361
$paymentProfileId = $response->getPaymentProfileId();

0 commit comments

Comments
 (0)