【发布时间】:2017-04-29 23:52:42
【问题描述】:
我们使用 PHP 进行了条带支付。它在本地机器上工作,但在实时服务器上,它没有按预期工作。我们分享了我们使用的代码,并附上了错误的屏幕截图。不知道哪里出错了,能指导一下吗?
条码:
require_once('Stripe.php');
Stripe::setApiKey('secret key');
echo '<form action="" method="post">
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="publish key"
data-description="Access for a year"
data-amount="5000"
data-locale="auto"></script>
</form>';
if($_POST) {
$token = $_POST['stripeToken'];
$customer = Stripe_Customer::create(array(
'email' => 'customer@example.com',
'source' => $token
));
$charge = Stripe_Charge::create(array(
'customer' => $customer->id,
'amount' => 5000,
'currency' => 'usd'
));
echo '<h1>Successfully charged $50.00!</h1>';
}
本地机器
实时服务器
【问题讨论】:
标签: wordpress ssl ssl-certificate stripe-payments stripe-connect