2021-06-21

paypal支付,paypal js支付,paypal jq支付,paypal 沙盒支付,paypal支付简单案例demo

<!DOCTYPE html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <script
    src="https://www.paypal.com/sdk/js?client-id=你的client-id">
  </script>
</head>
<body>
	<div id="paypal-button-container"></div>
	<script>
		paypal.Buttons({
		createOrder: function(data, actions) {
		  return actions.order.create({
			purchase_units: [{
			  amount: {
				value: '0.01'
			  }
			}]
		  });
		},
		onApprove: function(data, actions) {
		  return actions.order.capture().then(function(details) {
			alert('Transaction completed by ' + details.payer.name.given_name);
		  });
		}
	  }).render('#paypal-button-container');
</script>
</body>

client-id获取:
https://developer.paypal.com/developer/applications/
在这里插入图片描述
在这里插入图片描述
https://developer.paypal.com/developer/accounts/(没有账号先注册,这里是生产环境账户,下图是生产环境下账户下的三个测试i账户)
在这里插入图片描述
这个链接查看支付结果
https://www.sandbox.paypal.com/mep/dashboard

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

「已注销」

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值