Braintree-国外支付对接(三) 之Customer UI

前篇:Braintree-国外支付对接(二) 中的支付按钮的生成是braintree自带的样式和事件控制的,即drop-in,生成的界面我们不能过多的更改和控制。所以假如我们想要自己编写控件,自己控制样式,但又能正常点击触发支付等事件。那么就使用Customer UI.

使用Customer UI需要映入的官方JS有很大不同,但是我们的后端是不需要变的,因为提交的参数和返回的参数是一样的。下面给出的例子,没有过多的写的样式很漂亮华丽,简单点:

<div class="wrapper">
    <div class="checkout container">
        <header>
            <h1>Hi,
                <br>
                Let's test a transaction</h1>
            <p>
                Make a test payment with Braintree using PayPal or a card
            </p>
        </header>

        <form id="payment-form" method="post" action="/checkouts/Create">
            <section>
                <label for="amount">
                    <span class="input-label">Amount</span>
                    <div class="input-wrapper amount-wrapper">
                        <input id="amount" name="amount" type="tel" min="0.01" placeholder="Amount" value="0.01">
                    </div>
                </label>

                <fieldset>
                    <legend>Card</legend>

                    <div class="cardinfo-card-number">
                      <label class="cardinfo-label" for="cc-number">Card Number</label>
                      <div class='input-wrapper' id="cc-number"></div>
                      <div id="card-image"></div>
                    </div>

                    <div class="cardinfo-card-number">
                      <label class="cardinfo-label" for="cc-number">CVV</label>
                      <div class='input-wrapper' id="cc-cvv"></div>
                    </div>

                     <div class="cardinfo-card-number">
                      <label class="cardinfo-label" for="cc-expiration-date">Expiration-Date</label>
                      <div class='input-wrapper' id="cc-expiration-date"></div>
                    </div>     
                    <button style="margin-top: 10px; background-color: pink;" class="button" id="card-button" type="button"><span style="padding: 0.7em 1em">Done</span></button>
                </fieldset>
                <fieldset>
                    <legend>Paypal</legend>
                    <button style="margin-top: 10px; background-color: pink;" class=
  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值