1
我們已經使用PHP支付條形支付。它在本地機器上工作,但在實時服務器中,它不像預期的那樣工作。我們分享了我們使用的代碼,並附上錯誤的屏幕截圖。不知道我們犯了什麼錯誤,你能指導我們嗎?條紋支付SSL協議錯誤WordPress
條紋代碼:
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' => '[email protected]',
'source' => $token
));
$charge = Stripe_Charge::create(array(
'customer' => $customer->id,
'amount' => 5000,
'currency' => 'usd'
));
echo '<h1>Successfully charged $50.00!</h1>';
}
本地計算機
Live服務器