搜尋套件、儲存庫與 APP 分類

套件詳情v0.3.0

cloudpayments

一個用於在 Android 和 iOS 應用中整合 Cloudpaymanets 的 Flutter 插件。

AndroidiOS
近 30 天下載
58
喜歡數
27
Pub 分數
140

安裝套件

flutter pub add cloudpayments

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 插件,可實現 CloudPayments 在 Android 和 iOS 應用中的無縫整合。它提供了一個簡單的介面來處理付款,包括卡片處理和交易管理。此插件專為 CloudPayments API 設計,支援安全的付款流程和即時交易狀態更新。該插件相容於兩大主要行動平台,並簡化了在 Flutter 應用中實作付款功能的過程。

適用情境

  • 應用內購買
  • 電子商務結帳
  • 訂閱計費
  • 支付網關整合
  • 行動錢包交易

主要特色

  • 安全的卡片處理
  • 跨平台支援
  • 即時交易狀態
  • 使用 Flutter 輕鬆設定
  • 與 CloudPayments 的 API 兼容性

適合對象

  • 行動電商應用
  • 數位產品賣家
  • 基於訂閱的服務
  • 需要安全付款的應用程式
  • 在 Android 和 iOS 上使用 Flutter 的開發人員

使用建議

  • 需要 CloudPayments 帳戶
  • 需要正確的SSL設定
  • 可能需要額外的後端驗證
  • 依賴外部API的穩定性
  • 符合地區支付法規

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

cloudpayments

A Flutter plugin for integrating Cloudpaymanets in Android and iOS applications.

Disclaimer: It is not an official plugin. It uses SDK-Android on Android and SDK-IOS on iOS. Also this plugin doesn't send any requests to Cloudpayments API. In order to make purchases you have to implment some logic on your server.

Steps to make purchase:

  • In the application, you need to obtain card data: number, expiration date, holder's name, and CVV;
  • Create a card data cryptogram using this plugin;
  • Send a cryptogram and all data for payment from a mobile device to your server;
  • Make a payment via API call with your server.

See the official documentation:

Supports
  • [X] Check the validity of the card's parameters.
  • [X] Generate card cryptogram packet.
  • [X] Show 3ds dialog.
  • [X] Google Pay payments.
  • [X] Apple Pay payments.

Getting Started

Initializing for Android

If you want to show 3ds dialog on Android, make MainActivity implements FlutterFragmentActivity instead of FlutterActivity

android/app/src/main/.../MainActivity.kt:

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {}

Usage

  • Check card number validity.
bool isValid = await Cloudpayments.isValidNumber(cardNumber);
  • Check card expire date.
bool isValid = await Cloudpayments.isValidExpireDate(cardNumber); // MM/yy
  • Generate card cryptogram packet. You need to get your publicId from your personal account.
final cryptogram = await Cloudpayments.cardCryptogram(cardNumber, expireDate, cvcCode, publicId);
  • Showing 3DS form and get results of 3DS auth.
final result = await Cloudpayments.show3ds(acsUrl, transactionId, paReq);

Apple Pay

  • Create instance of CloudpaymentsApplePay.
final applePay = CloudpaymentsApplePay();
  • Check whether Apple Pay is available on this device and can process payment requests.
final isApplePayAvailable = await applePay.isApplePayAvailable();
  • Request payment.
final paymentToken = await applePay.requestApplePayPayment(
    merchantId: 'merchant.com.YOURDOMAIN',
    currencyCode: 'RUB',
    countryCode: 'RU',
    products: [
        {"name": "Red apple", "price": "170"},
        {"name": "Mango", "price": "250.50"},
        {"name": "Delivery", "price": "100"},
        {"name": "Discount", "price": "-89.90"},
        {"name": "Total", "price": "430.60"},
    ],
);

Now you can use paymentToken for payment by a cryptogram.

Google Pay

  • Create instance of CloudpaymentsGooglePay. Pass Google Pay Evironemnt (test or production) into constructor.
 final googlePay = CloudpaymentsGooglePay(GooglePayEnvironment.production);
  • Check whether Google Pay is available on this device and can process payment requests.
final isGooglePayAvailable = await googlePay.isGooglePayAvailable();
  • Request payment.
 final result = await googlePay.requestGooglePayPayment(
    price: '430.6',
    currencyCode: 'RUB',
    countryCode: 'RU',
    merchantName: 'Example Merchant',
    publicId: 'test_api_00000000000000000000002',
);

if (result != null) {
    if (result.isSuccess) {
      final paymentToken = result.token;
    }
}

Now you can use paymentToken for payment by a cryptogram.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。