【发布时间】:2014-04-18 16:40:25
【问题描述】:
我希望摆脱 PayPal IPN,转向 Stripe。
脚本的重点是每次我收到超过一定金额的付款时都会向客户发送一封电子邮件。
到目前为止我写的代码是。由于某种原因,它不起作用。
Stripe::setApiKey("XXX");
// Retrieve the request's body and parse it as JSON
$body = @file_get_contents('php://input');
$event_json = json_decode($body);
}
mail "expresspoints@outlook.com";
$to = $customer->email;
if (($event_json->type == 'charge.succeeded') and ($event_json->livemode == 'true') and
($event_json->amount>4))
{
所以脚本的重点是,所有在实时模式下完成且大于 4 的成功付款都会收到一封电子邮件。脚本的其余部分只是一封普通的电子邮件。
我认为有一个错误:
}
mail "expresspoints@outlook.com";
$to = $customer->email;
if (($event_json->type == 'charge.succeeded') and ($event_json->livemode == 'true') and ($event_json->amount>4))
{
【问题讨论】:
-
你的脚本有问题吗?有用吗?
-
将其添加到问题中。
标签: php paypal paypal-ipn stripe-payments webhooks