Widget | Mechanism | Support |
StripeGatewayWeb | Webview | ios, android, web |
StripeGatewayNative | Native | ios, android |
StripeGatewayKlarna | Native | ios, android |
Stripe
Klarna
Getting started
– Create an Stripe account to use Stripe’s services: https://stripe.com/docs
Usage
Follow this steps:
Woocommerce website:
Add Stripe plugin to your Woocommerce:
- Go to WordPress Admin > Plugins > Add New from the left-hand menu
- In the search box type WooCommerce Stripe Payment Gateway
- Click on Install now when you see WooCommerce Stripe Payment Gateway to install the plugin
- Config plugin according instructions
- Go to Woocommerce -> Setting -> Tab Payments:
- enable Stripe => Manage => Payment Methods => Select Credit card / debit card or Klarna
Plugin guide: https://wordpress.org/plugins/woocommerce-gateway-stripe/#installation
Mobile app:
- Copy stripe_gateway package and add to packages folder in cirilla project.
- Import package in
cirilla/pubspec.yaml
- Android Native
- This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:
- Use Android 5.0 (API level 21) and above
- Use compileSdkVersion 34: example
- Use targetSdkVersion 34: example
- Use Kotlin version 1.8.10 and above: example
- Using a descendant of
Theme.AppCompat
for your activity: example, example night theme - Using
FlutterFragmentActivity
instead ofFlutterActivity
inMainActivity.kt
: example - Add the following rules to your
proguard-rules.pro
file: example - Note:
- Change:
id "com.android.application" version "8.3.1" apply false
- To:
id "com.android.application" version "7.3.0" apply false
insettings.gradle
- Change:
- iOS Native
- Compatible with apps targeting iOS 13 or above.
- To upgrade your iOS deployment target to 13.0, you can either do so in Xcode under your Build Settings, or by modifying IPHONEOS_DEPLOYMENT_TARGET in your project.pbxproj directly.
- You will also need to update in your Podfile:
platform :ios, '13.0'
Example:
stripe_gateway:
path: ./packages/stripe_gateway
Then run flutter pub get in your project
- Add StripeGatewayWeb(web view) to
cirilla
/lib/payment_method.dart file (remember import package like example)
Example:
import 'package:stripe_gateway/stripe_gateway_web.dart';
final Map<String, PaymentBase> methods = {
StripeGatewayWeb.key: StripeGatewayWeb(),
};
Or
import 'package:stripe_gateway/stripe_gateway_native.dart';
final Map<String, PaymentBase> methods = {
StripeGatewayNative.key: StripeGatewayNative(),
};
Klarna
Note: klarna will only enable customers in Europe, Canada, Australia, New Zealand, the UK, and the US to pay now, later, or in installments, depending on the country.
Get publishableKey
Supported currencies: AUD, CAD, CHF, CZK, EUR, GBP, DKK, NOK, NZD, PLN, SEK, USD
import 'package:stripe_gateway/stripe_gateway_klarna.dart';
final Map<String, PaymentBase> methods = {
StripeGatewayKlarna.key: StripeGatewayKlarna(
publishableKey: "xxxxxxxxxxxxxxxxxxxx",
),
};