使用嵌入式灯箱进行 Paypal 预批付款 [英] Paypal preapproval payment using embeded Light box
问题描述
我现在从事嵌入式自适应预批付款,我面临的问题是如何使用灯箱实现预批付款.
I am working in embedded adaptive preapproval payment now the issue I am facing is how to implement preapproval payment using light box.
我已经通过使用灯箱设置paykey来实现支付操作,它的工作良好,但同样的事情我在代码中几乎没有修改预批准请求是灯箱挂断了.请让我知道我在这里缺少什么.
I have implemented pay action by setting paykey using light box its working good, but same the thing I have followed with little modification in code for preapproval request was not working light box get hangs up. kindly let me know what I am missing here.
HTML 代码:
<html>
<head>
<script src="https://www.paypalobjects.com/js/external/dg.js" type="text/javascript"></script>
</head>
<body>
<form action="https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/preapprovalkey" target="PPDGFrame" class="standard">
<label for="buy">Buy Now:</label>
<input type="image" id="submitBtn" value="Pay with PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif">
<input id="type" type="hidden" name="expType" value="light">
<input id="preapprovalkey" type="hidden" name="preapprovalkey" value="{{preapprovalkey}}">
</form>
<script type="text/javascript" charset="utf-8">
var dgFlow = new PAYPAL.apps.DGFlow({ trigger: 'submitBtn' });
</script>
</body>
</html>
推荐答案
dg.js
已过时,因为 PayPal 正在淘汰 DG 产品,您可以改为包含apdg.js",并且将操作 URL 从 pay
更改为 preapproval
The dg.js
is outdated as PayPal is sunsetting the DG product, you would include the 'apdg.js' instead, and change the action URL from pay
to preapproval
<html>
<head>
<title>AP Redirection Demo</title>
<script src="https://www.paypalobjects.com/js/external/apdg.js" type="text/javascript"></script>
</head>
<body>
<form action="https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/preapproval" target="PPDGFrame" class="standard">
<label for="buy">Pay Now:</label>
<input type="image" id="submitBtn" value="Pay with PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif">
<input id="type" type="hidden" name="expType" value="light">
<input id="preapprovalkey" type="input" name="preapprovalkey" value="insert_preapproval_key">
</form>
<script type="text/javascript" charset="utf-8">
var dgFlowMini = new PAYPAL.apps.DGFlowMini({
trigger: 'submitBtn'
});
</script>
</body>
</html>
这篇关于使用嵌入式灯箱进行 Paypal 预批付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!