aboutsummaryrefslogtreecommitdiff
path: root/payment_status_response.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-03-17 13:57:34 +0700
committerShulhan <ms@kilabit.info>2023-03-17 13:57:34 +0700
commit548c92ff835de375e2b35add255bd4bf77a3e632 (patch)
treeae5e4557904dd0a59f690431dc25f0be14e102d7 /payment_status_response.go
parent3d29a1cf144c785c8a210c1e85061968446b2433 (diff)
downloadduitku-548c92ff835de375e2b35add255bd4bf77a3e632.tar.xz
all: change the MerchantTxStatus parameter to struct
The idea is to allow the caller to know the Signature of request after call to MerchantTxStatus and possibly log the whole request. While at it, we change the method name to MerchantPaymentStatus and the type from transactionStatus to PaymentStatus, and from TxStatusResponse to PaymentStatusResponse.
Diffstat (limited to 'payment_status_response.go')
-rw-r--r--payment_status_response.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/payment_status_response.go b/payment_status_response.go
new file mode 100644
index 0000000..c78dd3c
--- /dev/null
+++ b/payment_status_response.go
@@ -0,0 +1,28 @@
+// SPDX-FileCopyrightText: 2023 M. Shulhan <ms@kilabit.info>
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package duitku
+
+// List of valid Code in PaymentStatusResponse.
+const (
+ PaymentStatusSuccess = `00`
+ PaymentStatusProcess = `01`
+ PaymentStatusFailed = `02`
+)
+
+// PaymentStatusResponse contains response from checking merchant payment
+// status.
+type PaymentStatusResponse struct {
+ OrderID string `json:"merchantOrderId"`
+ Reference string `json:"reference"`
+ Amount string `json:"amount"`
+
+ // Status code transaction.
+ // - 00 - Success
+ // - 01 - Process
+ // - 02 - Failed/Expired
+ Code string `json:"statusCode"`
+
+ // Description that explain the status Code.
+ Message string `json:"statusMessage"`
+}