| Age | Commit message (Collapse) | Author |
|
|
|
Using symlink does not render the README correctly in the sourcehut.
|
|
List of supported HTTP APIs,
* Disbursement,
** Transfer online
** Clearing
** Inquiry list bank
** Check balance
* Merchant,
** Get payment method
** Inquiry
** Check transaction status
|
|
The idea is to make it rendered in git.sr.ht and pkg.go.dev.
|
|
The share module has been migrated and renamed to
git.sr.ht/~shulhan/pakakeh.go.
|
|
The gocheck linter implement go statis analysis using [Analyzer] that
are not included in the default "go vet".
[Analyzer]: https://pkg.go.dev/golang.org/x/tools/go/analysis#hdr-Analyzer
|
|
Some API now return "SUCCESS" instead of "Success", which is inconsistent
with the rest.
|
|
The Timeout option affect how long the client wait for connect and waiting
for response.
|
|
|
|
The list is taken from
https://docs.duitku.com/disbursement/id/?json#error-code
|
|
While at it, change the code prefix from ResCodeXXX to StatusCodeXXX so
we can add another error codes later.
|
|
By returning 4xx error, client can return the correct error given by duitku
|
|
|
|
It allow the client to show error that comes from duitku
|
|
The golangci-lint is become unusable when building with Go tip and their
default run does not return any results.
This changes fix all code and comments reported by revive.
|
|
The response fields for MerchantInquiry use statusCode and statusMessage
instead of responseCode and responseDesc.
|
|
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.
|
|
This is to allow the MerchantInquiry API to be more customize able
instead of fixed, using specific merchant configuration.
While at it change the MerchantInquiry method parameter to pointer,
because to allow the caller receive filled Signature for audit.
|
|
This is to allow client to override default expiration periode, rather
than using the default.
|
|
|
|
|
|
The time.DateTime constant available since in Go 1.20.
|
|
Supported merchant APIs,
* Get payment method - https://docs.duitku.com/api/en/#get-payment-method
* Inquiry - https://docs.duitku.com/api/en/#request-transaction
* Check transaction status - https://docs.duitku.com/api/en/#check-transaction
|
|
The MerchantTxStatus method check the payment status by its orderID and
payment method.
Reference: https://docs.duitku.com/api/en/#check-transaction
|
|
The latest share module provide function to marshal struct to url.Values
which we will need later for querying payment status.
|
|
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
|
|
The PaymentMerchant will be used if the payment method during inquiry
exist as the key in it; otherwise it will use DefaultMerchant
|
|
Since the callback and return URL rarely changes, setting this in
ClientOptions can simplify creating MerchantInquiry request.
|
|
The MerchantPaymentMethod method return list of payment methods enabled
by merchant (your project).
|
|
The LoadClientOptions load the ClientOptions from configuration file.
The file configuration is using INI, for example
[duitku]
server_url = https://sandbox.duitku.com
disburse_user_id = 3551
disburse_email = test@chakratechnology.com
disburse_api_key = de5...
|
|
|
|
This is to differentiate options between Merchant and Disbursement.
|
|
We add additional merchant code and API key for Indomaret transaction.
|
|
|
|
|
|
|
|
While at it, compare the test response directly by overwriting
CustRefNumber and DisburseID.
|
|
The actual response from Server does not return "disburseId", so we set
it in RtolTransfer to prevent 0 value.
|
|
The InquiryStatus get the status of previous Transfer.
Ref: https://docs.duitku.com/disbursement/en/#inquiry-status
|
|
Instead of using request and response from inquiry, pass the actual
Transfer type.
This is to minimize confusion and to allow the caller to log the request
on their side.
|
|
As long as the response body is valid, return it to caller and let them
check the response code manually.
This is to allow user to log the request and full response.
|
|
The Options method return the current client configuration.
|
|
|
|
The idea is to allow testing the client from other module without
using the provided APIs.
|
|
Instead of declaring the fixed prefix "/webapi/api" in the server URL,
define it in the path itself so the server URL can be cleanly mock up.
|
|
Since the call to inquiry/transfer modify the parameter fields, we
need to pass it as pointer so the caller can inspect or log the request
values.
|
|
|
|
|
|
The ClearingCallbackResponse contains fields that must be set in order
to response from ClearingTransfer callback.
|
|
While at it, use and embed RtolInquiryResponse inside RtolTransferResponse
to minimize duplication.
|