搜索插件、代码仓与 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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。