首先还是要到paypal上注册开发者信息,这部分你们自己去研究咯。这里就不作说明。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>結賬</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="css/mui.min.css">
<link rel="stylesheet" href="css/style.css">
<style>
input{color:#000}
</style>
</head>
<!--https://www.paypal.com/cgi-bin/webscr-->
<body>
<div class="mui-content">
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="paypal收款账号">
<input type="hidden" name="lc" value="TW">
<input type="hidden" id="item_name" name="item_name" value="">
<input type="hidden" id="item_number" name="item_number" value="">
<input type="hidden" id="amount" name="amount" value="">
<input type="hidden" name="currency_code" value="HKD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" id="shipping" name="shipping" value="">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_SM.gif:NonHostedGuest">
<input type="hidden" name="notify_url" value="回调地址">
<input type="hidden" name="return" value="这个参数忘了是干嘛的了...,源码那我填的是本地的产品页面">
<input type="image" src="https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="PayPal - 更安全、更簡單的線上付款方式!">
<img alt="" border="0" src="https://www.paypalobjects.com/zh_TW/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</body>
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
<script>
mui.init({
swipeBack: true, //启用右滑关闭功能
})
(function($, doc) {
mui.plusReady(function() {
plus.nativeUI.closeWaiting();
var self = plus.webview.currentWebview();
var order = self.order;
//console.log(JSON.stringify(order));
document.getElementById("item_name").value=order.order_sn;
document.getElementById("item_number").value=order.order_sn;
document.getElementById("amount").value=order.total_amount;
document.getElementById("shipping").value=order.shipping_price;
app.setLocal('cart',{});
});
}(mui, document));
</script>
</html>
0 个评论
要回复文章请先登录或注册