Make Payment

Step 1 - Initiate SDK

var initData = {
          "merchantKey": "Your Merchant Key",
          "customColor": "#1E8449",
        };
   await FoloosiPlugins.init(json.encode(initData));

sample escape string

merchantKey: 'key_\$2\$1\$1xxxxxxxxxxxxxxxxxxxxx'

Important Note - You can Follow any one of the methods below to initiate payment widget

a. Make Payment with order object

Create Order Data Object with necessary inputs

You can create the order data or payment input with our OrderData Model class. Here you need to provide order id, title, description, currency code, order amount and customer details like name, email and mobile number.

var orderData = {
          "orderId": "521",
          "orderDescription": "Order Description",
          "orderAmount": double.parse(amountTextField.text),
          "state": "",
          "postalCode": "",
          "country": "ARE",
          "currencyCode": "AED",
          "customerUniqueReference": "",
          "customer": {
            "name": "Foloosi Test",
            "email": "[email protected]",
            "mobile": "501234567",
            "code": "",
            "address": "",
            "city": "",
          },
        };
var result = await FoloosiPlugins.makePayment(json.encode(orderData));
if (kDebugMode) {
          print("Payment Response: $result");
}

*Important Note*

orderData.customerUniqueReference = "Unique value"

// Unique value must be customer id/email/mobile number for saved card feature.

Now make payment with order data you created above.

b.make Payment with reference token

Initialize api

Get Reference Token

POST https://api.foloosi.com/aggregatorapi/web/initialize-setup

Headers

Request Body

{
 "message": "Application setup successfully",
 "data": {
   "reference_token":
   "U0sjdGVzdF8kMnkkMTAkM21LRi0xZGliVDhldTV4NHlZSm9tZXZobnZxWTNEVnZmay1MdHNndTNFenNBTDU0clhWYkccVE4jRkxTQVBJNWM3Njk2ZDkwOWIzNxxSVCMkMnkkMTAkQXZ4ay9wdjlpTFlYLzRSZ2FjSkxpZWhHb2o0U0wvTFpZNXAyVjRGOVFycWNQZ2lHQ3VEZ08="
  }
 }
var referenceToken = "YOUR REFERENCE TOKEN";
var result = await FoloosiPlugins.makePaymentWithReferenceToken(referenceToken);
if (kDebugMode) {
          print("Payment Response: $result");
}

Api Specification

  • Request call must be in POST.

  • With this api only your going to confirm which feature you are using.

  • For Saved Card Payment Method, You need to pass your customer unique details like email,etc., in customer_unique_identifier.

Post Request Body

Support

Visit https://www.foloosi.com for support requests or email to [email protected].

Developed by

Foloosi Technologies Pvt Ltd.

License

Copyrights (c) 2024 Foloosi

Last updated