I have implemented payment in my back-end using Stripe.net, Now I have a mobile client writen in Xamarin Which I want to approve credit card payments with. But All of the examples I find online use the Charge API. I use the PaymentIntentAPI in my back-end and this returns a client secret as requested.
My question is: How do I confirm the payment using the Stripe.net package and the PaymentIntent API ?
Here is how it is done on android with java:
stripe = new Stripe(
context,
PaymentConfiguration.getInstance(context).getPublishableKey()
);
stripe.confirmPayment(this, confirmParams);
Using the old charges API in dotnet, here is how it is done:
StripeConfiguration.SetApiKey("pk_test_xxxxxxxxxxxxxxxxx");
var tokenOptions = new StripeTokenCreateOptions()
{
Card = new StripeCreditCardOptions()
{
Number = cardNumber,
ExpirationYear = cardExpYear,
ExpirationMonth = cardExpMonth,
Cvc = cardCVC
}
};
var tokenService = new StripeTokenService();
StripeToken stripeToken = tokenService.Create(tokenOptions);