2017-08-29 172 views
0

我正在使用Stripe構建一個相對簡單的基於訂閱的應用程序。帶初始安裝費的條紋訂閱

我現在唯一真正的掛斷是訂閱需要一個初始設置費,我真的很難與它。

示例:
新用戶爲Subscription-A註冊; Subscription-A的每月間隔價格爲10美元。註冊後,新用戶收取1美元和10美元的一次性費用,然後接下來的幾個月只收取10美元。

目前我的代碼是:

// Stripe New customer 
    $customer = \Stripe\Customer::create(array(
    "email" => $customer_email, 
    "source" => $token, 
), 
    array("stripe_account" => $connected_account) 
); 

// Stripe Subscription 
    $sub = \Stripe\Subscription::create(array(
    "customer" => $customer['id'], 
    "items" => array(
     array(
     "plan" => $plan_id, 
    ), 
    ), 
), 
    array("stripe_account" => $connected_account) 
); 

任何想法? thx

+0

您使用的是什麼版本的條帶?我不認識'array(「stripe_account」=> $ connected_account)'參數 –

+0

@Wee最後一個分支版本 – Rubyx

回答