2016-04-25 8 views
0

Ich implementiere den WCF-Service zur Implementierung von Online-Banking mit github jaymedavis/stripe.net-Code (https://github.com/jaymedavis/stripe.net#charges). hier ist mein Code für die Erstellung von Kunden, Bankkonto und Bankkontodienst für die Überprüfung des Bankkontos und Erstellen von Gebühren.Erhalten "Unbekannter Parameter erhalten: Beträge" für Bankkonto "Verify" -Funktion für Jaymedavis/Stripe.net-Code.?

Code:

//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 { 

} 

In diesem Code, erhalte ich: Stripe Exception for Verify method (bankAccountService.Verify(stripeCustomer.Id, bankAccount.Id, bankAccountVerifyOpt);)

Ausnahme ist Received unknown parameter: amounts.

auf "https://github.com/jaymedavis/stripe.net#charges" Implementierung für "Verify a bank account" fehlt so Bitte helfen Sie mir, dieses Problem zu lösen, so dass Bankkonto erfolgreich überprüft werden.

Antwort

0

ich hatte das gleiche Problem, und ich habe 2 Dinge:

1) Am stripe.com, ging ich auf mein Konto API-Einstellungen und aktualisiert sie das dauerte API zu verwenden.

2) Ich aktualisiert, um die Stripe.net Nuget Paket

Danach alles perfekt funktioniert.