2014-09-06 69 views
0

我正在開發這個使用ASP.NET,我已經使用了Stripe.NET dll,根據我已經鏈接了我的店主條紋賬戶和獲得訪問代碼的文檔。使用Stripe Connect代表店主收取客戶費用?

現在我對我的顧客感到困惑,他應該作爲顧客添加到店主的條紋賬戶中,或者只是他的賬戶與Shopkeepers的條紋賬戶相關聯。

任何人都可以請解釋一下,它將如何工作?

var stripeService = new StripeChargeService(sellerStore.StripeMerchantAccessToken); //The token returned from the above method 
var stripeChargeOption = new StripeChargeCreateOptions() { 
AmountInCents = amountInCents, 
Currency = "usd", 
CustomerId = buyerPaymentInfo.StripeCustomerToken, 
Description = "Locabal", 
ApplicationFeeInCents = locabalsCut 
}; 
var response = stripeService.Create(stripeChargeOption); 

buyerPaymentInfo.StripeCustomerToken將會是訪問代碼還是客戶在供應商帳戶中註冊?

我想用他的信用卡收費客戶

您的幫助將不勝感激。

回答

0

根據我對Stripe API的理解,您應該在您的賬戶中創建一個客戶,並使用以客戶ID「cus_」開頭的客戶ID。

如果你看看下面的stripe.net討論,你會看到如何創建一個客戶,並使用它在你的收費。

https://github.com/jaymedavis/stripe.net/pull/43#issuecomment-30345043

//This is what we do to create a long-term customer in our system 
//user is a user object unique to our system. We save it in our database 
//stripeToken is what is generated by the Javascript on the page 
var stripeService = new stripeCustomerService(ConfigurationManager.AppSettings["StripeSecret"]); 
var stripeTokenOptions = new StripeCustomerCreateOptions { TokenId = stripeToken }; 
var response = stripeService.Create(stripeTokenOptions); 

if (user.PaymentInfo == null) 
{ 
    PaymentInfo paymentInfo = new PaymentInfo 
    { 
     StripeCustomerToken = response.Id 
    }; 
    user.PaymentInfo = paymentInfo; 
} 
else 
{ 
    user.PaymentInfo.StripeCustomerToken = response.Id; 
} 
相關問題