EDIT: I realized that by using getCustomerProfile I CAN get the last 4 digits to show of the CC (the point of this post).
With that said, I will leave the question open, though, just as I am curious as to why I am able to get the customer profile data to show but nothing shows properly when I use getCustomerPaymentProfile. So while my issue is technically solved (getting the last 4 digits of their cc info) I am curious to see why one function works and one does not. Thanks
#### Original Post Before Edit ####
Hey,
Everything else seems to work fine for me. Yet when I try to pull the payment data, so I can have repeat customers see a reminder of the last CC they used (I just want them to see the last 4 digits, that's all). Creating profiles is a snap for me. Getting the basic address profile data is easy. Getting the payment profile data, not so much. Curious as to what I am doing wrong. Ty
require('AuthnetCIM.class.php');
$request = new AuthnetCIM('mylogin', 'my_trans_id', AuthnetCIM::USE_DEVELOPMENT_SERVER);
$profile_id="xxxxxx";
$payment_profile_id="xxxxxx";
# A guesswork attempt to pull data by passing the payment profile id that I have stored
$request->setParameter('customerPaymentProfileId', $payment_profile_id);
$request->getCustomerPaymentProfile();
print_r($request); // just to test out the printout
The error I receive is:
customerProfileId' element is invalid - The value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:numericString' - The Pattern constraint failed.
Above that I receive this:
E00003
As an error as well.
So, what code am I missing to remedy this? Once again, getting shipping or billing data is easy. Getting the payment data, I can't figure it out for some reason.
Thanks.