Reputation: 2898
In my web site I have implemented authorixe.net CIM function. I have successfully created my users details and deleted users account. Now I want to retrieve customer profile info. I have send a customer profile request and tried to display the Credit card number and exp date For Renew the payment process (For the site objective). See the code below
if ("Ok" == $parsedresponse->messages->resultCode) {
echo $parsedresponse->profile->paymentProfiles->payment->creditCard->cardNumber;
echo $parsedresponse->profile->paymentProfiles->payment->creditCard->expirationDate;
}
I got the last 4 digits as card number, and got the result XXXX as the Expiration date.
I need to display the date as usual date (Not XXXX format). How can I get the expiration date?
Upvotes: 0
Views: 1986
Reputation: 316
The new API addresses this issue -- use the parameter: 'unmaskExpirationDate' on the request getCustomerPaymentProfile and, 'Voila!' it will return the unmasked expiration date. I had to manually add this in the PHP SDK, it looks like this:
public function getCustomerPaymentProfile($customerProfileId, $customerPaymentProfileId, $unmaskExpiration = false)
{
$this->_constructXml("getCustomerPaymentProfileRequest");
$this->_xml->addChild("customerProfileId", $customerProfileId);
$this->_xml->addChild("customerPaymentProfileId", $customerPaymentProfileId);
if($unmaskExpiration){
$this->_xml->addChild("unmaskExpirationDate", $unmaskExpiration);
}
return $this->_sendRequest();
}
Upvotes: 3
Reputation: 4361
There is another workaround for this issue. All what you need to do is to find a field in billTo
profile information to store your expiration date. For instance, if you don't need to store customer's fax (or phone number, or country, etc), then you can use this field to duplicate expiration date. Then when you receive a profile, you will be able to fetch insecure expiration date from that field.
Upvotes: 0
Reputation: 219874
That information is masked and cannot be retrieved via the API. When creating the profile you either need to store the expiration date , or if you are using it to determine when their card is going to expire, then store the notification date of when you need to start notifying them their card is about to expire.
Upvotes: 0