diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-10-25 21:01:00 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-10-25 21:01:00 +0800 |
commit | 06ac2fc5d785c4ed57b228000cebfaefee12c6c9 (patch) | |
tree | cc412a0e505a588491e0a4818c7b1bcc7454898f /midtrans.dart | |
parent | 0d6548a94f8ecf57032d919f35c8f2c8d8c36a4f (diff) |
Lose the pointer on structs
Diffstat (limited to 'midtrans.dart')
-rw-r--r-- | midtrans.dart | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/midtrans.dart b/midtrans.dart index b1bc830..a5e622f 100644 --- a/midtrans.dart +++ b/midtrans.dart @@ -37,31 +37,26 @@ class Midtrans { calloc.free(caInfoUtf8); } - void chargeBanktransfer(Pointer<MidtransBanktransfer> payment, - Pointer<MidtransTransaction> transaction, + void chargeBanktransfer(MidtransBanktransfer payment, + MidtransTransaction transaction, Array<Pointer<Utf8>> customFields) { final midtrans_charge = dylib.lookupFunction - <Void Function(Pointer<MidtransBanktransfer>, - Pointer<MidtransTransaction>, + <Void Function(MidtransBanktransfer, + MidtransTransaction, Array<Pointer<Utf8>>), - void Function(Pointer<MidtransBanktransfer>, - Pointer<MidtransTransaction>, + void Function(MidtransBanktransfer, MidtransTransaction, Array<Pointer<Utf8>>)> ('midtrans_charge_banktransfer'); midtrans_charge(payment, transaction, customFields); - calloc.free((payment as MidtransBanktransfer).bank); - if ((payment as MidtransBanktransfer).va_number - != null) { - calloc.free((payment as MidtransBanktransfer) - .va_number); + calloc.free(payment.bank); + if (payment.va_number != null) { + calloc.free(payment.va_number); } - if ((payment as MidtransBanktransfer).bca != null) { - calloc.free((payment as MidtransBanktransfer) - .bca); + if (payment.bca != null) { + calloc.free(payment.bca); } - if ((payment as MidtransBanktransfer).permata != null) { - calloc.free((payment as MidtransBanktransfer) - .permata); + if (payment.permata != null) { + calloc.free(payment.permata); } calloc.free(transaction.order_id); for (var i = 0; i < 6; i++) { |