Airpay Flutter
Airpay Flutter plugin for payment integeration.
Usage
Add airpay_flutter_v4
as a dependency in your pubspec.yaml file.
You can now include a airpayPackage in your project. See the airpayPackage widget's Dartdoc for more details on how to use the widget.
Installation
This plugin is available on Pub: https://pub.dev/packages/airpay_flutter_v4/
Add this to dependencies
in your app's pubspec.yaml
airpay_flutter_v4: ^1.0.7
Just make sure that your activity has set windowSoftInputMode to adjustResize in AndroidManifest.xml
<application>
<activity android:windowSoftInputMode="adjustResize">
</activity>
</application >
Android apps must declare their use of the internet in the Android manifest (AndroidManifest.xml ):
In the AndroidManifest.xml file located at android/app/src/main you need to add this permission inside the manifest tag.
<uses-permission android:name="android.permission.INTERNET" />
Note: For android make sure that the minimum API level for your app is 19 or higher.
Usage
- Learn about the Airpay Payment.
- Sign up Airpay Account and generate the API Keys from the Airpay platform. Using the sandbox keys helps simulate a sandbox environment. No actual monetary transaction happens when using the sandbox keys. Use Live keys once you have thoroughly tested the application and are ready to go live.
- For integration support or technical assistance, please contact the Airpay Tech Help Desk at: techsupport@airpay.co.in.
Using Airpay
For example:
UserRequest user = UserRequest(
privatekey: privatekey.toString(),
checksum: checksum.toString(),
mercid: merchantID,
protoDomain: domainPath,
buyerFirstName: fname.text,
buyerLastName: lname.text,
buyerEmail: email.text,
buyerPhone: phone.text,
buyerAddress: fullAddress.text,
buyerPinCode: pincode.text,
orderid: orderId.text,
amount: amount.text,
buyerCity: city.text,
buyerState: state.text,
buyerCountry: country.text,
currency: "356",
isocurrency: "INR",
chmod: "",
customvar: "",
txnsubtype: txn_subtype.text,
wallet: "0",
isStaging: this.isSandbox,
successUrl: successURL,
failedUrl: failedURL,
appName: "AppName",
colorCode: '0xFF0D47A1',
sb_nextrundate: subscription_date.text,
sb_period: dropdownValue.toString(),
sb_frequency: subscription_frequency.text,
sb_amount: subscription_amount.text,
sb_isrecurring: "",
sb_recurringcount: subscription_rec_count.text,
sb_retryattempts: subRetryValue,
sb_maxamount: subscription_max_amount.text
);
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => new AirPay(
user: user,
closure: (status, response) => {onComplete(status, response)}),
),
);
Android and iOS Platform in a Single Example View
The Airpay flutter package is a lighweight WebView is relying on Platform Views to embed the Android’s webview within the Flutter app. By default a Virtual Display based platform view backend is used,
Airpay SurfaceAndroidWebView()
requires API level 19. The plugin itself doesn't enforce the API level, so if you want to make the app available on devices running this API level or above, add the following to <your-app>/android/app/build.gradle
:
android {
defaultConfig {
// Required by the Flutter WebView plugin.
minSdkVersion 19
}
}