패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.4.29

go_sell_sdk_flutter

Android 및 iOS용 goSellSDK 라이브러리의 Flutter 플러그인 호환 버전입니다.

AndroidiOS
30일 다운로드
567
좋아요
25
Pub 점수
120

패키지 설치

flutter pub add go_sell_sdk_flutter

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

go_sell_sdk_flutter 패키지는 안드로이드 및 iOS 플랫폼에서 결제 처리를 위해 goSellSDK와 원활하게 통합할 수 있는 Flutter 플러그인입니다. 개발자가 결제 정보를 안전하게 수집하고 토큰화를 처리하며 Flutter 앱 내에서 거래를 관리할 수 있도록 합니다. 사용이 간편하도록 설계되어 다양한 결제 방식을 지원하며 산업 보안 기준을 준수합니다. 이 SDK는 Tap Payments가 유지보수하며 모바일 플랫폼 간에 일관된 경험을 제공합니다.

사용 사례

  • 앱 내 구매
  • 전자상거래 체크아웃
  • 모바일 결제장치 시스템
  • 구독 결제
  • 디지털 지갑 통합

주요 기능

  • 크로스 플랫폼 호환성
  • 안전한 결제 토큰화
  • 다양한 결제 수단 지원
  • Flutter와의 간편한 통합
  • 실시간 거래 처리

적합한 대상

  • 전자상거래 앱을 구축하는 플러터 개발자
  • 안전한 모바일 결제가 필요한 기업
  • Tap Payments와 통합하는 개발자
  • PCI 준수 결제 처리가 필요한 앱
  • 모바일 중심의 결제 솔루션을 출시하는 스타트업

고려 사항

  • Tap Payments의 API 키가 필요합니다
  • Android 및 iOS에 대한 적절한 구성이 필요합니다
  • 거래 중 네트워크 연결에 따라 달라짐
  • 완전한 결제 흐름을 위해 추가적인 백엔드 로직이 필요할 수 있습니다
  • 지원되는 지역 및 통화에 제한됨

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

go_sell_sdk_flutter

Flutter plugin compatible version of goSellSDK library for both Android and iOS that fully covers payment/authorization/card saving/card tokenization process inside your Android application.

Original SDKS

  • Android (https://github.com/Tap-Payments/goSellSDK-Android)

  • AndroidX (https://github.com/Tap-Payments/goSellSDK-AndroidX)

  • iOS (https://github.com/Tap-Payments/goSellSDK-ios)

Getting Started

Table of Contents

  1. Requirements

  2. Installation

  3. Installation with pubspec.yaml

  4. Usage

  5. Configure Your App

  6. Configure SDK Session

  7. Transaction Modes

  8. Customer

  9. Shipping

  10. Tax

  11. Reference

  12. Payment Item

  13. Configure Payment Type

  14. Use Tap Pay Button

  15. Handle SDK Result

  16. Apple Pay Setup

  17. Google Pay Setup

Requirements

To use the SDK the following requirements must be met:

  1. Visual Studio - InteliJ Idea

  2. Dart 2.7.1 or newer

  3. Flutter: >=3.0.0 or newer

  4. iOS 11 or later

  5. XCode 12 or later

Installation

Include goSellSDK plugin as a dependency in your pubspec.yaml
  
  dependencies:  
      go_sell_sdk_flutter: ^2.4.11
      

Configure your app

goSellSDK should be set up. To set it up, add the following lines of code somewhere in your project and make sure they will be called before any usage of goSellSDK.

  
/**  
  
* Configure App. (You must get those keys from tap)  
  
*/  
  
  GoSellSdkFlutter.configureApp(  
       bundleId: Platform.isAndroid? "ANDROID-PACKAGE-NAME" : "IOS-APP-ID",  
       productionSecreteKey: Platform.isAndroid? "Android-Live-KEY" : "iOS-Live-KEY",  
       sandBoxsecretKey: Platform.isAndroid?"Android-SANDBOX-KEY" : "iOS-SANDBOX-KEY",  
       lang: "en",
   );  
  

Configure SDK Session Example

  
Future<void> setupSDKSession() async {  
  
       try {  
         GoSellSdkFlutter.sessionConfigurations(  
            trxMode: TransactionMode.PURCHASE,  
            transactionCurrency: "kwd",  
            amount: '100',  
            customer: Customer(  
                 customerId: "", // customer id is important to retrieve cards saved  for this   customer  
                 email: "test@test.com",  
                 isdNumber: "965",  
                 number: "00000000",  
                 firstName: "test",  
                 middleName: "test",  
                 lastName: "test",  
                 metaData: null,
                ),  
           paymentItems: <PaymentItem>[  
                 PaymentItem(  
                    name: "item1",  
                    amountPerUnit: 1,  
                    quantity: Quantity(value: 1),  
                    discount: {  
                       "type": "F",  
                       "value": 10,  
                       "maximum_fee": 10,  
                       "minimum_fee": 1  
                    },  
                   description: "Item 1 Apple",  
                   taxes: [  
                        Tax(  
                           amount: Amount(  
                           type: "F",  
                           value: 10,  
                           minimum_fee: 1,  
                           maximum_fee: 10,
                         ),  
                           name: "tax1",  
                           description: "tax description",
                        )  
                   ],  
                  totalAmount: 100,
              ),  
         ],  
// List of taxes  
  
          taxes: [  
               Tax(  
                    amount: Amount(  
                    type: "F",  
                    value: 10,  
                    minimum_fee: 1,  
                    maximum_fee: 10,
                      ),  
                    name: "tax1",  
                    description: "tax description",
               ), 
                Tax(  
                    amount: Amount(  
                    type: "F",  
                    value: 10,  
                    minimum_fee: 1,  
                    maximum_fee: 10,
                      ),  
                    name: "tax1",  
                    description: "tax description",
               ),   
   
          ],  
      // List of shipping  
  
       shippings: [  
            Shipping(  
              name: "shipping 1",  
              amount: 100,  
              description: "shipping description 1",
            ),  
            Shipping(  
              name: "shipping 2",  
              amount: 100,  
              description: "shipping description 2",
            ),   
        ],  
      // Post URL  
          postURL: "https://tap.company",  
      // Payment description  
          paymentDescription: "paymentDescription",  
      // Payment Metadata  
  
           paymentMetaData: {  
               "a": "a meta",  
               "b": "b meta",  
           },  
      // Payment Reference  
  
          paymentReference: Reference(  
                 acquirer: "acquirer",  
                 gateway: "gateway",  
                 payment: "payment",  
                 track: "track",  
                 transaction: "trans_910101",  
                 order: "order_262625"),  
        // payment Descriptor  
          paymentStatementDescriptor: "paymentStatementDescriptor",  
        // Save Card Switch  
          isUserAllowedToSaveCard: true,  
        // Enable/Disable 3DSecure  
          isRequires3DSecure: false,  
        // Receipt SMS/Email  
          receipt: Receipt(true, false),  
         // Authorize Action [Capture - Void]  
           authorizeAction: AuthorizeAction(  
         type: AuthorizeActionType.CAPTURE, timeInHours: 10),  
         // Destinations  
         destinations:Destinations(  
               amount: 100,  
               currency: 'kwd',  
               count: 2,  
               destinationlist: [  
                     Destination(  
                         id: "",  
                         amount: 100,  
                         currency: "kwd",  
                         description: "des",  
                         reference: "ref_121299"),  
                     Destination(  
                         id: "",  
                         amount: 100,  
                         currency: "kwd",  
                         description: "des",  
                         reference: "ref_22444444")
                     
                      ],
             ),  
         // merchant id  
           merchantID: "",  
         // Allowed cards  
           allowedCadTypes: CardType.ALL,  
           applePayMerchantID: "merchant.applePayMerchantID",  
           allowsToSaveSameCardMoreThanOnce: false,  
         // pass the card holder name to the SDK  
           cardHolderName: "Card Holder NAME",  
         // disable changing the card holder name by the user  
           allowsToEditCardHolderName: false,  
         // Supported payment methods List  supportedPaymentMethods: ["knet", "visa"],  
  
         /// SDK Appearance Mode appearanceMode: SDKAppearanceMode.fullscreen,  
           paymentType: PaymentType.ALL,  
           sdkMode: SDKMode.Sandbox,
      );  
 } on PlatformException {  
 }  

Transaction Modes

trxMode: TransactionMode.PURCHASE  
  

You can set the transaction mode into one of the following modes:

  • Purchase

  • dart TransactionMode.PURCHASE

Normal customer charge.

  • Authorize

  • dart TransactionMode.AUTHORIZE_CAPTURE

Only authorization is happening. You should specify an action after successful authorization: either capture the amount or void the charge after specific period of time.

  • Save Card

  • dart TransactionMode.SAVE_CARD

Use this mode to save the card of the customer with Tap and use it later.

  • Tokenize Card

  • dart TransactionMode.TOKENIZE_CARD

Use this mode if you are willing to perform the charging/authorization manually. The purpose of this mode is only to collect and tokenize card information details of your customer if you don't have PCI compliance certificate but willing to process the payment manually using our services.


Customer
  • New Customer (First time to pay using goSell SDK)
 Customer(  
      customerId: "",  
      email: "test@test.com",  
      isdNumber: "965",  
      number: "00000000",  
      firstName: "test",  
      middleName: "test",  
      lastName: "test",  
      metaData: null,
   )  

After the first transaction success, you receive the customerId in the response. Save it to be used in the next transaction.

  • Existed Customer (paid before using goSell SDK)

You need to set the customerId only and you can see the customer saved cards if the user has.

  Customer(  
       customerId: "cus_smdnd3346nd3dks3jd9drd7d",  
       email: "",  
       isdNumber: "965",  
       number: "00000000",  
       firstName: "",  
       middleName: "",  
       lastName: "",  
       metaData: null
     )  

Please note that goSell SDK using the customerId only if it's not Empty ('').


Shipping
  • Model for Shipping
 Shipping(  
   name: "shipping",  
   amount: 150,  
   description: "shipping description",  
 ) 

Tax
  • Model for Tax
Tax(  
  amount: Amount(  
  type: "F",  
    value: 10,  
    minimumFee: 1,  
    maximumFee: 10,  
  ),  
  name: "tax1",  
  description: "tax description",  
),

Reference
  • Model for Reference
Reference(  
  acquirer: "acquirer",  
  gateway: "gateway",  
  payment: "payment",  
  track: "track",  
  transaction: "trans_910101",  
  order: "order_262625",  
),

Payment Item
  • Model for Payment Item
 PaymentItem(  
   name: "item1",  
   amountPerUnit: 1,  
   quantity: Quantity(value: 1),  
   discount: {  
   "type": "F",  
     "value": 10,  
     "maximum_fee": 10,  
     "minimum_fee": 1  
   },  
   description: "Item 1 Apple",  
   taxes: [  
    Tax(  
     amount: Amount(  
     type: "F",  
        value: 10,  
        minimumFee: 1,  
        maximumFee: 10,  
      ),  
      name: "tax1",  
      description: "tax description",  
    )  
  ],  
  totalAmount: 100,  
),

Configure Payment Type

  
paymentType: PaymentType.ALL  
  

| Payment Type | Description |

| ------------- | ------------- |

| ALL | Shows all the available payment methods |

| CARD | Shows only cards payment methods |

| DEVICE | Shows payment methods depending on the device, for iOS it shows ApplePay only |


Use Tap Pay Button

  
Positioned(  
  
bottom: Platform.isIOS ? 0 : 10,  
  
left: 18,  
  
right: 18,  
  
child: SizedBox(  
  
height: 45,  
  
child: ElevatedButton(  
  
clipBehavior: Clip.hardEdge,  
  
style: ButtonStyle(  
  
backgroundColor: MaterialStateProperty.all(_buttonColor),  
  
shape: MaterialStateProperty.all(  
  
RoundedRectangleBorder(  
  
borderRadius: BorderRadius.circular(30),  
  
),  
  
),  
  
),  
  
onPressed: startSDK,  
  
child: Row(  
  
mainAxisAlignment: MainAxisAlignment.center,  
  
children: [  
  
Container(  
  
width: 25,  
  
height: 25,  
  
child: AwesomeLoader(  
  
outerColor: Colors.white,  
  
innerColor: Colors.white,  
  
strokeWidth: 3.0,  
  
controller: loaderController,  
  
),  
  
),  
  
Spacer(),  
  
Text(  
  
'PAY',  
  
style: TextStyle(  
  
color: Colors.white,  
  
fontSize: 16.0,  
  
),  
  
),  
  
Spacer(),  
  
Icon(  
  
Icons.lock_outline,  
  
color: Colors.white,  
  
),  
  
],  
  
),  
  
),  
  
),  
  
),  
  

Handle SDK Result

  • Start SDK
  
tapSDKResult = await GoSellSdkFlutter.startPaymentSDK;  
  
  • Hnadle SDK result
  
setState(() {  
  
switch (tapSDKResult['sdk_result']) {  
  
case "SUCCESS":  
  
sdkStatus = "SUCCESS";  
  
handleSDKResult();  
  
break;  
  
case "FAILED":  
  
sdkStatus = "FAILED";  
  
handleSDKResult();  
  
break;  
  
case "SDK_ERROR":  
  
sdkErrorCode = tapSDKResult['sdk_error_code'].toString();  
  
sdkErrorMessage = tapSDKResult['sdk_error_message'];  
  
sdkErrorDescription = tapSDKResult['sdk_error_description'];  
  
break;  
  
case "NOT_IMPLEMENTED":  
  
sdkStatus = "NOT_IMPLEMENTED";  
  
break;  
  
}  
  
});  
  
void handleSDKResult() {  
  
switch (tapSDKResult['trx_mode']) {  
  
case "CHARGE":  
  
case "AUTHORIZE":  
  
case "SAVE_CARD":  
  
extractSDKResultKeysAndValues();  
  
break;  
  
case "TOKENIZE":  
  
token : =tapSDKResult['token'];  
  
token_currency =tapSDKResult['token_currency'];  
  
card_first_six =tapSDKResult['card_first_six'];  
  
card_last_four =tapSDKResult['card_last_four'];  
  
card_object =tapSDKResult['card_object'];  
  
card_exp_month =tapSDKResult['card_exp_month'];  
  
card_exp_year =tapSDKResult['card_exp_year'];  
  
break;  
  
}  
  
}  
  
void extractSDKResultKeysAndValues() {  
  
id = tapSDKResult['charge_id'];  
  
description = tapSDKResult['description'];  
  
message = tapSDKResult['message'];  
  
card_first_six = tapSDKResult['card_first_six'];  
  
card_last_four = tapSDKResult['card_last_four'];  
  
card_object = tapSDKResult['card_object'];  
  
card_brand = tapSDKResult['card_brand'];  
  
card_exp_month = tapSDKResult['card_exp_month'];  
  
card_exp_year = tapSDKResult['card_exp_year'];  
  
acquirer_id = tapSDKResult['acquirer_id'];  
  
acquirer_response_code = tapSDKResult['acquirer_response_code'];  
  
acquirer_response_message = tapSDKResult['acquirer_response_message'];  
  
source_id = tapSDKResult['source_id'];  
  
source_channel = tapSDKResult['source_channel'];  
  
source_object = tapSDKResult['source_object'];  
  
source_payment_type = tapSDKResult['source_payment_type'];  
  
responseID = tapSDKResult['charge_id'];  
  
}  
  

Apple pay setup

Follow the steps shared in the following link to setup apple pay:

https://github.com/Tap-Payments/goSellSDK-ios#apple-pay

Enable Apple Pay Setup Button

The SDK now supports the enableApplePaySetup parameter which allows you to show the Apple Pay setup button to users who haven't configured Apple Pay on their device.

GoSellSdkFlutter.startPaymentProcess(
  merchantID: "YOUR_MERCHANT_ID",
  allowedCadTypes: CardType.ALL,
  applePayMerchantID: "merchant.com.tap.applepay",
  enableApplePaySetup: true,  // Show setup button if wallet not configured
  sdkMode: SDKMode.SANDBOX,
  paymentType: PaymentType.ALL,
);

Behavior:

  • When enableApplePaySetup: true → The Apple Pay setup button will be displayed if the wallet is not configured on the device
  • When enableApplePaySetup: false (default) → The Apple Pay setup button will be hidden

This feature enables users to easily configure Apple Pay during the payment process if they haven't already done so.



Google pay setup

Follow the steps shared in the following link to setup google pay:

https://github.com/Tap-Payments/goSellSDK-AndroidX?tab=readme-ov-file#google-pay


카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.2

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.