我正在嘗試創建從我的客戶到其中一個連接帳戶的目的地費用。\Stripe\Stripe::setApiKey(STRIPE_SECRET_KEY); //Origin Stripe Secret Key try { $connectd_account_id = 'acct_XXXXXXX'; $customer_id = 'cus_XXXXXXX' // sharing my customer with connected account and creating a token. $token = \Stripe\Token::create( ["customer" => $customer_id], //doctor stripe customer id ["stripe_account" => $connectd_account_id]); //Lab Stripe Account // I am receiving response ** No such token: tok_xxxxxxx ** $charge = \Stripe\Charge::create(array( "amount" => 10000, "currency" => 'USD', "source" => $token->id, "application_fee_amount" => 2000, "transfer_data" => [ "destination" => $connectd_account_id, ], ) ); } catch (Exception $e) { $error = $e->getMessage(); }每次我收到 沒有這樣的令牌:tok_xxxxxxx 我在這里找不到什么錯誤。請幫忙。
1 回答

白衣染霜花
TA貢獻1796條經驗 獲得超10個贊
如果您正在創建目的地費用,則應在您的平臺帳戶上創建卡令牌和客戶及相關對象。您的平臺賬戶是與持卡人交互并處理付款的平臺賬戶,然后在 Stripe 內將資金轉移到目標賬戶。
您的代碼似乎試圖將保存的卡詳細信息從您的平臺復制到目標帳戶,這不是您對目標費用所做的(只有在您使用直接費用時,您才會這樣做,付款在關聯帳戶,因此需要在那里復制付款信息)。
簡而言之,您應該省略創建令牌的代碼,而是在創建收費時,傳遞類似"source" => $customer_id,
在您的平臺上向客戶詳細信息收費的內容。
- 1 回答
- 0 關注
- 114 瀏覽
添加回答
舉報
0/150
提交
取消