パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.4.4

flutter_checkout_payment

このプラグインは、オンライン決済のチェックアウト用です。Flutter環境で動作するようにネイティブSDKが実装されています。

AndroidiOS
30日間ダウンロード
66
いいね数
32
Pub ポイント
140

パッケージをインストール

flutter pub add flutter_checkout_payment

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

flutter_checkout_payment パッケージは、Flutter アプリケーションに Checkout オンライン決済ゲートウェイを統合できるようにします。Android および iOS のネイティブ SDK をラップし、Flutter 環境内で支払い処理をスムーズに行う方法を提供します。信頼性とセキュリティの高い支払い処理を求める開発者向けに設計されており、トークン化や取引処理などの主要機能をサポートしています。このプラグインは shadyboshra.com によってメンテナンスされており、両方の主要なモバイルプラットフォームと互換性があります。

用途

  • アプリ内購入
  • 電子商取引チェックアウト
  • サブスクリプション課金
  • デジタルサービスの支払い

主な機能

  • ネイティブSDKの統合
  • Android および iOS のサポート
  • セキュアな決済処理
  • トークン化された取引
  • pub を通じた簡単なセットアップ
  • リアルタイム取引状態

適している対象

  • モバイルECアプリ
  • デジタル製品の販売者
  • サブスクリプションベースのサービス
  • FlutterとCheckoutを使用する開発者
  • セキュアな決済ゲートウェイを必要とするアプリ

注意事項

  • チェックアウトアカウントのセットアップが必要です
  • 適切な API キーの設定が必要です
  • チェックアウト決済プロバイダに限定
  • プラットフォーム固有の設定が必要になる場合があります
  • 安定したネットワーク接続に依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Checkout Payment

pub.dev Donate Paypal GitHub Follow

Explain

This plugin is for Checkout online payment. It's implemented the native SDKs to work on Flutter environment.

Getting Started

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_checkout_payment: ^1.4.4
Android

No additional work required

iOS

The SDK build for >= iOS 10.0, so you need to set the platform version in the Podfile to iOS 10 or above.

platform: :ios, '10.0'

Usage

You just have to import the package with

import 'package:flutter_checkout_payment/flutter_checkout_payment.dart';

Then, you need to initialize the API with you public key. Your public key is found on Checkout dashboard.

await FlutterCheckoutPayment.init(key: "YOUR_PUBLIC_KEY");

And when you are ready for production you have to set the environment to Live.

await FlutterCheckoutPayment.init(key: "YOUR_PUBLIC_KEY", environment: Environment.LIVE);

Now, you can generate the Token which you will use to proceed the payment.

CardTokenisationResponse response = await FlutterCheckoutPayment.generateToken(number: "4242424242424242", name: "name", expiryMonth: "05", expiryYear: "21", cvv: "100");
print(response.token);

Apple Pay

If you are using the official flutter pay package to handle apple pay, you must send your apple token as the following:

final paymentDataBase64 = jsonDecode(applePayPaymentData['token']);
String jsonString = jsonEncode(paymentDataBase64);
List<int> bytes = utf8.encode(jsonString);
String base64String = base64Encode(bytes);
final token = await FlutterCheckoutPayment.generateApplePayToken(paymentDataBase64: base64String);

Public Static Methods Summary

Return Description
Future<bool> init(@required String key, Environment environment default Environment.SANDBOX})
Initialize the Checkout API with key and environment. Return a bool of the successful status.
Future<CardTokenisationResponse> generateToken({@required String number, @required String name, @required String expiryMonth, @required String expiryYear, @required String cvv, BillingModel billingModel})
Generate the token which it will be used to make the payment, return the CardTokenisationResponse value.
Future<bool> isCardValid({@required String number})
Check whether the card number is valid or not, return a bool with the result.
Future<String> handle3DS({@required String authUrl, @required String successUrl, @required String failUrl})
Handle a 3DS challenge, returns token if success or null if failure.
Future<CardTokenisationResponse> generateApplePayToken({@required String paymentDataBase64})
Generate the token based on Apple pay data and return the CardTokenisationResponse value.
Future<CardTokenisationResponse> generateGooglePayToken({@required String tokenJsonPayload})
Generate the token based on Google pay data and return the CardTokenisationResponse value.

The rest of methods are under development.

Objects

class BillingModel {
  final String addressLine1;
  final String addressLine2;
  final String postcode;
  final String country;
  final String city;
  final String state;
  final PhoneModel phoneModel;
}

class PhoneModel {
  final String countryCode;
  final String number;
}

class CardTokenisationResponse {
  final String? type;
  final String? token;
  final String? expiresOn;
  final int? expiryMonth;
  final int? expiryYear;
  final String? scheme;
  final String? last4;
  final String? bin;
  final String? cardType;
  final String? cardCategory;
  final String? issuer;
  final String? issuerCountry;
  final String? productId;
  final String? productType;
  final BillingModel? billingAddress;
  final PhoneModel? phone;
  final String? name;
}

Contributors (Thanks for your GREAT work ❤️)

edwardmp: Added Feature Handling 3D Secure. edwardmp: Added generateApplePayToken and generateGooglePayToken methods. osama450: Fixed some issues. lucasuracosta Fixed issue in Android namespace valentindrolet-naomi Remove Flutter v1 embedding to fix Android compilation

Links

Checkout Android SDK: https://github.com/checkout/frames-android

Checkout iOS SDK: https://github.com/checkout/frames-ios

This plugin is mainly developed for GRANDTK company.

Find me on Stackoverflow

profile for Shady Boshra at Stack Overflow, Q&A for professional and enthusiast programmers

License

MIT: https://mit-license.org.

Copyright (c) 2021 Shady Boshra. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。