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

패키지 상세v1.2.0

midtrans_sdk

Midtrans 모바일 SDK용 플러터 플러그인입니다. iOS 및 Android를 지원합니다.

AndroidiOS
30일 다운로드
102
좋아요
26
Pub 점수
140

패키지 설치

flutter pub add midtrans_sdk

패키지 개요

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

midtrans_sdk는 Android 및 iOS 애플리케이션에 Midtrans 모바일 SDK를 통합하는 Flutter 플러그인으로, 앱 내에서 원활한 결제 처리를 가능하게 합니다. 결제 시작, 거래 콜백 처리, 보안적인 결제 흐름 관리를 위한 간단한 인터페이스를 제공합니다. Flutter 앱에 신뢰할 수 있는 결제 기능을 추가하고자 하는 개발자를 위해 설계되었으며, 신용카드, 전자지갑, 은행 송금 등 Midtrans를 통해 이용 가능한 다양한 결제 수단을 지원합니다. 이 플러그인은 주요 두 가지 모바일 플랫폼과의 호환성을 보장하며 Midtrans의 백엔드 서비스와의 통합을 간소화합니다.

사용 사례

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

주요 기능

  • Android 및 iOS를 지원합니다
  • 안전한 결제 처리
  • 트랜잭션 콜백 처리
  • Midtrans와의 간편한 통합
  • 실시간 결제 상태 업데이트

적합한 대상

  • 전자상거래 앱을 구축하는 플러터 개발자
  • 여러 결제 수단이 필요한 앱
  • Midtrans를 결제 게이트웨이로 사용하는 개발자
  • 빠른 결제 통합이 필요한 스타트업
  • 동남아시아 시장을 겨냥한 모바일 앱

고려 사항

  • Midtrans 계정이 필요합니다
  • 올바른 API 키 구성이 필요합니다
  • 완전한 기능을 위해 네이티브 SDK에 의존합니다
  • 샌드박스 테스트를 위해 추가 설정이 필요할 수 있습니다
  • Midtrans에서 지원하는 지역에 한정

원본 README

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

midtrans_sdk

A Flutter plugin for Midtrans Mobile SDK. Visit https://midtrans.com.

pub package


Supported Platforms

  • [x] Android
  • [x] iOS
  • [ ] Web

Usage

To use this plugin, add midtrans_sdk as a dependency in your pubspec.yaml file.

Getting started

See the example directory for a sample about start payment by using snap token which using midtrans_sdk.

Android
  • If you are using FlutterActivity directly, change it to FlutterFragmentActivity in your AndroidManifest.xml.
  • If you are using a custom activity, update your MainActivity.java:
import io.flutter.embedding.android.FlutterFragmentActivity;

public class MainActivity extends FlutterFragmentActivity {
    // ...
}

or MainActivity.kt:

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
    // ...
}

MidtransConfig

To start using Midtrans you first need to create an instance of MidtransSDK before using any other of our sdk functionalities.
MidtransSDK receives a MidtransConfig object. This is how you can configure our MidtransSDK instance and connect it to your Midtrans account.

Example:

import 'package:midtrans_sdk/midtrans_sdk.dart';

var config = MidtransConfig(
  clientKey: "",
  merchantBaseUrl: "",
  colorTheme: ColorTheme(
    colorPrimary: Theme.of(context).colorScheme.primary,
    colorPrimaryDark: Theme.of(context).colorScheme.primary,
    colorSecondary: Theme.of(context).colorScheme.secondary,
  ),
);

Initializing the SDK

The next step is to call init which have the required MidtransConfig object parameter config. After we call init we can use all of Midtrans SDK features. Initialize the SDK to enable Midtrans to start payment.

MidtransSDK.init(
    config: config,
);

Starting payment

Start payment method screen

Default mode for midtrans_sdk is showing payment method screen. This screen will show all of your available payment methods. You can enable/disable payment methods via Snap Preferences in MAP.

Start payment by using snap token

We provide SDK method to allow you to make payment by using snap token without initialize transaction request first. You just need to pass snap token as argument of startPaymentUiFlow method.

_midtrans?.startPaymentUiFlow(
    token: "snap-token",
);

카테고리

소스 저장소

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

아직 데이터가 없습니다.