aboutsummaryrefslogtreecommitdiff
path: root/account_link.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-01-31 21:24:56 +0700
committerShulhan <ms@kilabit.info>2023-02-01 15:07:22 +0700
commita5b22d2d0d018d7822a492979f36470e9f9cc78c (patch)
tree8050420b39923a9757b347b817c36ba711e0d8d7 /account_link.go
parentb4b6699c27b04893c73c50553070682799220080 (diff)
downloadduitku-a5b22d2d0d018d7822a492979f36470e9f9cc78c.tar.xz
all: implement API for Merchant Inquiry
The MerchantInquiry API request payment to the Duitku system (via virtual account numbers, QRIS, e-wallet, and so on). Ref: https://docs.duitku.com/api/en/#request-transaction
Diffstat (limited to 'account_link.go')
-rw-r--r--account_link.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/account_link.go b/account_link.go
new file mode 100644
index 0000000..b5b8ed4
--- /dev/null
+++ b/account_link.go
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2023 M. Shulhan <ms@kilabit.info>
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package duitku
+
+// [AccountLink] Parameter for payment methods that use OVO Account Link and
+// Shopee Account Link.
+//
+// [AccountLink]: https://docs.duitku.com/api/en/#account-link
+type AccountLink struct {
+ // [REQ] Credential Code provide by Duitku.
+ CredentialCode string `json:"credentialCode"`
+
+ // [REQ] Mandatory for OVO payment.
+ OVO AccountLinkOvo `json:"ovo"`
+
+ // [REQ] Mandatory for Shopee payment.
+ Shopee AccountLinkShopee `json:"shopee"`
+}
+
+type AccountLinkOvo struct {
+ PaymentDetails []OvoPaymentDetail `json:"paymentDetails"`
+}
+
+// [AccountLinkOvo] payment detail with OVO.
+//
+// [AccountLinkOvo]: https://docs.duitku.com/api/en/#ovo-detail
+type OvoPaymentDetail struct {
+ // [REQ] Type of your payment.
+ PaymentType string `json:"paymentType"`
+
+ // [REQ] Transaction payment amount.
+ Amount int64 `json:"amount"`
+}
+
+// [AccountLinkShopee] payment detail with Shopee.
+//
+// [AccountLinkShopee]: https://docs.duitku.com/api/en/#shopee-detail
+type AccountLinkShopee struct {
+ // [REQ] Voucher code.
+ PromoIDs string `json:"promo_ids"`
+
+ // [REQ] Used for shopee coin from linked ShopeePay account.
+ // Set true when pay transaction would like to use coins (Only for
+ // ShopeePay account link).
+ UseCoin bool `json:"useCoin"`
+}