auropay_payments_sandbox

Last updated:

0 purchases

auropay_payments_sandbox Image
auropay_payments_sandbox Images
Add to Cart

Description:

auropay payments sandbox

Auropay sandbox Plugin. #
Getting Started #
AuroPay plugin allows you to accept in-app payments providing you with the building blocks, to create a seamless checkout experience for iOS and Android apps.
Pubspec.yaml Setup #
To add AuroPay Flutter plugin to your project from Pub.dev, follow the below steps.
Step-1. Add the code given below to your project's pubspec.yaml file, if this is not already added.
dependencies:
auropay_payments_sandbox: ^1.0.3

// or run in terminal
$ flutter pub add auropay_payments_sandbox
copied to clipboard
Step- 2. Run in terminal
$ flutter pub get
copied to clipboard
Now, the AuroPay plugin will be added to your project.
Note: for Android, it is required to add internet permission in the manifest file
<uses-permission android:name="android.permission.INTERNET"/>
copied to clipboard
For iOS add camera permission in info.plist file
<key>NSCameraUsageDescription</key>
<string>Needs access to your camera to scan your card.</string>
copied to clipboard
Using SDK #
To use the AuroPay Flutter plugin for payment transactions the SDK should be initialized prior to initiating any payment request. The AuroPay Plugin can be initialized from main.dart
Initialize SDK #
Construct the required model classes to initialize the plugin, add the following lines in your dart file.
// Create customer profile.
CustomerProfile customerProfileobj = CustomerProfile(
title: "Some Title",
firstName: "First Name",
middleName: "Middle Name",
lastName: "Last Name",
phone: "01234567890",
email: "[email protected]");

// prepare builder with required information
final builder = AuropayBuilder(
subDomainId: keys.merchantId, // your merchant domain name
accessKey: keys.accessKey, // your access key
secretKey: keys.secretKey, // your secret key
customerProfile: customerProfile)
.setAutoContrast(true) // color theme setup for appbar
.setCountry(Country.IN)
.setShowReceipt(true)
.askForCustomerDetail(false)
.getDetailedResponse(false)
.build();
copied to clipboard
Optionally you can also specify a theme for the AuroPay plugin UI elements to match your application theme.
// Create the theme model.
Theme myTheme = AuropayTheme(
primaryColor: const Color(0xff236C6C),
colorOnPrimary: Colors.black,
colorOnSecondary: Colors.redAccent,
secondaryColor: Colors.white);

builder.setTheme(myTheme);
copied to clipboard
Initiate payment request and consume result #
Following code snippet demonstrates how to initiate a payment request and receive callback events.
auropayResponse = await _auropay.doPayment(
builder: builder,
amount: double.parse(amountController.text),
referenceNumber: "mock_reference");

final paymentStatus = ResponseType.success == auropayResponse?.type
? PaymentStatus.success
: PaymentStatus.failed;

String? message;
if (auropayResponse?.data is FailureData) {
FailureData data = auropayResponse?.data as FailureData;
message = 'Payment Failed:\n${data.message}';
}

if (auropayResponse?.data is SuccessData) {
SuccessData data = auropayResponse?.data as SuccessData;
message = 'Payment Success\nTransaction Id: ${data.transactionId}';
}
copied to clipboard
You can get a detailed payment response from the SDK by setting the below parameter to 'true' in builder property.
builder.getDetailedResponse(true) // default it is false
copied to clipboard
By following the steps outlined in this document, you should be able to successfully integrate the AuroPay Flutter plugin into your mobile application and process payments seamlessly.
If you are facing any trouble, reach out to us at [email protected]

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.