问题描述
我正在从事嵌入式自适应预批准付款,现在我面临的问题是如何使用灯箱实施预批准付款.
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>
推荐答案
由于PayPal正在停用DG产品,dg.js
已过时,您应改为添加"apdg.js",然后将操作网址从到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预先付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!