php - 客人使用“立即付款”按钮结账 (dwolla)

标签 php dwolla

我查看了文档,但找不到如何使用“立即付款”按钮将 AllowFundingSources 设置为“true”的示例。

Guest Checkout 是否仅用于服务器到服务器的结账?

是否有使用访客结账的完整示例? (不仅仅是片段)。

这是我的按钮代码:

<a data-key="YOUR-KEY-HERE" 
data-tax="0" data-shipping="0" data-amount="941.00"
data-desc="Invoice: WDGR112612" 
data-name="October - November " class="dwolla_button" 
href="http://mysite.com/paym/?type=success">Continue</a>

表单代码:

  <p> <?php
    $key = "YOUR_APPLICATION_KEY";
    $secret = "YOUR_APPLICATION_SECRET";
    $timestamp = time();
    $order_id = 1;

    $signature = hash_hmac('sha1', "{$key}&{$timestamp}&{$order_id}", $secret);
    ?>
    <form accept-charset="UTF-8" action="https://www.dwolla.com/payment/pay"
    method="post">

    <input id="key" name="key" type="hidden" value="abcdefg" />
    <input id="signature" name="signature" type="hidden" value="abcd" />
    <input id="callback" name="callback" type="hidden"
    value="http://www.mywebsite.com/callback.aspx" />
    <input id="redirect" name="redirect" type="hidden"
    value="http://www.mywebsite.com/redirect.aspx" />
    <input id="test" name="test" type="hidden" value="true" />
    <input id="name" name="name" type="hidden" value="Purchase" />
    <input id="description" name="description" type="hidden"
    value="Description" />
    <input id="destinationid" name="destinationid" type="hidden"
    value="812-111-1111" />
    <input id="amount" name="amount" type="hidden" value="1.00" />
    <input id="shipping" name="shipping" type="hidden" value="0.00" />
    <input id="tax" name="tax" type="hidden" value="0.00" />
    <input id="orderid" name="orderid" type="hidden" value="188375" />
    <input id="timestamp" name="timestamp" type="hidden"
    value="1323302400" />

    <button type="submit">Pay Now</button>
    </form>

最佳答案

实际上有一种更简单的方法可以在付款按钮上启用访客结账...

只需在标签中添加“allow-guest-checkout”属性即可,如下:

<a href="http://www.example.com" class="dwolla_button" data-key="..." data-tax="0" data-shipping="0.99" data-amount="0.00" data-desc="A button [1]" data-name="Testing mode [1]" data-guest-checkout="true" >A button with GC</a>

关于php - 客人使用“立即付款”按钮结账 (dwolla),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13998832/

相关文章:

php - 如何从字符串中删除 'em' 破折号?

php - Laravel 8 速率限制器不适用于路由

python - 无效的源路径/_links/source/href - Django

php - 如何在 Laravel 5.1 中设置数据库、服务器、用户名和密码?

php - 防止我的自定义 WordPress 主题被复制

php - MySQL 中的 If 语句?

webhooks - Dwolla API Webhooks 通知是否发送了错误的交易 ID?

javascript - 格子链接 Dwolla 集成

webhooks - 当 Dwolla 客人结账最终结账或未能结账时会发生什么?

dwolla - 是否有一种干净的方式来代表用户支付 Dwolla 征收的费用?