From dacb1ed2bd28bc9298a219e6236e65427965deca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 31 Oct 2022 19:27:06 +0800 Subject: Status interface for Dart --- midtrans.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'midtrans.dart') 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 permata; } +typedef MidtransStatus = Pointer Function(Pointer); + typedef MidtransChargeBanktransfer = Pointer Function(MidtransBanktransfer, MidtransTransaction, Array>); @@ -41,6 +43,15 @@ class Midtrans { calloc.free(pemUtf8); } + String status(String orderID) { + final midtrans_status = dylib.lookupFunction('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> customFields) { -- cgit v1.2.3