【问题标题】:Authorize Php Simple Checkout Form授权 PHP 简单结帐表格
【发布时间】:2018-03-29 07:05:07
【问题描述】:

我想使用 Authorize.net SDK 用 php 实现一个简单的结帐。我对所有可用的 API 感到非常困惑:

现在我正在使用 AIM api:

$sale = new AuthorizeNetAIM;
    $sale->setFields(
        array(
            // aici
            'amount'     => $total_price,
            'card_num'   => $data['CreditCardNumber'],
            'exp_date'   => $data['ExpirationDate'],
            'tax'        => $tax,

            // Billing Information
            'zip'     => $data['Zip'],
            'country' => $data['Country'],
            'address' => $data['Address'],

            // Shipping Information
            'ship_to_first_name' => $data['CardHolder'],
            'ship_to_address'    => $data['Address'],
            'ship_to_city'       => $data['City'],
            'ship_to_company'    => 'No Comapny',
            'ship_to_country'    => $data['Country'],
            'ship_to_zip'        => $data['Zip']
      )
    );

AIM 曾经在我的开发服务器上工作,但现在它返回错误,它无法连接到 Authorize。

【问题讨论】:

  • 您的服务器是否支持 TLS 1.2?
  • 已修复,但在 curl 请求中添加 SSL 忽略,实时网站将具有 SSL,之后我将删除它们 :)
  • 您应该回答并接受它,以便将来遇到相同问题的用户可以找到解决方案。它还可以防止系统定期碰到这个问题。

标签: php authorize.net


【解决方案1】:

他们有official PHP SDK

获取 MerchantAuthenticationType

$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName("YOURLOGIN");
$merchantAuthentication->setTransactionKey("YOURKEY");

获取订阅列表

$sorting = new net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType();
$sorting->setOrderBy('firstName');
$sorting->setOrderDescending(false);

在此处查找更多示例:https://github.com/AuthorizeNet/sample-code-php

【讨论】:

    猜你喜欢
    • 2015-07-19
    • 2017-09-25
    • 1970-01-01
    • 2021-11-10
    • 2019-05-05
    • 2018-11-05
    • 2011-02-24
    • 2019-01-29
    • 1970-01-01
    相关资源
    最近更新 更多