diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-10-31 19:27:06 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-10-31 19:27:06 +0800 |
commit | dacb1ed2bd28bc9298a219e6236e65427965deca (patch) | |
tree | ac39296baea59abc59b5e822789939a49d3679df /midtrans.dart | |
parent | e420337aff8ed75d91e60176b43728ac1e6db438 (diff) |
Status interface for Dart
Diffstat (limited to 'midtrans.dart')
-rw-r--r-- | midtrans.dart | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/midtrans.dart b/midtrans.dart index 0793d6f..3855925 100644 --- a/midtrans.dart +++ b/midtrans.dart @@ -18,6 +18,8 @@ class MidtransBanktransfer extends Struct { Pointer<Utf8> permata; } +typedef MidtransStatus = Pointer<Utf8> Function(Pointer<Utf8>); + typedef MidtransChargeBanktransfer = Pointer<Utf8> Function(MidtransBanktransfer, MidtransTransaction, Array<Pointer<Utf8>>); @@ -41,6 +43,15 @@ class Midtrans { calloc.free(pemUtf8); } + String status(String orderID) { + final midtrans_status = dylib.lookupFunction<MidtransStatus, + MidtransStatus>('midtrans_status'); + final order_id = orderID.toNativeUtf8(); + final status = midtrans_status(order_id).toDartString(); + calloc.free(order_id); + return status; + } + String chargeBanktransfer(MidtransBanktransfer payment, MidtransTransaction transaction, Array<Pointer<Utf8>> customFields) { |