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

套件詳情v3.2.0

hyperpay_plugin

HyperPay 平台提供了一個完整且易於使用的指南,可實現我們端對端移動支付網關的無縫整合。

AndroidiOS
近 30 天下載
2100
喜歡數
54
Pub 分數
150

安裝套件

flutter pub add hyperpay_plugin

套件介紹

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

HyperPay 插件是一個 Flutter/Dart 套件,可實現 HyperPay 端對端支付網關在行動應用程式中的無縫整合。專為 Android 和 iOS 設計,它簡化了添加安全可靠支付處理流程的過程,僅需最少設定。該套件提供簡單的 API 來處理交易、權杖化和支付確認,確保順暢的結帳體驗。非常適合希望透過統一介面支援多種支付方式的開發人員。由於獲得 HyperPay 平台的官方支援,確保符合產業標準並實時追蹤交易。

適用情境

  • 應用內購買
  • 電子商務結帳
  • 行動錢包整合
  • 訂閱計費
  • 數位服務的付款處理

主要特色

  • 跨平台支援(Android 與 iOS)
  • 安全支付金鑰化
  • 與 HyperPay 網關的輕鬆整合
  • 即時交易狀態
  • 支援多種支付方式

適合對象

  • Flutter 開發人員建構電商應用
  • 需要快速支付整合的初創企業
  • 需要多貨幣支援的應用程式
  • 使用 HyperPay 作為支付提供商的開發者
  • 具有嚴格安全和合規需求的項目

使用建議

  • 需要 HyperPay 帳號和 API 憑證
  • 僅限 HyperPay 支援的地區
  • 依賴外部網關的穩定性
  • 需要正確處理錯誤狀態
  • 可能需要額外設定才能使用進階功能

原始 README

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

HyperPay SDK Plugin

The HyperPay platform offers a complete, easy-to-use guide to enable seamless integration of our end-to-end payment gateway for mobile and desktop browsers. Through a unified API, you can enable and gain access to all platform features. Choose one of the options below to quickly get started

pub package Discord GitHub License Coffee

Support ReadyUI , CustomUI

  • VISA , MasterCard
  • STC
  • Apple Pay
  • MADA ( Saudi Arabia )
Android Setup
  1. Open android/app/build.gradle and add the following lines
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    debugImplementation(name: "ipworks3ds_sdk", ext: 'aar')
    releaseImplementation(name: "ipworks3ds_sdk_deploy", ext: 'aar')
    implementation(name: "oppwa.mobile-release", ext: 'aar')
    implementation "com.google.android.material:material:1.6.1"
    implementation "androidx.appcompat:appcompat:1.5.1"
    implementation 'com.google.android.gms:play-services-wallet:19.1.0'
    implementation "androidx.browser:browser:1.4.0"
    implementation "com.google.code.gson:gson:2.8.9"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
    implementation "androidx.webkit:webkit:1.4.0"
    implementation "androidx.fragment:fragment-ktx:1.4.1"
    implementation "androidx.constraintlayout:constraintlayout:2.1.4"
    implementation "androidx.recyclerview:recyclerview:1.2.1"
    implementation 'androidx.databinding:viewbinding:7.1.2'
  1. Open app/build.gradle and make sure that the minSdkVersion is 21

  2. Open your AndroidManifest.xml, and put intent-filter inside activity.

<application
  <activity
        <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
                <data android:scheme="com.testpayment.payment" />
            </intent-filter>
  </activity>
</application>
        
Note about Intent-filter scheme
shopperResultUrl since mSDK version 6.0.0 the shopper result URL is not required

The Scheme field must match the InAppPaymentSetting.shopperResultUrl field. Don't make Scheme like com.testPayment.Payment avoid capital letters in Android.

It's used when making a payment outside the app (Like open browser) and back into the app

IOS Setup
  1. Open Podfile, and paste the following inside of it:
pod 'hyperpay_sdk', :git => 'https://github.com/ahmedelkhyary/hyperpay_sdk.git'
$static_framework = ['hyperpay_plugin']
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  installer.pod_targets.each do |pod|
      if $static_framework.include?(pod.name)
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
end
  1. Add Url Scheme to the list of bundle identifiers. The Url Scheme field must match the InAppPaymentSetting.shopperResultUrl field.


Setup HyperPay Environment Configuration

define instanse of FlutterHyperPay

late FlutterHyperPay flutterHyperPay ;
flutterHyperPay = FlutterHyperPay(
shopperResultUrl: InAppPaymentSetting.shopperResultUrl, // return back to app
paymentMode:  PaymentMode.test, // test or live
lang: InAppPaymentSetting.getLang(),
);

create a method to get the checkoutId

  /// URL TO GET CHECKOUT ID FOR TEST 
  /// THIS LINK UNAVAILABLE NOW
  /// http://dev.hyperpay.com/hyperpay-demo/getcheckoutid.php
  /// Brands Names [ VISA , MASTER , MADA , STC_PAY , APPLEPAY]

getCheckOut() async {
    final url = Uri.parse('https://dev.hyperpay.com/hyperpay-demo/getcheckoutid.php');
    final response = await http.get(url);
    if (response.statusCode == 200) {
      payRequestNowReadyUI(
        checkoutId: json.decode(response.body)['id'],
        brandsName: [ "VISA" , "MASTER" , "MADA" ,"PAYPAL", "STC_PAY" , "APPLEPAY"]);
    }else{
      dev.log(response.body.toString(), name: "STATUS CODE ERROR");
    }
  }

If you want using readyUI send checkoutId and List of brandsName to Plugin

Brands Names support [ VISA , MASTER , MADA , STC_PAY , APPLEPAY]

  payRequestNowReadyUI(
      {required List<String> brandsName, required String checkoutId}) async {
    PaymentResultData paymentResultData;
      paymentResultData = await flutterHyperPay.readyUICards(
        readyUI: ReadyUI(
            brandsName: brandsName ,
            checkoutId: checkoutId,
            merchantIdApplePayIOS: InAppPaymentSetting.merchantId, // applepay
            countryCodeApplePayIOS: InAppPaymentSetting.countryCode, // applePay
            companyNameApplePayIOS: "Test Co", // applePay
            themColorHexIOS: "#000000" ,// FOR IOS ONLY
            setStorePaymentDetailsMode: true // store payment details for future use
            ),
      );
  }


If you want using CustomUI

 payRequestNowCustomUi(
      {required String brandName, required String checkoutId}) async {
    PaymentResultData paymentResultData;
    paymentResultData = await flutterHyperPay.customUICards(
      customUI: CustomUI(
        brandName: brandName,
        checkoutId: checkoutId,
        cardNumber: "5541805721646120",
        holderName: "test name",
        month: 12,
        year: 2023,
        cvv: 123,
        enabledTokenization: false, // default
      ),
    );
  }

STC CustomUI - now for android only next release we will support IOS

  // STC_PAY
    payRequestNowCustomUiSTCPAY(
      {required String phoneNumber, required String checkoutId}) async {
    PaymentResultData paymentResultData;
    paymentResultData = await flutterHyperPay.customUISTC(
      customUISTC: CustomUISTC(
          checkoutId: checkoutId,
          phoneNumber: phoneNumber
      ),
    );
  }

get check the payment status after request

    if (paymentResultData.paymentResult == PaymentResult.success ||
        paymentResultData.paymentResult == PaymentResult.sync) {
      // do something
    }

ReadyUI change color in android platform open android/app/src/main/res/values and add the following lines

    <!--    DEFAULT COLORS YOU CAN OVERRIDE IN YOUR APP-->
    <color name="headerBackground">#000000</color>
    <color name="cancelButtonTintColor">#FFFFFF</color>
    <color name="listMarkTintColor">#000000</color>
    <color name="cameraTintColor">#000000</color>
    <color name="checkboxButtonTintColor">#000000</color>

payment setting

  class InAppPaymentSetting {
   // shopperResultUrl : this name must like scheme in intent-filter, url scheme in xcode
   // Avoid capital letters like `com.testPayment.Payment`, as it will not work in Android.
  static const String shopperResultUrl= "com.testpayment.payment";
  static const String merchantId= "MerchantId";
  static const String countryCode="SA";
  static getLang() {
    if (Platform.isIOS) {
      return  "en"; // ar
    } else {
      return "en_US"; // ar_AR
    }
  }
}

MerchantId apple pay Setup click here this steps to create and verify apple pay and domain

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.0.2

原始碼儲存庫

使用此套件的專案

暫無相關資料。