【发布时间】:2014-04-05 07:20:28
【问题描述】:
我正在开发 Stripe 支付网关。
这是我的代码:
$token = $_POST['stripeToken'];
// Create the charge on Stripe's servers - this will charge the user's card
try {
$charge = Stripe_Charge::create(array(
"amount" => 700, // amount in cents, again
"currency" => "SEK",
"card" => $token,
"description" => "payinguser@example.com")
);
echo "<center><font color='green'>Payment Successfull!</font></center>";
} catch(Stripe_CardError $e) {
// The card has been declined
}
我正确获得了 stripeToken,并且还可以收取 1 美元,其中 7 瑞典克朗 = 1 美元 但实际上,我想立即向用户收取 7 SEK,然后在 5 天后每月收取 399。
我做了一些研究,发现 webhook 可以帮助我,但我对条带非常陌生,对 web hooks 不太了解。 如果有人能帮我解决我的上述情况,那就太好了!
【问题讨论】:
标签: stripe-payments