如何在php中的authorized.net获取客户资料详细信息

时间:2015-12-14 11:01:45

标签: php api authorize.net

我想将所有客户资料详细信息检索为 1个客户的第一个名字 2姓 cardit卡号 以及所有相关的客户数据  我在php中使用authorized.net提供的示例代码 我在用 Get Customer Payment Profile()函数用于检索来自authorized.net的所有数据 但它给了我

GetCustomerPaymentProfile SUCCESS: Customer Payment Profile Id: 33211899

不是全部细节 任何人都可以提出建议

1 个答案:

答案 0 :(得分:0)

Authorize.net提供的示例代码获取服务器的付款资料,但只显示PaymentProfileid

因此,要获得回复所有细节所需的所有细节

只需在获取$respone对象后修改这些行,它就会为您提供所需的详细信息。

if(($response != null)){
    if ($response->getMessages()->getResultCode() == "Ok")
    {
        echo "GetCustomerPaymentProfile SUCCESS: " . "\n";
        echo "Customer Payment Profile Id: " . $response->getPaymentProfile()->getCustomerPaymentProfileId() . "\n";
        echo "Credit Card Number: " . $response->getPaymentProfile()->getPayment()->getCreditCard()->getCardNumber() . "\n";
        echo "Credit Card Number: " . $response->getPaymentProfile()->getBillTo()->getFirstName() . "\n";
        echo "Credit Card Number: " . $response->getPaymentProfile()->getBillTo()->getLastName() . "\n";
    }
    else
    {
        echo "GetCustomerPaymentProfile ERROR :  Invalid response\n";
        echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . "  " .$response->getMessages()->getMessage()[0]->getText() . "\n";
    }
}
else{
    echo "NULL Response Error";
}
相关问题