2016-04-25 23 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

我有同樣的問題,我做了兩兩件事:

1)在stripe.com,我去了我的帳戶API設置和更新,他們使用的持續API。

2)我

更新Stripe.net NuGet包之後,一切都完美。