更新客户信息会导致删除客户ID授权网

时间:2016-05-04 04:38:20

标签: yii payment-gateway authorize.net

我正在 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 
    }

0 个答案:

没有答案