0 purchases
switchpay
Switchpay is an intelligent system of routing payment traffic via various payment aggregrators (PA).
Configuration #
iOS #
Add below keys in info.plist using Xcode. The steps that has to be followed are:
Open your project target's info.plist file.
Add a Key called NSAppTransportSecurity as a Dictionary.
Add a Subkey called NSAllowsArbitraryLoads as Boolean and set its value to YES.
or
In source code of info.plist file we can add that:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
copied to clipboard
Android #
Add the below line in your application tag of AndroidManifest.xml:
android:usesCleartextTraffic="true"
copied to clipboard
As shown below:
<application
....
android:usesCleartextTraffic="true"
....>
copied to clipboard
Usage #
To use this plugin, add switchpay as a dependency in your pubspec.yaml file.
The switchpay package can be imported using:
import 'package:switchpay/switchpay.dart';
copied to clipboard
Example #
Switchpay(
context: context,
url: 'your_context',
token: 'your_token',
uuid: 'your_uuid',
orderId: 'your_unique_order_id',
amount: 'transactional_amount',
name: 'customer_name',
emailId: 'customer_email',
mobileNumber: 'customer_mobile_number',
description: 'description_for_record',
enabledModeOfPayment: 'instrument like upi or cc',
onInitLoading: (isLoading) {
// TODO: Show loading action while redirecting.
},
onTransactionCompleted: (status) {
// TODO: Action after transaction completion. (Deprecated)
},
onTransactionDone: (status) {
// TODO: Action after transaction completion. (Deprecated)
},
onTransactionFinished: (status) {
// TODO: Action after transaction completion. (Recommended)
},
onErrorOccurred: (error) {
// TODO: Action if any error occured.
});
onCancel: (error) {
// TODO: Action if user click on back button.
});
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.