diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-12-06 20:10:34 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-12-06 20:10:34 +0800 |
commit | d26e3419948c3aba72d337da81462162b52efa35 (patch) | |
tree | ea014126f1aa1465ca5560aa24eca9654f3c1654 /midtrans.h | |
parent | ef807a6284710b0bf20303dd772bc329d6e61d80 (diff) |
Payment notification
Diffstat (limited to 'midtrans.h')
-rw-r--r-- | midtrans.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 } |