我有條紋效果很好。在客戶捐贈後,會創建一個新的訂閱,並且效果非常好 - 除非Stripe識別該電子郵件並說「輸入驗證碼」。條紋簽出 - 帶有識別條紋用戶的訂購問題
如果客戶這樣做,出於某種原因,不會創建新的訂閱,並且客戶不收費。
這是我充monthly.php
<?php
require_once('init.php');
// Set your secret key: remember to change this to your live secret key in production
// See your keys here https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_**************");
// Get the credit card details submitted by the form
$token = $_POST['stripeToken'];
$email = $_POST['stripeEmail'];
$amount = $_POST['amount'];
$finalamount = $amount * 100;
$dollars = ".00";
$plan = "/month";
$dash = " - ";
$monthlyplan = $amount .$dollars .$plan .$dash .$email;
//Create monthly plan
$plan = \Stripe\Plan::create(array(
"name" => $monthlyplan,
"id" => $monthlyplan,
"interval" => "month",
"currency" => "usd",
"amount" => $finalamount,
));
// Create a Customer
$customer = \Stripe\Customer::create(array(
"source" => $token,
"description" => "MONTHLY DONATION",
"plan" => $monthlyplan,
"email" => $email,)
);
?>
任何想法,爲什麼當條紋識別用戶和他的「登錄」這並不讓我創建預訂?
在條紋的日誌,我收到此400錯誤:
{
"error": {
"type": "invalid_request_error",
"message": "Plan already exists."
}
}
但絕對不是創造了一個計劃......啊!
我不確定發生了什麼!你說過你在創建Subscription時遇到了問題。但提供的代碼是用於創建計劃和客戶。並且錯誤消息表示「計劃已經存在」,儘管計劃的ID與現有計劃按照消息匹配! – Zico