swirepay_sdk

Creator: coderz1093

Last updated:

0 purchases

swirepay_sdk Image
swirepay_sdk Images

Languages

Categories

Add to Cart

Description:

swirepay sdk

Swirepay Flutter SDK #
Swirepay Flutter SDK helps developers implement a cross platform payment experience in their Flutter application. The SDK requires minimal setup to get started and helps developers process payments under 30 seconds while being PCI compliant.
The SDK supports payment flows including simple checkout, saving payment methods, paying invoice, setting up subscriptions, account creation and more.
Requirements #

Android 4.4 (API level 19) and above
Android Gradle Plugin 4.1.0
Gradle 6.7 and above

Integration Steps #
This document reviews about process to integrate Swirepay Flutter SDK with your Flutter application.

Create an account with Swirepay and get the API keys
Integrate the Swirepay flutter SDK into your application
Initiate call - Invoke checkout, payment method, invoice, subscriptions, account creation API from the Swirepay SDK from your application. Swirepay SDK displays appropriate screens.
Receive and handle response - Swirepay SDK returns the payment result for the order which should be handled in your application.

Step 1: Create Account and Get API Keys #

Go to Swirepay Website and create an account. The account credential will be shared through mail.
Log in to your Merchant Dashboard using the credential.
Click the Developer menu and copy the Secret Key. Leverage the test keys if you are testing in test mode. Secret Keys are used to authenticate the API calls made from Swirepay Android SDK.

Publishable Keys are primarily for Client facing web based applications.
Symmetric Keys are primarily for Enterprise clients who need Host-to-Host integration



Step 2: Add Dependency #
Open the pubspec.yaml file located inside the app folder, and add swirepay_sdk: under dependencies
dependencies:
swirepay_sdk: ^1.0.0

copied to clipboard
Step 3: Manifest Changes #
The Swirepay SDK requires that you add the INTERNET permission in your Android Manifest file
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application ...>

copied to clipboard
Step 4: Android Gradle #
Set Android Gradle Plugin version to 4.1.0 or higher Set Android Gradle version to 6.7 or higher
Step 5: Initiate call #
The SwirepaySdk class is the entry-point to the Swirepay SDK. It must be instantiated with a [Swirepay publishable/Secret key].
SwirepaySdk.initiateSDK("pk_test_key")
1. Payment Link
PaymentRequest(
String amount,
String currencyCode,
String notificationType,
List<String> paymentMethodType,
String description,
String dueDate,
Customer customer,
String customerGid);
copied to clipboard
Customer(
String email,
String name,
String phoneNumber,
String taxId,
String taxStatus,
String taxValue);
copied to clipboard
var response = await SwirepaySdk.createPaymentLink(context, paymentRequest);
copied to clipboard
2.Subscription Button
SubscriptionRequest(
String planName,
int planAmount,
String planDescription,
String currencyCode,
String billingFrequency,
int billingPeriod,
String planStartDate,
List<String> taxRates,
String couponId,
int planQuantity,
int planTotalPayments,
String status);
copied to clipboard
var response =
await SwirepaySdk.createSubscription(context, subscriptionButtonRequest);
copied to clipboard
3.DoPayment
After adding the SDK in dependency, initiate a payment call SwirepaySdk.doPayment().
For payment, your application passes the order info to the SDK. The relevant payment screen is displayed to the customer where they enter the required information and make the payment. After the payment is complete the customers are redirected to the Flutter application and a response is received.
OrderInfo orderInfo = OrderInfo(
"[email protected]",
"+919845789562",
"INR",
"Test",
100);

Customer customer = Customer(
name: "Muthu",
email: "[email protected]",
phoneNumber: "+919845789562");
copied to clipboard
Perform payment - Method #1
var response =
await SwirepaySdk.doPayment(context, orderInfo, customer, canShowLogo);
copied to clipboard
Perform payment- - Method #2 Customize screen with own brand colors
var response =
await SwirepaySdk.doPayment(context, orderInfo, customer, canShowLogo, themeData: Theme.of(context));
copied to clipboard
Release #
The changelog provides a summary of changes in each release.
License #
Swirepay_SDK is available under the MIT license.
See the LICENSE file for more info.

License

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

Files In This Product:

Customer Reviews

There are no reviews.