/*
 * ST_RELEASE.pgc - st 모듈 서비스 ST_RELEASE (one service = one file).
 * Moved verbatim from the former inline st_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by st_svr at tpsvrinit.
 */
#include "ST_RELEASE.h"

/* 12. ST_RELEASE - 지급 보류 해제 (HELD -> SCHEDULED) (dbio). */
void ST_RELEASE(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char merch[64], bizdate[16];
    gets_(b, T_MERCHANT, merch, sizeof(merch));
    gets_(b, T_BIZDATE, bizdate, sizeof(bizdate));
    if (stdb_update_payment_status(merch, "HELD", "SCHEDULED", bizdate) < 0) FAIL(b);
    Bchg(b, T_STATUS, 0, "R", 0L);
    OK(b);
}

/* vim: set ts=4 sw=4 et smartindent: */
