Как внедрить stripe gateway в C# и как получить ответ обратно после успешного или ожидающего платежа ?
How to inplement Stripe Gateway in c# and how to get response back after payment successfull or pending ?
Что я уже пробовал:
if (Request.Form["stripeToken"] != null) { try { var customers = new StripeCustomerService(); var customer = customers.Create(new StripeCustomerCreateOptions { Email = Request.Form["stripeEmail"], SourceToken = Request.Form["stripeToken"] }); var charge = new StripeChargeCreateOptions() { Amount =100, Description = "Sample Charge", Currency = "usd", CustomerId = customer.Id }; var chargeService = new StripeChargeService(); StripeCharge StripeCharge = chargeService.Create(charge); //check msg after payment lbl_status.Text = StripeCharge.Outcome.SellerMessage + "<br>" + Convert.ToInt32(StripeCharge.Amount) + "<br>" + Convert.ToInt32(StripeCharge.AmountRefunded) + "<br>" + StripeCharge.Application + "<br>" + StripeCharge.Destination + "<br>" + StripeCharge.Status + "<br>" + StripeCharge.StripeResponse; } catch (StripeException ex) { switch (ex.StripeError.ErrorType) { case "card_error": Console.WriteLine(" Code: " + ex.StripeError.Code); Console.WriteLine("Message: " + ex.StripeError.Message); break; case "api_connection_error": break; case "api_error": break; case "authentication_error": break; case "invalid_request_error": break; case "rate_limit_error": break; case "validation_error": break; default: // Unknown Error Type break; }