I managed to use a version of the Strip.net dll to create a payment method but im having issues dealing with errors. I got as far as this.
try
{
StripeCustomer current = GetCustomer();
// int? days = getaTraildays();
//if (days != null)
//{
int chargetotal = 300; //Convert.ToInt32((3.33*Convert.ToInt32(days)*100));
var mycharge = new StripeChargeCreateOptions();
mycharge.AmountInCents = chargetotal;
mycharge.Currency = "USD";
mycharge.CustomerId = current.Id;
string key = "sk_test_XXX";
var chargeservice = new StripeChargeService(key);
StripeCharge currentcharge = chargeservice.Create(mycharge);
//}
}
catch (StripeException)
{
lblerror.Text = "Please check your card information and try again";
}
it will catch the errors and let the user know that there was an issue but im to new at this to understand why it still displays the error if the process works. i know its an issues with the way the catch is written but im unsure as to how to process and everything i have tried so hard has failed. what i would like to do is have it redirect to another page. Any ideas
++Update
with some help from Olivier Jacot-Descombes i changed my code to
catch (StripeException ex)
{
lblerror.Text = (ex.Message);
}
and was able to get even better results