問題描述
我正在制作一款網(wǎng)絡(luò)應(yīng)用.我已經(jīng)使用簡單的表單提交到 Paypal 站點將 Paypal 集成到其中.一切正常.但是每當(dāng)付款成功時,它應(yīng)該使用 Paypal 的響應(yīng)重定向回我的原始站點.但是,它沒有按應(yīng)有的方式工作.目前它僅保留在 Paypal 網(wǎng)站上.
I'm making one web app. I've integrated Paypal in it using simple form submission to the Paypal site. Everything works well. but whenever the payment gets successful it should redirect back to my original site with the response from Paypal. However, it's not working as it should be. Currently it stays on the Paypal site only.
<form action='https://www.sandbox.paypal.com/cgi-bin/webscr' method='post' name='form'>
<input type='hidden' name='business' value='<?php echo $paypal_id; ?>'>
<input type='hidden' name='cmd' value='_xclick'>
<input type='hidden' name='item_name' id='item_name' value=''>
<input type='hidden' name='item_number' id='item_number' value=''>
<input type='hidden' name='amount' id='amount' value=''>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='currency_code' value='USD'>
<input type='hidden' name='cancel_return' value='http://yoursite.com/cancel.php'>
<input type='hidden' name='return' value='http://mysite.com/user_credits/purchase_credits'>
<input type="image" src="https://paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit">
我錯過了什么?我使用的是 CakePHP 2.0.
what am I missing in it? I'm using CakePHP 2.0.
推薦答案
您必須在 paypal 中啟用自動返回功能設(shè)置.
You have to enable auto return functionality setting in paypal .
只需按照以下步驟啟用
- 登錄并單擊我的帳戶"下的個人資料"子選項卡.
- 點擊銷售偏好"下的網(wǎng)站支付偏好"鏈接.
- 點擊開啟單選按鈕以啟用自動返回.
- 輸入返回 URL.注意:您必須滿足返回 URL 要求才能設(shè)置自動返回.詳細(xì)了解返回網(wǎng)址.
對于沙盒帳戶,請執(zhí)行以下操作
For sandbox account do the following
- 登錄 Sandbox Merchant Id,然后點擊我的帳戶下的個人資料子選項卡.
- 點擊個人資料"下的更多選項"鏈接.
- 查看第三行的銷售偏好.
- 點擊銷售偏好"下的網(wǎng)站支付偏好"鏈接
- 點擊開啟單選按鈕以啟用自動返回.
- 點擊開啟單選按鈕以啟用自動返回.
- 輸入返回 URL.注意:您必須滿足返回 URL 要求才能設(shè)置自動返回.詳細(xì)了解返回網(wǎng)址.
這篇關(guān)于在Paypal中完成購買后重定向到原始站點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!