This repository has been archived on 2026-07-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
acquire-core-full/app/include/mg_core.h

38 lines
1.4 KiB
C

/*
* mg_core.h - 전문게이트웨이 모듈 핵심 계약 (레코드/상태/표준 DBIO API)
*
* 이 모듈의 온라인/배치 프로그램은 SQL 을 직접 다루지 않고 아래 표준
* DBIO API 만 호출한다. 구현은 app/dbio/mg_dbio_main.pgc (ECPG).
*/
#ifndef MG_CORE_H
#define MG_CORE_H
#include "txcore.h"
/* 전문게이트웨이 처리 상태코드 */
#define MG_ST_RECV "R" /* 접수/수신 */
#define MG_ST_DONE "M" /* 처리완료 */
#define MG_ST_FAIL "U" /* 불일치/실패 */
#define MG_ST_SETTLED "S" /* 정산완료 */
/* 전문게이트웨이 원장 레코드 (1행) */
typedef struct {
char key[16]; /* 처리키(승인/거래 번호) PK */
char merch_id[16]; /* 가맹점번호 */
char card_no[20]; /* 카드번호(마스킹) */
long amount; /* 거래금액(원) */
char biz_date[9]; /* 영업일 YYYYMMDD */
char status[2]; /* 상태코드 */
long fee; /* 수수료(원) */
} mg_rec_t;
/* 표준 DBIO API (구현: mg_dbio_main.pgc) */
int mg_dbio_connect(const char *target);
int mg_dbio_disconnect(void);
int mg_rec_insert(const mg_rec_t *rec);
int mg_rec_select(const char *key, mg_rec_t *out);
int mg_rec_update_status(const char *key, const char *status);
long mg_rec_count(const char *biz_date, const char *status);
int mg_rec_sum(const char *biz_date, long *out_sum);
#endif /* MG_CORE_H */