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

パッケージ詳細v2.0.2

momo_vn

支払いのためにオープンな MoMo.VN アプリを統合します。完了すると、システムは成功または失敗のデータを記録し、その後次のステップを処理します。

AndroidiOS
30日間ダウンロード
27
いいね数
30
Pub ポイント
120

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

flutter pub add momo_vn

パッケージ概要

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

momo_vn パッケージは、Android および iOS 向けのモバイル決済アプリ「MoMo.VN」との統合を可能にし、ユーザーがオープンな MoMo アプリを通じて取引を完了できるようにします。支払い処理後に、パッケージは成功または失敗のステータスを記録し、注文確認やエラー回復などの次のステップを自動的に処理できるようにします。MoMo の確立された決済インフラを活用することで、安全なアプリ内決済を簡素化しています。

用途

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

主な機能

  • スムーズなモモアプリ起動
  • トランザクションステータスの記録
  • 成功/失敗イベントの処理
  • クロスプラットフォーム対応(Android および iOS)
  • Flutter pub を通じた簡単な統合

適している対象

  • MoMo決済を必要とするFlutterアプリ
  • ベトナム市場をターゲットにする開発者
  • リアルタイム決済検証付きのアプリ
  • モモを主な支払い方法として使用する企業
  • モバイル決済に最小限のセットアップが必要なプロジェクト

注意事項

  • ユーザーのデバイスにMoMoアプリがインストールされている必要があります
  • MoMo.VNエコシステムに限定
  • 外部アプリの動作に依存します
  • オフライン取引のサポートなし
  • ユーザーはMoMoアプリ内で支払いを確認する必要があります

元の README

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

momo_vn

Getting Started

  • Need register your application at momo business home page : https://business.momo.vn, detail: https://developers.momo.vn/#/home?id=t%c3%a0i-kho%e1%ba%a3n-doanh-nghi%e1%bb%87p
  • Download testapp, test account at: https://developers.momo.vn/#/docs/testing_information
1. Android set up:
  • Step 1: Request Internet permission at AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
2. iOS set up:
  • Step 1: Update Info.plist file as below:
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string></string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>partnerSchemeId</string>
    </array>
  </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>momo</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>
  • Step 2: Define call back url for momo at AppDelegate.swift file:
import momo_vn
override func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        MoMoPayment.handleOpenUrl(url: url, sourceApp: sourceApplication!)
        return true
    }

override func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
        MoMoPayment.handleOpenUrl(url: url, sourceApp: "")
        return true
    }
See more setup at: https://developers.momo.vn/#/

Usage

  • Import
import 'package:momo_vn/momo_vn.dart';
  • Init
 void initState() {
    super.initState();
    _momoPay = MomoVn();
    _momoPay.on(MomoVn.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
    _momoPay.on(MomoVn.EVENT_PAYMENT_ERROR, _handlePaymentError);
    initPlatformState();
  }
  • Create data Object
MomoPaymentInfo options = MomoPaymentInfo(
    merchantname: "Tên đối tác",
    merchantcode: 'Mã đối tác',
    appScheme: "1221212",
    amount: 6000000000,
    orderId: '12321312',
    orderLabel: 'Label để hiển thị Mã giao dịch',
    merchantnamelabel: "Tiêu đề tên cửa hàng",
    fee: 0,
    description: 'Mô tả chi tiết',
    username: 'Định danh user (id/email/...)',
    partner: 'merchant',
    extra: "{\"key1\":\"value1\",\"key2\":\"value2\"}",
    isTestMode: true
);
  • Open MoMo application
try {
    _momoPay.open(options);
  } catch (e) {
    debugPrint(e);
  }
  • Get result
void _setState() {
    _payment_status = 'Đã chuyển thanh toán';
    if (_momoPaymentResult.isSuccess) {
      _payment_status += "\nTình trạng: Thành công.";
      _payment_status += "\nSố điện thoại: " + _momoPaymentResult.phonenumber;
      _payment_status += "\nExtra: " + _momoPaymentResult.extra;
      _payment_status += "\nToken: " + _momoPaymentResult.token;
    }
    else {
      _payment_status += "\nTình trạng: Thất bại.";
      _payment_status += "\nExtra: " + _momoPaymentResult.extra;
      _payment_status += "\nMã lỗi: " + _momoPaymentResult.status.toString();
    }
  }
  void _handlePaymentSuccess(PaymentResponse response) {
    setState(() {
      _momoPaymentResult = response;
      _setState();
    });
    Fluttertoast.showToast(msg: "THÀNH CÔNG: " + response.phonenumber, timeInSecForIos: 4);
  }

  void _handlePaymentError(PaymentResponse response) {
    setState(() {
      _momoPaymentResult = response;
      _setState();
    });
    Fluttertoast.showToast(msg: "THẤT BẠI: " + response.message.toString(), timeInSecForIos: 4);
  }

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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