TipTopPay SDK for Flutter
A Flutter plugin for integrating TipTopPay payments in Android and iOS applications.
Supports
X
Check the validity of the card's parameters.X
Generate card cryptogram packet.X
Show 3ds dialog.
Getting Started
Initializing for Android
If you want to show 3ds dialog on Android, make MainActivity implements FlutterFragmentActivity
instead of FlutterActivity
android/app/src/main/.../MainActivity.kt
:
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterFragmentActivity() {}
Usage
- Check card number validity.
bool isValid = await TipTopPaySdk.isValidNumber(cardNumber);
- Check card expire date.
bool isValid = await TipTopPaySdk.isValidExpireDate(cardNumber); // MM/yy
- Generate card cryptogram packet. You need to get your publicId from your personal account and you need apiUrl (for example: https://api.tiptoppay.kz/)
final cryptogram = await TipTopPaySdk.createHexPacketFromData(
event.cardNumber,
event.expiryDate,
event.cvcCode,
Constants.MERCHANT_PUBLIC_ID,
Constants.API_URL
);
- Showing 3DS form and get results of 3DS auth.
final result = await TipTopPaySdk.show3ds(
acsUrl,
transactionId,
paReq,
);
Apple Pay
- Create instance of TipTopPayApplePay.
final applePay = TipTopPayApplePay();
- Check whether Apple Pay is available on this device and can process payment requests.
final isApplePayAvailable = await applePay.isApplePayAvailable();
- Request payment.
final paymentToken = await applePay.requestApplePayPayment(
merchantId: 'merchant.com.YOURDOMAIN',
currencyCode: 'KZT',
countryCode: 'KAZ',
products: [
{"name": "Red apple", "price": "170"},
{"name": "Mango", "price": "250.50"},
{"name": "Delivery", "price": "100"},
{"name": "Discount", "price": "-89.90"},
{"name": "Total", "price": "430.60"},
],
);
Now you can use paymentToken for payment by a cryptogram.
Google Pay
- Create instance of TipTopPayGooglePay. Pass Google Pay Evironemnt (test or production) into constructor.
final googlePay = TipTopPayGooglePay(GooglePayEnvironment.production);
- Check whether Google Pay is available on this device and can process payment requests.
final isGooglePayAvailable = await googlePay.isGooglePayAvailable();
- Request payment.
final result = await googlePay.requestGooglePayPayment(
price: '123.45',
currencyCode: 'KZT',
countryCode: 'KAZ',
merchantName: 'Example Merchant',
publicId: 'test_api_00000000000000000000002',
);
if (result != null) {
if (result.isSuccess) {
final paymentToken = result.token;
}
}
Now you can use paymentToken for payment by a cryptogram.
Libraries
- common/apple_pay_response
- common/cryptogram
- common/google_pay_response
- common/response_statuses
- common/three_ds_response
- common/tiptoppay_apple_pay
- common/tiptoppay_google_pay
- network/api
- network/network
- network/public_key
- network/urls
- tiptoppay_sdk
- tiptoppay_sdk_method_channel
- tiptoppay_sdk_platform_interface