diff options
-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) { |