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

パッケージ詳細v1.2.0

midtrans_sdk

Midtrans モバイル SDK 用の Flutter プラグイン。iOS および Android をサポートしています。

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

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

flutter pub add midtrans_sdk

パッケージ概要

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

midtrans_sdk は、Android および iOS アプリケーションに Midtrans モバイル SDK を統合するための Flutter プラグインであり、アプリ内でのスムーズな決済処理を可能にします。支払いの開始、取引コールバックの処理、セキュアな支払いフローの管理を行うためのシンプルなインターフェースを提供しています。Flutter アプリに信頼性の高い決済機能を追加したい開発者向けに設計されており、クレジットカード、電子ウォレット、銀行送金など、Midtrans で利用可能なさまざまな決済方法をサポートしています。このプラグインは、主要な2つのモバイルプラットフォームとの互換性を確保し、Midtrans のバックエンドサービスとの統合を簡素化しています。

用途

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

主な機能

  • Android および iOS をサポート
  • セキュアな決済処理
  • トランザクションコールバック処理
  • Midtransとの簡単な統合
  • リアルタイムでの支払い状態の更新

適している対象

  • eコマースアプリを構築するFlutter開発者
  • 複数の決済方法を必要とするアプリ
  • Midtrans を決済ゲートウェイとして使用する開発者
  • 迅速な決済統合が必要なスタートアップ
  • 東南アジア市場をターゲットにしたモバイルアプリ

注意事項

  • Midtrans アカウントが必要です
  • 適切な API キーの設定が必要です
  • 完全な機能を実現するためにネイティブSDKに依存しています
  • サンドボックステストには追加の設定が必要になる場合があります
  • Midtransがサポートする地域に限定

元の README

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

midtrans_sdk

A Flutter plugin for Midtrans Mobile SDK. Visit https://midtrans.com.

pub package


Supported Platforms

  • [x] Android
  • [x] iOS
  • [ ] Web

Usage

To use this plugin, add midtrans_sdk as a dependency in your pubspec.yaml file.

Getting started

See the example directory for a sample about start payment by using snap token which using midtrans_sdk.

Android
  • If you are using FlutterActivity directly, change it to FlutterFragmentActivity in your AndroidManifest.xml.
  • If you are using a custom activity, update your MainActivity.java:
import io.flutter.embedding.android.FlutterFragmentActivity;

public class MainActivity extends FlutterFragmentActivity {
    // ...
}

or MainActivity.kt:

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
    // ...
}

MidtransConfig

To start using Midtrans you first need to create an instance of MidtransSDK before using any other of our sdk functionalities.
MidtransSDK receives a MidtransConfig object. This is how you can configure our MidtransSDK instance and connect it to your Midtrans account.

Example:

import 'package:midtrans_sdk/midtrans_sdk.dart';

var config = MidtransConfig(
  clientKey: "",
  merchantBaseUrl: "",
  colorTheme: ColorTheme(
    colorPrimary: Theme.of(context).colorScheme.primary,
    colorPrimaryDark: Theme.of(context).colorScheme.primary,
    colorSecondary: Theme.of(context).colorScheme.secondary,
  ),
);

Initializing the SDK

The next step is to call init which have the required MidtransConfig object parameter config. After we call init we can use all of Midtrans SDK features. Initialize the SDK to enable Midtrans to start payment.

MidtransSDK.init(
    config: config,
);

Starting payment

Start payment method screen

Default mode for midtrans_sdk is showing payment method screen. This screen will show all of your available payment methods. You can enable/disable payment methods via Snap Preferences in MAP.

Start payment by using snap token

We provide SDK method to allow you to make payment by using snap token without initialize transaction request first. You just need to pass snap token as argument of startPaymentUiFlow method.

_midtrans?.startPaymentUiFlow(
    token: "snap-token",
);

カテゴリー

ソースリポジトリ

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

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