Files
payment-bridge/PaymentStop.cs
청춘약국 a0d9b4364a Initial commit: Payment Bridge (올댓페이 C# DLL Wrapper)
- PaymentBridge.cs: HTTP API 서버 (포트 7779)
  - /api/status: 연결 상태 확인
  - /api/card/approve: 카드 승인 (D1)
  - /api/card/cancel: 카드 취소 (D2)
  - /api/card/stop: 결제 진행 중 취소 시도
  - /api/cash/receipt: 현금영수증 (B1)
  - /api/cash/cancel: 현금영수증 취소 (B2)

- PaymentStop.cs: 별도 취소 exe (테스트용)

- 사용 DLL:
  - AllthatModule.dll (카드결제)
  - PosToCatReq.dll (ReqStop)
2026-03-27 23:08:29 +09:00

39 lines
1.0 KiB
C#

using System;
using System.Runtime.InteropServices;
class PaymentStop
{
private const string POS_DLL = @"C:\Program Files (x86)\AllthatpayClient\PosToCatReq.dll";
[DllImport(POS_DLL, CallingConvention = CallingConvention.StdCall)]
public static extern int ReqStop();
[DllImport(POS_DLL, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
public static extern int ReqStop_TCP(string gwIp, string gwPort);
static void Main(string[] args)
{
Console.WriteLine("=== Payment Stop ===");
try
{
int r1 = ReqStop();
Console.WriteLine("ReqStop: " + r1);
}
catch (Exception ex)
{
Console.WriteLine("ReqStop error: " + ex.Message);
}
try
{
int r2 = ReqStop_TCP("127.0.0.1", "49884");
Console.WriteLine("ReqStop_TCP: " + r2);
}
catch (Exception ex)
{
Console.WriteLine("ReqStop_TCP error: " + ex.Message);
}
}
}