createPaymentMethod method
Use stripe.createPaymentMethod to convert payment information collected by elements into a PaymentMethod object that you safely pass to your server to use in an API call.
NOTE: In most integrations, you will not need to use this method. Instead, use methods like stripe.confirmCardPayment, which will automatically create a PaymentMethod when you confirm a PaymentIntent..
https://stripe.com/docs/js/payment_methods/create_payment_method
Implementation
Future<PaymentMethodResponse> createPaymentMethod(
CreatePaymentMethodData data) {
final jsData = jsify(data.toJson());
return parsePaymentMethodResponse(
js.createPaymentMethod(jsData),
);
}