onetwothree_sdk

Last updated:

0 purchases

onetwothree_sdk Image
onetwothree_sdk Images
Add to Cart

Description:

onetwothree sdk

OneTwoThreeSDK for Flutter #




Getting Started #
Add this to your package's pubspec.yaml file:
dependencies:
onetwothree_sdk: ^0.0.3
copied to clipboard
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.');
}
copied to clipboard
Usage #
Import the library in your file:
import 'package:onetwothree_sdk/onetwothree_sdk.dart';
import 'package:onetwothree_sdk/models/response/start_deeplink_response.dart';
copied to clipboard
Use the OneTwoThreeSDK with your information like this:
final merchant = Merchant(
merchantId: "[email protected]",
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: "[email protected]",
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');
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.