2016-04-25 4 views
0

私はgithub jaymedavis/stripe.netコード(https://github.com/jaymedavis/stripe.net#charges)を使用してオンラインネットバンキングを実装するWCFサービスを実装しています。 ここに私の顧客、銀行口座を確認し、料金を作成するための銀行口座と銀行口座サービスを作成するためのコードです。jaymedavis/stripe.netコードの銀行口座 "照合"機能の "不明なパラメータを受け取った:金額"を取得していますか?

コード:このコードで

//1. Create Customer 
var myCustomer = new StripeCustomerCreateOptions(); 
myCustomer.Email = "[email protected]"; 
myCustomer.Description = "Johnny Tenderloin ([email protected])"; 

//myCustomer.SourceToken = *token*; 
//myCustomer.PlanId = *planId*;       // only if you have a plan 
//myCustomer.TaxPercent = 20;       // only if you are passing a plan, this tax percent will be added to the price. 
//myCustomer.Coupon = *couponId*;      // only if you have a coupon 
//myCustomer.TrialEnd = DateTime.UtcNow.AddMonths(1); // when the customers trial ends (overrides the plan if applicable) 
//myCustomer.Quantity = 1;        // optional, defaults to 1 

//2. Create Customer Service 
var customerService = new StripeCustomerService(StripeApiKey); 
StripeCustomer stripeCustomer = customerService.Create(myCustomer); 

//3. Create bankAccount 
var myBankAccount = new BankAccountCreateOptions 
{ 
    SourceBankAccount = new SourceBankAccount() 
    { 
     AccountNumber = "00", //, 
     Country = "US", 
     Currency = "usd", 
     AccountHolderName = "Frank", //"Johnny Tenderloin", 
     AccountHolderType = BankAccountHolderType.Individual, 
     RoutingNumber = "110000000", //"021000021", 
     Metadata = new Dictionary<string, string> 
     { 
      { "Name", "Ray Barone" }, 
      { "OftenSays", "Thatttttt's right" } 
     } 
    } 
}; 

//4. Create bankAccount Service 
var bankAccountService = new BankAccountService(StripeApiKey);   
CustomerBankAccount bankAccount = bankAccountService.Create(stripeCustomer.Id, myBankAccount); 
BankAccountVerifyOptions bankAccountVerifyOpt = new BankAccountVerifyOptions(); 
bankAccountVerifyOpt.AmountOne = 32; 
bankAccountVerifyOpt.AmountTwo = 45; 
// 

//5. Verify bankAccount or service 
bankAccount = bankAccountService.Verify(stripeCustomer.Id, bankAccount.Id, bankAccountVerifyOpt); 


//6. Create Charge 
var myChargeBank = new StripeChargeCreateOptions(); 
// amount = Returnamount.amount; 

myChargeBank.Amount = int.Parse("250") * 100; 
myChargeBank.Currency = "usd"; 
myChargeBank.CustomerId = stripeCustomer.Id; 
myChargeBank.Capture = true; 

StripeCharge stripeCharge = null; 
stripeCharge = new StripeCharge(); 
var chargeService = new StripeChargeService(StripeApiKey); 
stripeCharge = chargeService.Create(myChargeBank); 


if (stripeCharge.Status.ToLower() == "succeeded" & stripeCharge.Paid == true) { 

} else { 

} 

、私は取得しています: Stripe Exception for Verify method (bankAccountService.Verify(stripeCustomer.Id, bankAccount.Id, bankAccountVerifyOpt);)

例外がReceived unknown parameter: amountsです。

https://github.com/jaymedavis/stripe.net#charges」に「銀行口座の確認」の実装がありません。この問題を解決して銀行口座が正常に認証されるように助けてください。

答えて

0

私は同じ問題を持っていたと私は2つのことでした:

1)stripe.com上に、私は自分のアカウントのAPI設定に行き、続いたAPIを使用するためにそれらを更新しました。

2)そのすべてが完全に働いた後、私はStripe.net Nugetパッケージに

を更新しました。

関連する問題