intram_sdk_flutter
Intram SDK Flutter is a Flutter package that simplifies the implementation of mobile payment with Intram. With it, you can make a full or simple payment Full payment consists in asking the user to enter all his or her personal personal information
The simple payment consists in asking the user only for the mobile payment number.
Installation
Add this line to your pubspec.yaml:
dependencies:
intram_sdk_flutter: ^0.0.1
Usage
Import
import 'package:intram_sdk_flutter/intram_sdk_flutter.dart';
Setting
API GENERATE YOUR KEYS
API keys are your digital references to Intram systems. We use them to identify your account and the applications you create. These keys are necessary for any integration of Intram's payment payment APIs. Here are the steps to follow:
- First, you must have an active Intram Business account. Create one if you don't yet.
- Login](https://app.intram.org/login) to your account and click on Developers in the left-hand menu. menu on the left.
- Then click on API, and you'll see all your API keys.
- You can switch to SANDBOX mode or activate LIVE mode. Login to your Intram account, click on Developer, then on API. API keys and give them as arguments to the controller. Initialize Intram by entering, in order: PUBLIC_KEY, PRIVATE_KEY, INTRAM_SECRET, INTRAM_MARCHAND_KEY, MODE The mode: true for live mode and false for test mode.
Settings keys
String public_key =
"6a695a2def2ba8e68c773a260f95c0a081e05e79fa6f55a815ef815244e8083a";
String private_key =
"tpk_6296f02e367ddee79462671b54dbe568e12f4f41b0bf6b8f758de56cd1ccc68d";
String secret_key =
"tsk_e29b25acdef149504854a5dc8c63ff472598c865b38e0829ebb984f3c93b8d16";
String merchant_key = "5ef22f1df84ed86d57b17519";
Full Implementation
bool required_user_information = true;
dynamic custom_user_information = {};
Simple Implementation
bool required_user_information = false;
dynamic custom_user_information = {
"message":"Bienvenue sur Hangbé Store, veuillez éffectuer votre paiement pour faire cette commande",
"firstname": "Client",
"lastname": "Hangbé",
"email": "contact@hangbe.com"
};
Implementation
IntramSdkPayment intramSdkPayment = IntramSdkPayment(
public_key, private_key, secret_key, merchant_key,
required_user_information, custom_user_information);
public_key
- merchant account public keyprivate_key
- private merchant account keysecret_key
- secret merchant account keymerchant_key
- merchant account keyrequired_user_information
- this variable is set totrue
when full andfalse
if the mode is is simplecustom_user_information
- contains default values ifrequired_user_information
isfalse
.message
- the default message to be displayed on payment to the userfirstname
- a default name (your company)lastname
- a default name (your company)email
- a default email (your contact email)
Make Payment
int amount = 5000;
bool sandbox = true;
String store_name = "Hangbé Store";
String color = "#08a0cf";
String logo = "https://img-prod-cms-rt-microsoft-com.akamaized.net";
dynamic init_payment_result = await intramSdkPayment.makePayment(
context, amount, sandbox, store_name, color, logo);
amount
- the amount paid by the usersandbox
-true
orfalse
modestore_name
- company namecolor
- color used for templatelogo
- logo link
Make Payment Return
{success: true, transaction: PJ2flG2YVc}
Get transaction
dynamic transaction = await intramSdkPayment.getTransaction(init_payment_result["transaction"]);
Contributions
All contributions are welcome!
Libraries
- controllers/payment_controller
- core/api_client
- core/color_constant
- core/constants
- core/functions
- core/size_utils
- intram_sdk_flutter
- models/country
- screens/IntramPaymentScreen
- screens/payment_card
- screens/payment_mobile_screen
- widgets/common_image_view
- widgets/custom_drop_down_country
- widgets/custom_text_form_field
- widgets/loading