亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

創建連接和客戶用戶 - 借記卡并將錢轉入銀行賬戶

創建連接和客戶用戶 - 借記卡并將錢轉入銀行賬戶

慕萊塢森 2023-03-22 16:26:17
我在 Stripe 中有兩種類型的用戶:最終客戶(支付和接收產品/服務);連接用戶(將擁有連接帳戶并將提供產品/服務);讓我們假設在下面的例子中用戶是一個模型實例(Django):# Connect Accountinstance = stripe.Account.create(    type="custom",    country="PL",    email=user.email,    default_currency="pln",    business_type="individual",    requested_capabilities=["card_payments", "transfers",],    individual={        "first_name": user.first_name.strip(),        "last_name": user.last_name.strip(),        "email": user.email,        "dob": {            "day": user.profile.date_of_birth.day,            "month": user.profile.date_of_birth.month,            "year": user.profile.date_of_birth.year,        },        "phone": user.profile.phone_number,        "address": {            "city": user.city.strip(),            "postal_code": user.profile.postal_code.strip(),            "country": "PL",            "line1": user.profile.address.strip(),        },    },)# Customer Accountinstance = stripe.Customer.create(    email=user.email,    description="desc",    name=user.get_full_name.strip(),    phone=user.profile.phone_number.strip(),)這兩個 API 調用正常工作。然后我能夠為新用戶檢索唯一的Stripe ID :stripe_customer_id = instance.get("id")對于stripe.Account類型,我需要提供身份驗證:身份證正反面(作為示例):document_images_data = [   "data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",   "data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",]_front = stripe.File.create(    purpose="identity_document",    file=Base64ImageField().to_internal_value(base64_data=document_images_data[0]),    stripe_account=stripe_customer_id,)_back = stripe.File.create(    purpose="identity_document",    file=Base64ImageField().to_internal_value(base64_data=document_images_data[1]),    stripe_account=stripe_customer_id,)
查看完整描述

1 回答

?
慕少森

TA貢獻2019條經驗 獲得超9個贊

當您處理針對客戶 ( ) 的付款時stripe.Charge.create,這會將資金添加到您的平臺帳戶的余額中。資金最初有pending一段時間(https://stripe.com/docs/payouts#standard-payout-timing)。

調用 /v1/transfers ( stripe.Transfers.create) 嘗試從您的余額中提取資金available并將其轉移到目標 Stripe 帳戶。如果你沒有available余額,它就會失敗,這里很可能就是這種情況。

如果您的平臺采用每日自動支付(默認設置),您實際上永遠不會有available余額。那是因為 Stripe 會將資金直接從您的pending余額轉移到您的支出中,這樣您就可以盡快拿到這筆錢,這是大多數賬戶想要的(作為具有這種資金流的 Connect 平臺,您更先進一些)。

如果您想進行這種轉移,我建議您按順序執行以下操作:

  • 如果客戶付款與關聯賬戶付款之間的“延遲”(例如,提供服務需要多長時間)少于 7 天,您可以只使用目的地費用(https:// stripe .com/docs/connect/destination-charges)與 auth-and-capture(https://stripe.com/docs/payments/capture-later)。與單獨收費和轉賬相比,工作量要少得多,而且您不必考慮太多余額。

  • 否則,您將需要:

    • source_transaction調用時使用stripe.Transfer.create: https: //stripe.com/docs/connect/charges-transfers#transfer-availability。這樣一來,轉賬就可以立即成功,收到費用中的資金將在可用時轉移到關聯賬戶。

    • 或者,將您的平臺設置為手動支付: https://dashboard.stripe.com/settings/payouts 隨著時間的推移,您將從available您的支付中積累余額。然后,您可以直接從該余額進行轉賬,就像您在問題中分享的 API 調用一樣。在測試模式下,您可以使用特殊的測試卡來模擬余額,available而無需等待幾天。

為什么我在嘗試 Stripe Transfers 時出現“資金不足”,即使我在我的賬戶中添加了 TEST 模式資金?

最重要的問題是——這是一種正確的方法還是應該以不同的方式處理整個過程?

這種模型(有一個市場,平臺的每個用戶都有一個 Stripe 客戶和一個與之相關聯的 Stripe 帳戶,您將它們綁定在一起)很正常,但構建起來很棘手。同樣,您實際上只是在構建標準的“單獨收費和轉賬”集成:https://stripe.com/docs/connect/charges#separate-charges-transfers但您正在構建 Stripe 上最復雜的東西之一(Custom Connect + 單獨收費和轉賬)所以這是一項艱巨的任務。

我會嘗試通過使用目的地費用來盡可能簡化它,除非你絕對不能,并使用 Express 或 Stripe 的自定義帳戶托管入職(https://stripe.com/docs/connect/connect-onboarding)除非你真的需要白標這個。

此外,您應該使用 PaymentIntents( https://stripe.com/docs/payments/accept-a-payment ) 作為支付部分,而不是Charge.createTokens,因為它們不支持在歐洲很重要的 3D Secure,但是僅使用它們來測試事物的連接方面也許沒問題。


查看完整回答
反對 回復 2023-03-22
  • 1 回答
  • 0 關注
  • 122 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號