ezet / stripe-sdk

A simple and flexible Stripe library for Flutter with complete support for SCA and PSD2.
https://pub.dev/packages/stripe_sdk
Other
137 stars 137 forks source link

Payment with card #168

Open TetrixGauss opened 1 year ago

TetrixGauss commented 1 year ago

How can i create and send a payment with card through the package?

preteambuy commented 1 year ago

@TetrixGauss did u figure it out?

preteambuy commented 1 year ago

@ezet can you hellp with a sample that shows how to tokenize the card? I was using the previous versions of the SDK and was using card.

Cilestal commented 1 year ago

@preteambuy

  1. Create a map with credit card properties
    Map<String, dynamic> toPaymentMethod() {
    return {
      "type": "card",
      "card[number]": number,
      "card[exp_month]": expMonth,
      "card[exp_year]": expYear,
      "card[cvc]": cvc,
    };
    }
  2. Create payment method final method = await StripeApi.instance.createPaymentMethod(card.toPaymentMethod());
ezet commented 1 year ago

I would not recommend collecting card details or adding payment methods using this library anymore, as you will be required to fill in the SAC D form for PCI compliance, which is the strictest and most demanding requirements. I recommend using https://pub.dev/packages/flutter_stripe to add/manage/tokenize card details, and then you can use this library to build the rest of the payment flow.

preteambuy commented 1 year ago

I would not recommend collecting card details or adding payment methods using this library anymore, as you will be required to fill in the SAC D form for PCI compliance, which is the strictest and most demanding requirements. I recommend using https://pub.dev/packages/flutter_stripe to add/manage/tokenize card details, and then you can use this library to build the rest of the payment flow.

Thanks @ezet