我正试图了解如何制定PayPals新结帐方式,但这并不像我想的那么简单,
有人可以向我解释如何将旧的结帐HTML转换为新的“智能结帐”的PayPals吗?
我包括了行之有效的旧HTML代码,以及不知道如何输入变量的新代码。
任何人都知道如何解决这个问题吗?
谢谢!
<!-- Old and working -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="textarea" id="euroAmount" name="amount" value="1"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="_PAYPAL_ADDRESS_"/>
<input type="hidden" name="lc" value="en_US"/>
<input type="hidden" name="item_name" value="_NAME_OF_PURCHASE_"/>
<input type="hidden" name="custom" value="_ACCOUNT_INFO_">
<input type="hidden" name="button_subtype" value="products"/>
<input type="hidden" name="currency_code" value="EUR"/>
<input type="hidden" name="no_shipping" value="1"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="notify_url" value="_PAYPAL_IPN_"/>
<input type="hidden" name="return" value="_WEBSITE_"/>
<input type="hidden" name="rm" value="0"/>
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest"/>
<input type="submit" class="btn btn-success" name="submit" value="Purchase with paypal"/><br/>
</form>
<!-- New and Stuck -->
<script src="https://www.paypal.com/sdk/js?currency=EUR&client-id=SB"></script>
<div id="paypal-button-container"></div>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
// Set up the transaction
return actions.order.create({
purchase_units: [{
amount: {
"currency_code": "EUR",
value: '1.00'
}
}]
});
}
}).render('#paypal-button-container');
</script>