支付网关可用于 Github.io

Payment Gateway Available on Github.io

我想在我的 github.io 网站上接受付款。我想知道哪些支付网关 API 是兼容的。我制作了一个有效的贝宝业务购买按钮,但我没有收到我的网站已被接受的确认信息。

这个问题的特殊之处在于github.io不允许动态脚本。

我们开始了:

  1. 转到 paypal.com 并登录您的帐户
  2. 打开选项卡Merchant Tools
  3. 在右侧,单击 Buy Now buttons
  4. 在第一个选项卡上设置您的按钮Step 1: Choose a button type and enter your payment details
  5. 转到选项卡 Step 2: Track inventory, profit & loss (optional)
  6. 检查第一个字段:Save button at PayPal 这将向您保证:

    • 保护您的按钮免受欺诈性更改
    • 自动将按钮添加到您的 PayPal 配置文件中的 "My Saved Buttons"
    • 轻松创建相似按钮
    • 使用 PayPal 的工具编辑您的按钮

这将使付款过程安全。

  1. 转到选项卡 Step 3: Customize advanced features (optional)

    • 您可以在此处添加自定义 "sucess" 结帐页面 - 选中此选项并将 url 添加到您的 "thanks" 页面: Take customers to this URL when they finish checkout

    • 您可以在此处添加自定义 "failed" 结帐页面 - 选中此选项并将 url 添加到您的 "cancelled" 页面: Take customers to this URL when they cancel their checkout

  2. 点击Create Button

  3. 复制给定的代码并将其粘贴到您的 html <body>

  4. 将此添加到页面 <head>:

<script async src="https://www.paypalobjects.com/js/external/paypal-button.min.js" type="text/javascript"></script>

创建一个新的 html 并粘贴 PayPal 提供的所有代码,您将能够在本地看到该按钮 (运行 bundle exec jekyll serve) 并使用 PayPal Sandbox 对其进行测试.您可以通过 PayPal Sandbox 执行所有操作以在 GitHub(或其他任何地方)上对其进行测试:创建帐户、选择货币、创建按钮等。为此,请创建一个沙盒帐户 here and log into it here

当一切正常工作时,您可以通过 http://paypal.com 执行相同操作,并将按钮代码替换为您的 真实 按钮代码。

希望对您有所帮助!如果您需要其他东西,请告诉我:)