【问题标题】:Get expiration date using Customer Payment Profile Response使用客户付款资料响应获取到期日期
【发布时间】:2011-02-24 09:05:49
【问题描述】:

在我的网站中,我实现了 authorixe.net CIM 功能。我已成功创建我的用户详细信息并删除了用户帐户。现在我想检索客户资料信息。我已发送客户资料请求并尝试显示信用卡号和到期日期以更新付款流程(用于网站目标)。请看下面的代码

if ("Ok" == $parsedresponse->messages->resultCode) {        
    echo $parsedresponse->profile->paymentProfiles->payment->creditCard->cardNumber;
    echo $parsedresponse->profile->paymentProfiles->payment->creditCard->expirationDate;            
}

我得到了卡号的最后 4 位数字,结果 XXXX 作为到期日期。

我需要像往常一样显示日期(不是 XXXX 格式)。我怎样才能得到有效期?

【问题讨论】:

    标签: php authorize.net


    【解决方案1】:

    新的 API 解决了这个问题——在请求 getCustomerPaymentProfile 中使用参数:'unmaskExpirationDate' 和'瞧!'它将返回未屏蔽的到期日期。我不得不在 PHP SDK 中手动添加它,它看起来像这样:

    public function getCustomerPaymentProfile($customerProfileId, $customerPaymentProfileId, $unmaskExpiration = false)
    {
        $this->_constructXml("getCustomerPaymentProfileRequest");
        $this->_xml->addChild("customerProfileId", $customerProfileId);
        $this->_xml->addChild("customerPaymentProfileId", $customerPaymentProfileId);
    
        if($unmaskExpiration){
            $this->_xml->addChild("unmaskExpirationDate", $unmaskExpiration);    
        }
    
        return $this->_sendRequest();
    }
    

    【讨论】:

      【解决方案2】:

      该信息被屏蔽,无法通过 API 检索。创建配置文件时,您需要存储到期日期,或者如果您使用它来确定他们的卡何时到期,那么store the notification date of when you need to start notifying them their card is about to expire

      【讨论】:

        【解决方案3】:

        此问题还有另一种解决方法。您需要做的就是在billTo 个人资料信息中找到一个字段来存储您的到期日期。例如,如果您不需要存储客户的传真(或电话号码,或国家等),那么您可以使用此字段来复制到期日期。然后,当您收到个人资料时,您将能够从该字段中获取不安全的到期日期。

        【讨论】:

          猜你喜欢
          • 2016-02-01
          • 1970-01-01
          • 2015-05-03
          • 1970-01-01
          • 2015-02-26
          • 2017-08-06
          • 2014-09-08
          • 2016-11-29
          • 2014-04-06
          相关资源
          最近更新 更多