summaryrefslogtreecommitdiff
path: root/midtrans.h
blob: 3bb8174601fd86c59bf169f6e3aa03366ea0ccc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef MIDTRANS_H
#define MIDTRANS_H

struct midtrans_transaction {
	char *order_id;
	long gross_amount;
};

enum midtrans_payment {
	MIDTRANS_CREDITCARD,
	MIDTRANS_BANKTRANSFER,
	MIDTRANS_BCA_KLIKBCA,
	MIDTRANS_BCA_KLIKPAY,
	MIDTRANS_BRI_EPAY,
	MIDTRANS_CIMB_CLICKS,
	MIDTRANS_DANAMON_ONLINE,
	MIDTRANS_UOB_EZPAY,
	MIDTRANS_QRIS,
	MIDTRANS_GOPAY,
	MIDTRANS_SHOPEEPAY,
	MIDTRANS_CSTORE,
	MIDTRANS_AKULAKU,
	MIDTRANS_KREDIVO
};

struct midtrans_banktransfer {
	char *bank;
	char *va_number;
	char *bca;
	char *permata;
};

#ifdef __cplusplus
extern "C" {
#endif

void midtrans_init(const char *api_key, const char *cainfo);
void midtrans_status(const char *order_id);
void midtrans_charge(enum midtrans_payment payment, void *object,
		struct midtrans_transaction *transaction,
		char *custom_fields[]);
void midtrans_cleanup();

#ifdef __cplusplus
}
#endif

#endif