aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-01-31 20:24:03 +0700
committerShulhan <ms@kilabit.info>2023-01-31 20:24:03 +0700
commitd8b4bd20f3755a1f323c3a563167f240cdb11e23 (patch)
tree84cb8553e8320a3db87aa18acfb57f99f847c736
parent2bf2b28ca70013e74442c464b8e1367bb40a36f1 (diff)
downloadduitku-d8b4bd20f3755a1f323c3a563167f240cdb11e23.tar.xz
all: add client options to set merchant callback and return URL
Since the callback and return URL rarely changes, setting this in ClientOptions can simplify creating MerchantInquiry request.
-rw-r--r--client.conf.example8
-rw-r--r--client_options.go8
2 files changed, 16 insertions, 0 deletions
diff --git a/client.conf.example b/client.conf.example
index 8f6141f..e919595 100644
--- a/client.conf.example
+++ b/client.conf.example
@@ -3,3 +3,11 @@ server_url = https://sandbox.duitku.com
disburse_user_id = 3551
disburse_email = test@chakratechnology.com
disburse_api_key = de56f832487bc1ce1de5ff2cfacf8d9486c61da69df6fd61d5537b6b7d6d354d
+
+merchant_code =
+merchant_api_key =
+merchant_callback_url =
+merchant_return_url =
+
+indomaret_merchant_code =
+indomaret_api_key =
diff --git a/client_options.go b/client_options.go
index d4d6500..b365ac0 100644
--- a/client_options.go
+++ b/client_options.go
@@ -31,6 +31,14 @@ type ClientOptions struct {
// MerchantApiKey The API key for signing merchant related request.
MerchantApiKey string `ini:"duitku::merchant_api_key"`
+ // MerchantCallbackUrl The URL that will be used by Duitku to
+ // confirm payments made by your customers.
+ MerchantCallbackUrl string `ini:"duitku::merchant_callback_url"`
+
+ // MerchantReturnUrl The URL that Duitku will direct the customer
+ // after the transaction is successful or canceled.
+ MerchantReturnUrl string `ini:"duitku::merchant_return_url"`
+
// Merchant code and API key for payment through Indomaret.
IndomaretMerchantCode string `ini:"duitku::indomaret_merchant_code"`
IndomaretApiKey string `ini:"duitku::indomaret_api_key"`