Remita Flutter Inline Payment
A Remita package that helps you accept payment in your flutter application.
Requirements
- Remita API Keys
- Supported Flutter version >= 1.17.0
Installation
- Add the dependency to your project. In your
pubspec.yaml
file add:remita_flutter_inline: 1.0.2
- Run
flutter pub get
Usage
Initializing a RemitaPayment instance
To create an instance, you should call the RemitaInlinePayment constructor with the following as parameters:
BuildContext
PaymentRequest
Customizer
It returns an instance of RemitaInlinePayment
with this instance, we then call the async method .initiatePayment()
.
_handlePayment() async {
PaymentRequest request = PaymentRequest(
environment: RemitaEnvironment.demo,
rrr: 'pass your rrr here',
key: 'enter your key here',
);
RemitaPayment remita = RemitaInlinePayment(
buildContext: context,
paymentRequest: request,
customizer: Customizer(),
);
PaymentResponse response = await remita.initiatePayment();
}
Handling the response
Calling .initiatePayment()
method returns a Future of PaymentResponse
.
PaymentResponse response = await remita.initiatePayment();
if (response.code != null && response.code == '00') {
// transaction successful
// verify transaction status before providing value
} else {
}
TEST CARDS
CARD: 5178 6810 0000 0002,
Expire Date : 05/30,
CCV: 000,
OTP: 123456
License
By contributing to the Flutter library, you agree that your contributions will be licensed under its MIT license.