我正在尝试使用 paypal 沙盒创建一个 paypal 订阅按钮。我已经创建了开发帐户,创建了沙盒业务和测试帐户。登录到我的商业测试帐户,转到商家服务 -> 我保存的按钮。
找到订阅按钮并复制代码。
我已将表格上传到我的 codeigniter Controller :http://422clients.com/ftg/paypal/test
我正在为 codeigniter 使用这个 paypal IPN 库:https://github.com/orderly/codeigniter-paypal-ipn
我现在使用未修改的 Controller 代码来处理 IPN 响应,因为它会将它写入数据库以供测试:
function ipn()
{
$this->load->library('PayPal_IPN'); // Load the library
// Try to get the IPN data.
if ($this->paypal_ipn->validateIPN())
{
// Succeeded, now let's extract the order
$this->paypal_ipn->extractOrder();
// And we save the order now (persist and extract are separate because you might only want to persist the order in certain circumstances).
$this->paypal_ipn->saveOrder();
// Now let's check what the payment status is and act accordingly
if ($this->paypal_ipn->orderStatus == PayPal_IPN::PAID)
{
//Enable database subscription...
}
}
else // Just redirect to the root URL
{
$this->load->helper('url');
redirect('/', 'refresh');
}
}
我的问题是,当我单击网站上的按钮并使用我的沙盒测试帐户付款时,一切看起来都很好并且付款成功,但是当我查看我的数据库时,它显示:状态:错误。
原因字段说:电子邮件 business_test@422studios.com 与卖家不匹配
business_test@422studios.com 是我从中生成按钮的沙盒帐户。
我完全迷失在这里。感谢您的帮助。
最佳答案
在你的配置文件中,确保你有这个:
$config['paypal_ipn_sandbox_settings'] = array(
'email' => 'business_test@422studios.com',
'url' => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
'debug' => TRUE
);
并且您在表单中传递此值:
<input type="hidden" name="business" value="business_test@422studios.com">
关于php - Paypal 沙盒 IPN "Email does not match seller",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20406844/