flutter_sslcommerz

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter sslcommerz

Welcome to SSLCommerz Flutter Plugin! #
This is the official SSLCommerz flutter plugin for Flutter application integration. For, now it only supports Android and iOS only.
Deployment Target #

For iOS : Deployment Target : 11.0
For Android : minSdkVersion 18

For a payment call please use the below template: #
Initialization #
First of all, initialize the sslcommerz SDK with some mandatory fields.

Here, fill the ipn_field, if you have a valid one, or it will fail
the transaction.

Sslcommerz sslcommerz = Sslcommerz(
initializer: SSLCommerzInitialization(
// ipn_url: "www.ipnurl.com",
multi_card_name: "visa,master,bkash",
currency: SSLCurrencyType.BDT,
product_category: "Food",
sdkType: SSLCSdkType.TESTBOX,
store_id: "your_store_id",
store_passwd: "your_store_password",
total_amount: "payment_amount",
tran_id: "custom_transaction_id"));
copied to clipboard
To customized the payment, initiate the below vertices as required for your business #
Add EMI option with the below code snippet:
sslcommerz
.addEMITransactionInitializer(
sslcemiTransactionInitializer: SSLCEMITransactionInitializer(
emi_options: 1));
copied to clipboard
Add SHIPMENT information with below code snipptet:
sslcommerz.addShipmentInfoInitializer(
sslcShipmentInfoInitializer: SSLCShipmentInfoInitializer(
shipmentMethod: "yes",
numOfItems: 5,
shipmentDetails: ShipmentDetails(
shipAddress1: "Ship address 1",
shipCity: "Faridpur",
shipCountry: "Bangladesh",
shipName: "Ship name 1",
shipPostCode: "7860")));
copied to clipboard
Add CUSTOMER information with the below shippet:
sslcommerz.addCustomerInfoInitializer(
customerInfoInitializer: SSLCCustomerInfoInitializer(
customerState: "Chattogram",
customerName: "Abu Sayed Chowdhury",
customerEmail: "sayem227@gmail.com",
customerAddress1: "Chattogram",
customerCity: "Chattogram",
customerPostCode: "200",
customerCountry: "Bangladesh",
customerPhone: formData['phone']));
copied to clipboard

Add only one product from the below. Adding multiple type of product
may create conflicts.

To add general product please use the below snippet:
sslcommerz.addProductInitializer(
sslcProductInitializer:
SSLCProductInitializer(
productName: "Water Filter",
productCategory: "Widgets",
general: General(
general: "General Purpose",
productProfile: "Product Profile"));
copied to clipboard
To add non-physical goods as your product use the below snippet:
sslcommerz.addProductInitializer(
sslcProductInitializer:
SSLCProductInitializer.WithNonPhysicalGoodsProfile(
productName: "productName",
productCategory:"productCategory",
nonPhysicalGoods:
NonPhysicalGoods(productProfile: "Product profile",
nonPhysicalGoods:"non physical good"
)));
copied to clipboard
To add travel vertices as your product use the below snippet:
sslcommerz.addProductInitializer(
sslcProductInitializer:
SSLCProductInitializer.WithTravelVerticalProfile(
productName:"productName",
productCategory:"productCategory",
travelVertical:TravelVertical(
productProfile: "productProfile",
hotelName: "hotelName",
lengthOfStay: "lengthOfStay",
checkInTime: "checkInTime",
hotelCity: "hotelCity"
)));
copied to clipboard
To add travel vertices as your product use the below snippet:
sslcommerz.addProductInitializer(
sslcProductInitializer:
SSLCProductInitializer.WithPhysicalGoodsProfile(
productName: "productName",
productCategory: "productCategory",
physicalGoods: PhysicalGoods(
productProfile: "Product profile",
physicalGoods: "non physical good"
)));
copied to clipboard
To add TELECOM as your product use the below snippet:
sslcommerz.addProductInitializer(
sslcProductInitializer:
SSLCProductInitializer.WithTelecomVerticalProfile(
productName: "productName",
productCategory: "productCategory",
telecomVertical: TelecomVertical(
productProfile: "productProfile",
productType: "productType",
topUpNumber: "topUpNumber",
countryTopUp: "countryTopUp"
)));
copied to clipboard
You can add optional parametes with the payment sdk by adding the below snippet: #
sslcommerz.addAdditionalInitializer(
sslcAdditionalInitializer: SSLCAdditionalInitializer(
valueA: "value a ",
valueB: "value b",
valueC: "value c",
valueD: "value d"));
copied to clipboard
And then finally sslcommerz.payNow(); will initiate the SDK to complete the payment process.
Prerequisite: #

Add Comment out this code in in you android>manifest file

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<!-- xmlns:tools="http://schemas.android.com/tools" -->
package="com.example.flutter_sslcommerze_example">
copied to clipboard

In application tag add this comment out code

<!-- tools:replace="android:label"
android:usesCleartextTraffic="true" -->
copied to clipboard

Add Comment out this code in android>app>build level

buildTypes {
release {
signingConfig signingConfigs.debug
// shrinkResources false
// minifyEnabled false
}
}
copied to clipboard

License

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

Customer Reviews

There are no reviews.