Foloosi
  • INTRODUCTION
  • FEATURES
  • Get Started
    • Create Api Credentials
    • Checkout Page Customization
  • Payment Methods
    • Popup Payment Method
    • Hosting Payment Method
    • Saved Card Payment Method
  • CLIENT SIDE INTEGRATIONS
    • Javascript Integration
      • Create Payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
      • Sample Integrations
    • PHP Integration
      • Create Payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
      • Sample integrations
    • React JS Integration
      • Create payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
    • Angular JS Integration
      • Create payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
  • ECOMMERCE INTEGRATIONS
    • WooCommerce
    • CS Cart
    • Ecwid
    • Opencart
    • Magento
    • Prestashop
  • MOBILE SDK INTEGRATIONS
    • Android SDK
      • Initiate Payment
      • Payment Response Handling
    • iOS SDK
      • Initiate Payment
      • Payment Response Handling
    • React Native SDK
      • Make Payment
    • Flutter SDK
      • Installation
      • Make Payment
      • Sample Dart Program
  • SUBSCRIPTIONS
    • Foloosi Subscription for WooCommerce
    • Api Subscription
      • Sample Integration
    • Subscription
  • WEBHOOKS
  • PARTNER PAYOUT
  • CARD DETAILS
    • Test Cards
Powered by GitBook
On this page
  • Support
  • Developed by
  • License

Was this helpful?

  1. CLIENT SIDE INTEGRATIONS
  2. Javascript Integration

Payment Response Handling

Let's see how to handle payment response !

Foloosi payments has two types of responses,

  • Foloosi handler for Popup Payment method.

  • Request post object for Hosting Payment method.

a. Foloosi handler

/* Foloosi handler for payment response handling
 * Add the below code inside the script tag to handle payment response
*/
    foloosiHandler(response, function (e) {
      if(e.data.status == 'success'){
        //responde success code
        //console.log(e.data.status);
        //console.log(e.data.data.transaction_no);
      }
      if(e.data.status == 'error'){
        //responde success code
        //console.log(e.data.status);
        //console.log(e.data.data.payment_status);
      }
      if(e.data.status == 'closed'){
        //Payment Popup Closed
        //console.log(e.data);
      }
    };

b. Redirects to site_return_url with post data

//sample post response
{
    "status": "success",
    "data": {
        "amount": 12.00,
        "currency": "AED",
        "transaction_no": "FLSXXXXXXXXXXABC",
        "optional1": "additional_field",
        "optional2": "additional_field",
        "optional3": "additional_field",
    }
}

Support

Developed by

Foloosi Technologies Pvt Ltd.

License

Copyrights (c) 2025 Foloosi

PreviousPayment Widget InitializationNextAdditional Setup

Last updated 1 month ago

Was this helpful?

Visit for support requests or email to [email protected].

https://www.foloosi.com