我正在使用以下代码
$customerProfile = new AuthorizeNetCustomer;
$customerProfile->description = "Description of customer";
$customerProfile->merchantCustomerId = "honululu27";
$customerProfile->email = "user2@domain.com";
// Add payment profile.
$paymentProfile = new AuthorizeNetPaymentProfile;
$paymentProfile->payment->creditCard->cardNumber = "4111111111111111";
$paymentProfile->payment->creditCard->expirationDate = "2015-10";
$customerProfile->paymentProfiles[] = $paymentProfile;
//Check customer
$request = new AuthorizeNetCIM;
$response = $request->createCustomerProfile($customerProfile);
echo $response->getCustomerProfileId(); //shows up only in case of success
echo $response->xml->resultCode; //never shows up
echo $response->xml->message->code; //never shows up
echo $response->xml->customerProfileId; //shows up only in case of success
// Confused about the portion below
if($response->isOk())
{
echo "Success";
echo $response->getCustomerProfileId();
}
else
{
echo "FAILED";
echo $response->xml->resultCode;
}
现在,您可能会说,我是这方面的新手,所以我不知道如何显示消息文本和代码。唯一有效的是客户 ID,它会在成功的情况下显示出来,但是所有其他 xml 字段(如消息)呢?