summaryrefslogtreecommitdiff
path: root/midtrans.h
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-12-06 20:10:34 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-12-06 20:10:34 +0800
commitd26e3419948c3aba72d337da81462162b52efa35 (patch)
treeea014126f1aa1465ca5560aa24eca9654f3c1654 /midtrans.h
parentef807a6284710b0bf20303dd772bc329d6e61d80 (diff)
Payment notification
Diffstat (limited to 'midtrans.h')
-rw-r--r--midtrans.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/midtrans.h b/midtrans.h
index a5c21be..6ed9448 100644
--- a/midtrans.h
+++ b/midtrans.h
@@ -1,6 +1,12 @@
#ifndef MIDTRANS_H
#define MIDTRANS_H
+enum midtrans_transaction_status {
+ MIDTRANS_TRANSACTION_SETTLEMENT = 200,
+ MIDTRANS_TRANSACTION_PENDING,
+ MIDTRANS_TRANSACTION_DENY
+};
+
struct midtrans_transaction {
char *order_id;
long gross_amount;
@@ -23,6 +29,11 @@ struct midtrans_echannel {
struct midtrans_echannel: midtrans_charge_echannel\
)(x, y)
+#define midtrans_notification(x, y, z) _Generic((z),\
+ struct midtrans_transaction *\
+ : midtrans_notification_transaction\
+ )(x, y)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -40,6 +51,9 @@ char *midtrans_charge_echannel(struct midtrans_echannel echannel,
struct midtrans_transaction transaction);
char *midtrans_status(const char *order_id);
void midtrans_cleanup();
+enum midtrans_transaction_status midtrans_notification_transaction(char *post,
+ const char *server_key,
+ struct midtrans_transaction *transaction);
#ifdef __cplusplus
}