1

我正在将 Authorize.NET 与我的 Web 应用程序集成。我正在使用此处所述的托管付款表格:

我想使用设置页面中描述的默认付款表单:https ://sandbox.authorize.net/UI/themes/sandbox/Settings/SettingsPayFormMain.aspx我想通过传递相关字段来自定义此付款表单。

我正在使用以下 JSON 对象:

{
  "getHostedPaymentPageRequest": {
    "merchantAuthentication": {
      "name": "api_key",
      "transactionKey": "transaction_key"
    },
    "transactionRequest": {
      "transactionType": "authCaptureTransaction",
      "amount": "20.00",
      "profile": {
        "customerProfileId": "123456789"
      },
      "customer": {
        "email": "ellen@mail.com"
      },
      "billTo": {
        "firstName": "Ellen",
        "lastName": "Johnson",
        "company": "Souveniropolis",
        "address": "14 Main Street",
        "city": "Pecan Springs",
        "state": "TX",
        "zip": "44628",
        "country": "USA"
      }
    },
    "hostedPaymentSettings": {
      "setting": [{
        "settingName": "hostedPaymentReturnOptions",
        "settingValue": "{\"showReceipt\": true, \"url\": \"https://example.com/receipt\", \"urlText\": \"Continue\", \"cancelUrl\": \"https://example.com/cancel\", \"cancelUrlText\": \"Cancel\"}"
      },  {
        "settingName": "hostedPaymentShippingAddressOptions",
        "settingValue": "{\"show\": false, \"required\": false}"
      }, {
        "settingName": "hostedPaymentBillingAddressOptions",
        "settingValue": "{\"show\": true, \"required\": false}"
      }, {
        "settingName": "hostedPaymentCustomerOptions",
        "settingValue": "{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}"
      }, {
        "settingName": "hostedPaymentOrderOptions",
        "settingValue": "{\"show\": true, \"merchantName\": \"G and S Questions Inc.\"}"
      }, {
        "settingName": "hostedPaymentIFrameCommunicatorUrl",
        "settingValue": "{\"url\": \"https://example.com/special\"}"
      }]
    }
  }
}

我收到以下看起来不专业的付款表格。知道如何使用 Authorize.NET 的默认付款表格

在此处输入图像描述

默认表格 在此处输入图像描述

使用的 HTML 表格:

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<head>

</head>
<body>
    <form method="post" action="https://test.authorize.net/payment/payment" id="formAuthorizeNetTestPage" name="formAuthorizeNetTestPage">
        <input type="hidden" name="token" value="Replace with form token from getHostedPaymentPageResponse" />
        Continue to Authorize.Net to Payment Page
        <button id="btnContinue">Continue to next page</button>
    </form>         
</body>
</html>
4

2 回答 2

3

Authorize.Net accept.js 托管表单无法按照您希望的方式进行自定义。这是设计使然。它适用于不具备技术知识的企业/开发人员如何进行更复杂的(即使只是轻微的)结帐页面实施。

自托管的 accept.js 表单可以完全自定义并且仍然将我们的网站保持在 PCI 范围之外,因为信用卡数据永远不会通过您的服务器。

总而言之,Authorize.Net 托管的表单无法按照您希望的方式进行定制。但这不是必需的,因为您可以通过使用该表单的自托管版本来完成相同的事情并远离 PCI 范围。


这是我用来获取托管付款表单的代码,它会以您想要的方式显示。如果您没有看到与我相同的页面,请验证您在表单操作中的 URL 是否正确。以下是沙盒 URL。生产 URL 是https://accept.authorize.net/payment/payment.

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Hosted Accept.js Payment Form</title>
</head>
<body>
    <form id="paymentForm" method="POST" action="https://test.authorize.net/payment/payment">
        <input type="hidden" name="token" id="token" value="YOUR_TOKEN_HERE" />
        <button onclick="sendPaymentDataToAnet()">Go to Authorize.Net hosted payment form</button>
    </form>
</body>
</html>
于 2020-05-17T12:53:41.640 回答
0

您要查找的付款页面是 Authorize 曾经提供的旧页面,现在他们移到了新页面。根据他们的网站,旧网址是https://secure.authorize.net/gateway/transact.dll来获取旧页面,但现在已弃用。请参阅此链接以了解已更改的内容https://developer.authorize.net/api/upgrade_guide.html

于 2020-05-22T22:42:44.363 回答