flutter_paystack icon indicating copy to clipboard operation
flutter_paystack copied to clipboard

Invalid Transaction when using Bank to make payment

Open Leekogram opened this issue 3 years ago • 3 comments

Simulator Screen Shot - iPhone 14 Pro Max - 2023-04-18 at 09 41 53

Please all i get is Invalid Transaction when trying to make payment using bank below is my function. what could be the problem ?

processPaystackPayment({required skKey, context}) async {

Charge charge = Charge()
  ..amount = (widget.paymentAmount * 100)
  ..reference = _getReference()
  ..accessCode = await _paymentRepository.createAccessCode(
      _getReference(),
      widget.paymentAmount * 100,
      userDetails.emailAddress.toString(),
      skKey)
  ..email = userDetails.emailAddress.toString();

CheckoutResponse response = await plugin.checkout(context,
    method:
        CheckoutMethod.selectable, 
    charge: charge,
    fullscreen: true);

print(response);

if (response.status == true) {
  var res = await _paymentRepository.verifyOnServer(
      response.reference.toString(), skKey);

  if (res == 'success') {
    var obj = widget.bookingModel;
    obj.paymentReference = response.reference.toString();
    transacRefernceId = response.reference.toString();
    log(jsonEncode(obj));

    ref.read(bookingFutureProvider.notifier).initiateReservation(obj);
  }
} else {
  if (kDebugMode) {
    print('failed here');
  }
  Navigator.of(context).pop();
}

}

Leekogram avatar Apr 18 '23 08:04 Leekogram

Please can someone answer me Please i running out of time.

Leekogram avatar Apr 19 '23 17:04 Leekogram

have you found solution ?

thekeplertech avatar Sep 22 '23 12:09 thekeplertech

have you found solution ?

Nope, what I did was, I just made the app process card payment instead. And I was thinking of using paystack web plugin in a web view probably if I am still in need of the bank payment

Leekogram avatar Sep 23 '23 05:09 Leekogram