我正在 Authorizenet支付网关中通过API调用更新客户的电子邮件ID。但是当我调用更新函数时,customerID
被删除了。我的更新功能代码如下:
self::initializePaymentGateway();
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName($this->PAYMENT_GATEWAY_API_USER);
$merchantAuthentication->setTransactionKey($this->PAYMENT_GATEWAY_API_PASSWORD);
$updatecustomerprofile = new AnetAPI\CustomerProfileExType();
$updatecustomerprofile->setCustomerProfileId('xxxxx107');
$updatecustomerprofile->setDescription("Updated existing Profile Request");
$updatecustomerprofile->setEmail($email);
$request = new AnetAPI\UpdateCustomerProfileRequest();
$request->setMerchantAuthentication($merchantAuthentication);
$request->setProfile($updatecustomerprofile);
$controller = new AnetController\UpdateCustomerProfileController($request);
if ($this->IS_LIVE_API_PAYMENT_GATEWAY != 'sandbox') {
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);
} else {
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
}
if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") )
{
// success
}