onetwothree_sdk 0.0.3 copy "onetwothree_sdk: ^0.0.3" to clipboard
onetwothree_sdk: ^0.0.3 copied to clipboard

A OneTwoThreeSDK Flutter plugin.

OneTwoThreeSDK for Flutter #

pub package Platforms Platforms Language

Getting Started #

Add this to your package's pubspec.yaml file:

dependencies:
  onetwothree_sdk: ^0.0.3

System Requirements #

The SDK has been developed using Dart version >=2.12.0, iOS Deployment Target 11.0, and Android Version 6 (API Level 23). To ensure you can actually compile the sdk smoothly, we recommend to use the developed versions. However if needed, you can convert to your preferred version.

Platform Minimum Version
iOS 11.0
Android 6 (API Level 23)

Initialize #

Please place followings code to main.dart for initialize the sdk.

try {
      await OneTwoThreeSDK.initialize(
        isProduction: false,
        checkSumKey: Platform.isAndroid ? <AndroidConstants.checksumKey> : <iOSConstants.checksumKey>,
        publicKey: Platform.isAndroid ? <AndroidConstants.publicKey> : <iOSConstants.publicKey>,
        privateKey: Platform.isAndroid ? <AndroidConstants.privateKey> : <iOSConstants.privateKey>,
        passphrase: Platform.isAndroid ? <AndroidConstants.passphrase> : <iOSConstants.passphrase>,
        bksPassphrase: Platform.isAndroid ? <AndroidConstants.bksPassphrase> : '',
      );
} on Exception {
  print('Failed to intialize for SDK.');
}

Usage #

Import the library in your file:

import 'package:onetwothree_sdk/onetwothree_sdk.dart';
import 'package:onetwothree_sdk/models/response/start_deeplink_response.dart';

Use the OneTwoThreeSDK with your information like this:

final merchant = Merchant(
    merchantId: "merchant@shopping.com",
    redirectUrl: "",
    notificationUrl: "https://uat2.123.co.th/DemoShopping/apicallurl.aspx",
    merchantData: [
      MerchantData(item: "943-cnht302gg"),
      MerchantData(item: "FH403"),
      MerchantData(item: "10,000.00"),
      MerchantData(item: "Ref. 43, par. 7")
    ]);

final transaction = Transaction(
    merchantReference: "309321249653",
    preferredAgent: "SCB",
    productDescription: "",
    amount: "100",
    currencyCode: "THB",
    paymentInfo: "",
    paymentExpiry: "2021-12-31 11:22:33"
);

final buyer = Buyer(
  email: "example@gmail.com",
  mobile: "09912345678",
  language: "EN",
  notifyBuyer: true,
  title: "Mr",
  name: "John",
  surname: "Doe",
  os: Platform.isAndroid ? "1" : "0",
);

try {
    StartDeeplinkResponse result = await OneTwoThreeSDK.startDeeplink(
        merchant: merchant,
        transaction: transaction,
        buyer: buyer,
    );
    print('result => ${result.toJson()}');
} on Exception catch (e) {
    print('Exception $e');
}
0
likes
120
points
28
downloads

Publisher

verified publisher2c2p.com

Weekly Downloads

A OneTwoThreeSDK Flutter plugin.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on onetwothree_sdk