shurjopay_sdk 1.2.2 copy "shurjopay_sdk: ^1.2.2" to clipboard
shurjopay_sdk: ^1.2.2 copied to clipboard

discontinued
outdated

Flutter shurjoPay SDK. shurjoPay, one of the leading payment gateways in Bangladesh, with technology and simplicity to build the most secure payment experience for your business.

office-sm-flutter-shurjopay-sdk-v2 #

Office SM Flutter shurjoPay SDK V2

pub package GitHub

GIT Command #

git init
git remote add origin https://github.com/rzrasel/office-sm-flutter-shurjopay-sdk-v2.git
git remote -v
git fetch && git checkout master
git add .
git commit -m "Add Readme & Git Commit File"
git pull
git push --all
git status
git remote show origin
git status

Usage #

Flutter Environment: flutter environment sdk and flutter version

sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"

Add dependencies: shurjopay_sdk

dependencies:
    connectivity_plus: ^2.1.0
    http: ^0.13.4
    webview_flutter: ^3.0.0
    shurjopay_sdk: ^latest_version

Import package:

import "package:shurjopay_sdk/shurjopay_sdk.dart";

Android build.gradle

defaultConfig {
    minSdkVersion 20
}

Android AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET"/>

Request Data Model Setup: #

// TODO request data model setup
RequiredRequestData requiredRequestData = RequiredRequestData(
    username:           "username",
    password:           "password",
    prefix:             "prefix",
    currency:           "currency",
    amount:             1,
    orderId:            "order_id",
    discountAmount:     0,
    discPercent:        0,
    customerName:       "customer_name",
    customerPhone:      "customer_phone",
    customerEmail:      "customer_email",
    customerAddress:    "customer_address",
    customerCity:       "customer_city",
    customerState:      "customer_state",
    customerPostcode:   "customer_postcode",
    customerCountry:    "customer_country",
    returnUrl:          "return_url",
    cancelUrl:          "cancel_url",
    clientIp:           "client_ip",
    value1:             "value1",
    value2:             "value2",
    value3:             "value3",
    value4:             "value4",
);

Response Listener: #

// TODO response listener
onSuccess:          (BuildContext context, ErrorSuccess errorSuccess)
onFailed:           (BuildContext context, ErrorSuccess errorSuccess)

Response Listener Setup: #

// TODO request response listener setup
ShurjopaySdk shurjopaySdk = ShurjopaySdk(
    onSuccess: (BuildContext context, ErrorSuccess errorSuccess) {
        // TODO you get success response, if the transection is succefully completed.
    },
    onFailed: (BuildContext context, ErrorSuccess errorSuccess) {
        // TODO you get failed response, if the transection is failed or canceled.
    }
);

Payment Request Setup: #

// TODO payment request setup
shurjopaySdk.makePayment(
    context:    context,
    sdkType:    "sdk request type live or sandbox", //TODO live/sandbox request
    data:       requiredRequestData,
);

Response Listener Setup Extended: #

// TODO request response listener setup
ShurjopaySdk shurjopaySdk = ShurjopaySdk(
    /// TODO you get success response, if the transection is succefully completed.
    onSuccess: (BuildContext context, ErrorSuccess errorSuccess) {
        switch (errorSuccess.esType) {
            case ESType.INTERNET_SUCCESS:
                debugPrint("DEBUG_LOG_PRINT: surjoPay SDK SUCCESS: ${errorSuccess.message}");
                break;
            case ESType.SUCCESS:
                debugPrint("DEBUG_LOG_PRINT: surjoPay SDK SUCCESS TransactionInfo:");
                transactionInfo?.onPrint();
                break;
        }
        debugPrint("DEBUG_LOG_PRINT: surjoPay SDK SUCCESS: ${errorSuccess.esType.name}");
    },

    /// TODO you get failed response, if the transection is failed or canceled.
    onFailed: (BuildContext context, ErrorSuccess errorSuccess) {
        switch (errorSuccess.esType) {
            case ESType.INTERNET_ERROR:
                debugPrint("DEBUG_LOG_PRINT: surjoPay SDK ERROR: ${errorSuccess.message}");
                break;
            case ESType.HTTP_CANCEL:
                debugPrint("DEBUG_LOG_PRINT: surjoPay SDK ERROR: ${errorSuccess.message}");
                break;
            case ESType.ERROR:
                debugPrint("DEBUG_LOG_PRINT: surjoPay SDK ERROR: ${errorSuccess.message}");
                break;
        }
        debugPrint("DEBUG_LOG_PRINT: surjoPay SDK ERROR: ${errorSuccess.message}");
    },
);

Payment Request Type: #

// TODO payment request type
AppConstants.SDK_TYPE_SANDBOX
// TODO or
AppConstants.SDK_TYPE_LIVE

Payment Success Respons: #

onSuccess: (BuildContext context, TransactionInfo transactionInfo) {
    // TODO you get success response, if the transection is succefully completed.
    int?    id                  = transactionInfo.id;
    String  orderId             = transactionInfo.orderId;
    String? currency            = transactionInfo.currency;
    double? amount              = transactionInfo.amount;
    double? payableAmount       = transactionInfo.payableAmount;
    double? discsountAmount     = transactionInfo.discsountAmount;
    double? discPercent         = transactionInfo.discPercent;
    double? usdAmt              = transactionInfo.usdAmt;
    double? usdRate             = transactionInfo.usdRate;
    String? cardHolderName      = transactionInfo.cardHolderName;
    String? cardNumber          = transactionInfo.cardNumber;
    String? phoneNo             = transactionInfo.phoneNo;
    String? bankTrxId           = transactionInfo.bankTrxId;
    String? invoiceNo           = transactionInfo.invoiceNo;
    String? bankStatus          = transactionInfo.bankStatus;
    String? customerOrderId     = transactionInfo.customerOrderId;
    int?    spCode              = transactionInfo.spCode;
    String? spMassage           = transactionInfo.spMassage;
    String? name                = transactionInfo.name;
    String? email               = transactionInfo.email;
    String? address             = transactionInfo.address;
    String? city                = transactionInfo.city;
    String? transactionStatus   = transactionInfo.transactionStatus;
    String? dateTime            = transactionInfo.dateTime;
    String? method              = transactionInfo.method;
    String? value1              = transactionInfo.value1;
    String? value2              = transactionInfo.value2;
    String? value3              = transactionInfo.value3;
    String? value4              = transactionInfo.value4;
}

Payment Request Data Model (Data Type): #

CheckoutRequestData
String  token;
int     storeId;
String  prefix;
String  currency;
String  returnUrl;
String  cancelUrl;
double  amount;
String  orderId;
double? discsountAmount;
double? discPercent;
String  clientIp;
String  customerName;
String  customerPhone;
String? customerEmail;
String  customerAddress;
String  customerCity;
String? customerState;
String? customerPostcode;
String? customerCountry;
String? value1;
String? value2;
String? value3;
String? value4;

Payment Respons Data Model (Data Type): #

TransactionInfo
int?    id;
String  orderId;
String? currency;
double? amount;
double? payableAmount;
double? discsountAmount;
double? discPercent;
double? usdAmt;
double? usdRate;
String? cardHolderName;
String? cardNumber;
String? phoneNo;
String? bankTrxId;
String? invoiceNo;
String? bankStatus;
String? customerOrderId;
int?    spCode;
String? spMassage;
String? name;
String? email;
String? address;
String? city;
String? transactionStatus;
String? dateTime;
String? method;
String? value1;
String? value2;
String? value3;
String? value4;

Flutter shurjoPay SDK v2 Version <1.2.0 #

Response Listener (Version <1.2.0): #

// TODO response listener
onSuccess:          (BuildContext context, TransactionInfo transactionInfo)
onFailed:           (BuildContext context, String message)
onInternetFailed:   (BuildContext context, String message)

Response Listener Setup (Version <1.2.0): #

// TODO request response listener setup
ShurjopaySdk shurjopaySdk = ShurjopaySdk(
    onSuccess: (BuildContext context, TransactionInfo transactionInfo) {
        // TODO you get success response, if the transection is succefully completed.
    },
    onFailed: (BuildContext context, String message) {
        // TODO you get failed response, if the transection is failed or canceled.
    },
    onInternetFailed: (BuildContext context, String message) {
        // TODO you get internet failed message, if the internet is not connected or on internet.
    },
);

Payment Request Setup (Version <1.2.0): #

// TODO payment request setup
shurjopaySdk.makePayment(
    context:    context,
    sdkType:    "sdk request type live or sandbox", //TODO live/sandbox request
    data:       requiredRequestData,
);

Flutter shurjoPay SDK v2

Flutter library publish in pub.dev

  • Execute flutter pub publish --dry-run
  • Publish flutter pub publish

Android Studio MacBook Pro: d5N3zwFKoh1k6yVcMSmg2MuC060mkS-pghp_Ec7xmc

2
likes
0
points
41
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter shurjoPay SDK. shurjoPay, one of the leading payment gateways in Bangladesh, with technology and simplicity to build the most secure payment experience for your business.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

connectivity_plus, flutter, flutter_web_plugins, http, webview_flutter

More

Packages that depend on shurjopay_sdk

Packages that implement shurjopay_sdk