Skip to content

Latest commit

 

History

History
75 lines (52 loc) · 2.55 KB

README.md

File metadata and controls

75 lines (52 loc) · 2.55 KB

Introduction

This is a Flutter package that gives you the ability to integrate the power of Squad Payment Gateway to your Android and iOS Applications. It is also suitable for developers using Firebase or Supabase for backend. You can initiate payment and also checkout right from your Flutter app.

iOS Preview

Screenshot 2024-03-12 at 7 50 13 PM Screenshot 2024-03-12 at 7 50 45 PM

Android Preview

Screenshot 2024-03-12 at 7 47 23 PM Screenshot 2024-03-12 at 7 46 45 PM

Features

Initiate payment and checkout, If you do not want to generate from your back end server Checkout only if you initiate payment from your backend server Verify payment with transaction Reference

Getting started

To get started make sure you have created an account on https://squadco.com/ . If you want a test account you can create an account on https://sandbox.squadco.com/login just for development

Usage

To initiate a payment and also checkout you need to call the initializeAndCheckout() function in SquadPay class.

//Initiate payment and checkout
    SquadPay.initializeAndCheckout(
    context, 
    Environment.test, 
    "<-Enter your Secret Key here->",     //your secret key ca be found on your squadco.com dashboard
    InitialPayload(
        amount: 55000,
        email: "[email protected]",
        currency: "NGN",
        initiateType: "inline",
        transactionRef: SquadPay.generateTransactionRef(16) , //Generate random transaction reference
        callbackUrl: "https://google.com",
        
    ));

To checkout after initializing payment from another source (i.e your backend server), call checkOut() function like so:

//Checkout only
    SquadPay.checkOut(
      context,
    '<-Enter your checkout URL here->',
    '<-Enter your call-back URL here->'
    );    

To verify if a transaction is successful or not we use this code snippet below

//Verify transaction 
final transactionResponse = await SquadPay.verifyTransaction(
    Environment.test,
    "<-SECRET -KEY->",
    "yVJ2KXwvtc" // transaction Ref
);