Documentation ¶
Overview ¶
* File Created: Friday, 28th July 2023 5:33:23 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Friday, 28th July 2023 5:26:55 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Friday, 28th July 2023 6:23:33 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Saturday, 2nd September 2023 1:53:00 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Monday, 18th September 2023 11:34:44 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Wednesday, 23rd August 2023 11:54:14 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Monday, 4th September 2023 4:44:39 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Sunday, 3rd September 2023 10:43:37 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Wednesday, 30th August 2023 11:47:06 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Saturday, 2nd September 2023 3:27:26 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
* File Created: Tuesday, 29th August 2023 2:47:43 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
Index ¶
- Constants
- type Customer
- type CustomerAddress
- type DisbursementApproveOption
- type DisbursementApprovePayload
- type DisbursementFetchItemsOption
- type DisbursementItemPayload
- type DisbursementOption
- type DisbursementPayload
- type DisbursementTopupPayload
- type DisbursementValidatePayload
- type Error
- type Errors
- type EwalletAccountLinkPayload
- type Invoice
- type InvoiceCreatePayload
- type InvoiceFetchOption
- type InvoiceManualPayPayload
- type InvoicePayPayload
- type InvoiceUpdatePayload
- type OrderFetchByIDOption
- type OrderFetchOption
- type OrderItem
- type OrderPayload
- type OrderPaymentLinkCustomer
- type OrderPaymentLinkPayload
- type PaymentCapturePayload
- type PaymentChargeBNPLPayload
- type PaymentChargeCardPayload
- type PaymentChargeEwalletPayload
- type PaymentChargeOnlineBankingPayload
- type PaymentChargeQRISPayload
- type PaymentChargeRetailStorePayload
- type PaymentChargeVAPayload
- type PaymentCustomerInfo
- type PaymentFetchByIDOption
- type PaymentFetchOption
- type PaymentMDRFeesOption
- type PaymentSandboxOption
- type PaymentVerifyPayload
- type PromoDetails
- type PromoPayload
- type RefundFetchOption
- type RefundPayload
- type SettlementOption
- type VirtualAccountCustomer
- type VirtualAccountFetchOption
- type VirtualAccountPatchPayload
- type VirtualAccountPayload
- type VirtualAccountPaymentSimulatePayload
Constants ¶
const ( ErrorCodeSDK = "SDK_ERROR" ErrorCodeDPAYInternalError = "DPAY_INTERNAL_ERROR" ErrorCodeDPAYInvalidRequest = "DPAY_INVALID_REQUEST" )
const (
DurianpayURL = "https://api.durianpay.id"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct { CustomerRefID string `json:"customer_ref_id"` GivenName string `json:"given_name"` Email string `json:"email"` Mobile string `json:"mobile"` Address CustomerAddress `json:"address"` }
type CustomerAddress ¶
type CustomerAddress struct { ReceiverName string `json:"receiver_name"` ReceiverPhone string `json:"receiver_phone"` Label string `json:"label"` AddressLine1 string `json:"address_line_1"` AddressLine2 string `json:"address_line_2"` City string `json:"city"` Region string `json:"Region"` Country string `json:"country"` PostalCode string `json:"postal_code"` Landmark string `json:"landmark"` }
CustomerAddress is part of Customer for attribute Address
type DisbursementApproveOption ¶
type DisbursementApproveOption struct {
IgnoreInvalid *bool `url:"ignore_invalid"`
}
DisbursementApproveOption is paramaeter for approve disbursement API
type DisbursementApprovePayload ¶
type DisbursementApprovePayload struct { XIdempotencyKey string `json:"-"` ID string `json:"id"` //Disbursement ID }
DisbursementApprovePayload is payload for request approve disbursement API
type DisbursementFetchItemsOption ¶
DisbursementFetchItemsOption is parameter for Fetch Disbursement Items API
type DisbursementItemPayload ¶
type DisbursementItemPayload struct { AccountOwnerName string `json:"account_owner_name" validate:"required"` BankCode string `json:"bank_code" validate:"required"` Amount string `json:"amount" validate:"required"` AccountNumber string `json:"account_number" validate:"required"` EmailRecipient string `json:"email_recipient"` PhoneNumber string `json:"phone_number"` Notes string `json:"notes"` }
DisbursementItemPayload is part of DisbursementPayload for attribute items
type DisbursementOption ¶
type DisbursementOption struct { ForceDisburse *bool `url:"force_disburse"` SkipValidation *bool `url:"skip_validation"` }
DisbursementOption is parameter for submit disbursement API
type DisbursementPayload ¶
type DisbursementPayload struct { XIdempotencyKey string `json:"-" validate:"required"` IdempotencyKey string `json:"-" validate:"required"` Name string `json:"name"` Description string `json:"description"` Items []DisbursementItemPayload `json:"items"` }
DisbursementPayload is payload for request disbursement API
type DisbursementTopupPayload ¶
type DisbursementTopupPayload struct { XIdempotencyKey string `json:"-"` BankID uint16 `json:"bank_id"` Amount string `json:"amount"` }
DisbursementTopupPayload is payload for request Topup Amount API
type DisbursementValidatePayload ¶
type DisbursementValidatePayload struct { XIdempotencyKey string `json:"-"` AccountNumber string `json:"account_number"` BankCode string `json:"bank_code"` }
DisbursementValidatePayload is payload for request validate disbursement API
type Error ¶
type Error struct { StatusCode int // Response from http status code Error string `json:"error"` ErrorCode string `json:"error_code"` Errors []Errors `json:"errors"` Message string `json:"message"` ResponseCode string `json:"response_code"` // ResponseCode currenty only present for Invoice API }
Error is commons response error DurianPay
func FromSDKError ¶
type EwalletAccountLinkPayload ¶
type EwalletAccountLinkPayload struct { Mobile string `json:"mobile"` WalletType string `json:"wallet_type"` RedirectURL string `json:"redirect_url"` }
EwalletAccountLinkPayload is payload for Link E-Wallet Account API.
type InvoiceCreatePayload ¶
type InvoiceCreatePayload struct { Amount string `json:"amount"` RemainingAmount string `json:"remaining_amount"` Title string `json:"title"` InvoiceRefID string `json:"invoice_ref_id"` Customer Customer `json:"customer"` EnablePartialTransaction bool `json:"enable_partial_transaction"` PartialTransactionConfig map[string]any `json:"partial_transaction_config"` // Key-Value pair that can be used to store configuration about partial transactions like minimum acceptable amount for a partial transaction StartDate time.Time `json:"start_date"` DueDate time.Time `json:"due_date"` }
InvoiceCreate represents payload for Create Invoice API.
type InvoiceFetchOption ¶
type InvoiceFetchOption struct { From string `json:"from"` To string `json:"to"` Skip uint32 `json:"skip"` Limit uint16 `json:"limit"` Status string `json:"status"` }
InvoiceFetchOption represents paramater for List Invoices API.
type InvoiceManualPayPayload ¶
InvoiceManualPay represents payload for Manual Payment for Invoice API.
type InvoicePayPayload ¶
type InvoicePayPayload struct { BankCode string `json:"bank_code"` Invoices []Invoice `json:"invoices"` CustomerID string `json:"customer_id"` }
InvoicePay represents payload for Pay Invoice API.
type InvoiceUpdatePayload ¶
type InvoiceUpdatePayload struct { InvoiceRefID string `json:"invoice_ref_id"` Title string `json:"title"` StartDate time.Time `json:"start_date"` DueDate time.Time `json:"due_date"` InvoiceURL string `json:"invoice_url"` EnablePartialTransaction bool `json:"enable_partial_transaction"` PartialTransactionConfig map[string]any `json:"partial_transaction_config"` // Key-Value pair that can be used to store configuration about partial transactions like minimum acceptable amount for a partial transaction IsBlocked bool `json:"is_blocked"` RemainingAmount string `json:"remaining_amount"` Metadata map[string]any `json:"metadata"` }
InvoiceUpdate represents payload for Update Invoice API.
type OrderFetchByIDOption ¶
type OrderFetchByIDOption struct {
Expand string `url:"expand"`
}
OrderFetchByIDOption is parameter for requests Order Fetch By ID API
type OrderFetchOption ¶
type OrderFetchOption struct { From string `url:"form"` To string `url:"to"` Skip uint16 `url:"skip"` Limit uint16 `url:"limit"` }
OrderFetchOption is parameter for requests Orders Fetch API
type OrderItem ¶
type OrderItem struct { Name string `json:"name"` Qty uint16 `json:"qty"` Price string `json:"price"` Logo string `json:"logo"` }
OrderItem is part of CreatePayload for attribute Items
type OrderPayload ¶
type OrderPayload struct { Amount string `json:"amount"` PaymentOption string `json:"payment_option"` Currency string `json:"currency"` OrderRefID string `json:"order_ref_id"` Customer Customer `json:"customer"` Items []OrderItem `json:"items"` Metadata map[string]any `json:"metadata"` ExpiryDate time.Time `json:"expiry_date"` }
OrderPayload is payload for requests Create Orders API
type OrderPaymentLinkCustomer ¶
type OrderPaymentLinkCustomer struct {
Email string `json:"email"`
}
OrderPaymentLinkCustomer is part of OrderPaymentLinkPayload
type OrderPaymentLinkPayload ¶
type OrderPaymentLinkPayload struct { Amount string `json:"amount"` Currency string `json:"currency"` OrderRefID string `json:"order_ref_id"` IsPaymentLink bool `json:"is_payment_link"` Customer OrderPaymentLinkCustomer `json:"customer"` }
OrderPaymentLinkPayload is payload for requests Create Payment Link API
type PaymentCapturePayload ¶
type PaymentCapturePayload struct {
Amount string `json:"amount"`
}
PaymentCapturePayload is payload for Payment Capture API
type PaymentChargeBNPLPayload ¶
type PaymentChargeBNPLPayload struct { OrderID string `json:"order_id"` Amount string `json:"amount"` PaymentRefID string `json:"payment_ref_id"` PaymentMethodUniqueID string `json:"payment_method_unique_id"` CustomerInfo PaymentCustomerInfo `json:"customer_info"` SandboxOption *PaymentSandboxOption `json:"-"` // If you want send request as Sandbox use this option }
PaymentChargeBNPLPayload is requests payload for Payment Charge API. This requests for `BNPL`
type PaymentChargeCardPayload ¶
type PaymentChargeCardPayload struct { OrderID string `json:"order_id"` Amount string `json:"amount"` PaymentRefID string `json:"payment_ref_id"` CustomerInfo PaymentCustomerInfo `json:"customer_info"` }
PaymentChargeCardPayload is requests payload for Payment Charge API. This requests for type `CARD`
type PaymentChargeEwalletPayload ¶
type PaymentChargeEwalletPayload struct { OrderID string `json:"order_id"` Amount string `json:"amount"` Mobile string `json:"mobile"` WalletType string `json:"wallet_type"` SandboxOption *PaymentSandboxOption `json:"-"` // If you want send request as Sandbox use this option }
PaymentChargeEwalletPayload is requests payload for Payment Charge API. This request for type E-WALLET
type PaymentChargeOnlineBankingPayload ¶
type PaymentChargeOnlineBankingPayload struct { OrderID string `json:"order_id"` Type string `json:"type"` Name string `json:"name"` Amount string `json:"amount"` CustomerInfo PaymentCustomerInfo `json:"customer_info"` Mobile string `json:"mobile"` }
PaymentChargeOnlineBankingPayload is requests payload for Payment Charge API. This requests for type `Online Banking`
type PaymentChargeQRISPayload ¶
type PaymentChargeQRISPayload struct { OrderID string `json:"order_id"` Type string `json:"type"` Amount string `json:"amount"` Name string `json:"name"` }
PaymentChargeQRISPayload is requests payload for Payment Charge API. This requests for type `QRIS`
type PaymentChargeRetailStorePayload ¶
type PaymentChargeRetailStorePayload struct { OrderID string `json:"order_id"` BankCode string `json:"bank_code"` Name string `json:"name"` Amount string `json:"amount"` PaymentRefID string `json:"payment_ref_id"` SandboxOption *PaymentSandboxOption `json:"-"` // If you want send request as Sandbox use this option }
PaymentChargeRetailStorePayload is requests payload for Payment Charge API. This request for type `Retail Store`
type PaymentChargeVAPayload ¶
type PaymentChargeVAPayload struct { OrderID string `json:"order_id"` BankCode string `json:"bank_code"` Name string `json:"name"` Amount string `json:"amount"` PaymentRefID string `json:"payment_ref_id"` SandboxOption *PaymentSandboxOption // If you want send request as Sandbox use this option }
PaymentChargeVAPayload is requests payload for Payment Charge API. This request for type `VA`
type PaymentCustomerInfo ¶
type PaymentCustomerInfo struct { Email string `json:"email"` GivenName string `json:"given_name"` ID string `json:"id"` }
PaymentCustomerInfo is part of PaymentRequestOnlineBanking for attribute Customer Info
type PaymentFetchByIDOption ¶
type PaymentFetchByIDOption struct {
Expand string `url:"expand"` // customer or order
}
PaymentFetchByIDOption is parameter for Payment Fetch by ID API.
type PaymentFetchOption ¶
type PaymentFetchOption struct { From string `url:"from"` To string `url:"to"` Skip uint16 `url:"skip"` Limit uint16 `url:"limit"` }
PaymentFetchOption is parameter for Payment Fetch API.
type PaymentMDRFeesOption ¶
type PaymentMDRFeesOption struct { Amount string `url:"amount"` PaymentMethod string `url:"payment_method"` }
PaymentMDRFeesOption is parameter for MDR Fees Calculation API.
type PaymentSandboxOption ¶
type PaymentSandboxOption struct { ForceFail bool `json:"force_fail"` DelayMS int `json:"delay_ms"` }
PaymentSandboxOption is option for request payment charge as Sanbox Mode.
type PaymentVerifyPayload ¶
type PaymentVerifyPayload struct {
VerificationSignature string `json:"verification_signature"`
}
PaymentVerifyPayload is payload for Verify Payments API
type PromoDetails ¶
PromoDetails is part of PromoPayload
type PromoPayload ¶
type PromoPayload struct { Type string `json:"type"` Label string `json:"label"` Currency string `json:"currency"` PromoDetails PromoDetails `json:"promo_details"` DiscountType string `json:"discount_type"` Discount string `json:"discount"` MinOrderAmount string `json:"min_order_amount"` MaxDiscountAmount string `json:"max_discount_amount"` StartsAt time.Time `json:"starts_at"` EndsAt time.Time `json:"ends_at"` PromoType string `json:"promo_type"` Description string `json:"description"` SubType string `json:"sub_type"` LimitType string `json:"limit_type"` LimitValue string `json:"limit_value"` PriceDeductionType string `json:"price_deduction_type"` Code string `json:"code"` }
PromoPayload use for Create & Update Promo API
type RefundFetchOption ¶
type RefundFetchOption struct { From string `url:"from"` To string `url:"to"` Skip uint16 `url:"skip"` Limit uint16 `url:"limit"` }
RefundFetchOption is parameter for Refund Fetch API
type RefundPayload ¶
type RefundPayload struct { RefID string `json:"ref_id"` PaymentID string `json:"payment_id"` Amount string `json:"amount"` UseRefundLink bool `json:"use_refund_link"` Notes string `json:"notes"` }
RefundPayload is struct for payload Create Refund API
type SettlementOption ¶
type SettlementOption struct { From string `url:"from"` To string `url:"to"` Skip uint16 `url:"skip"` Limit uint16 `url:"limit"` }
SettlementOption is parameter for Fetch and Details API.
type VirtualAccountCustomer ¶
type VirtualAccountCustomer struct { GivenName string `json:"given_name"` Mobile string `json:"mobile"` Email string `json:"email"` }
VirtualAccountCustomer is part of VirtualAccountPayload for attribute Customer
type VirtualAccountFetchOption ¶
type VirtualAccountFetchOption struct { From string `url:"from"` To string `url:"to"` Skip uint16 `url:"skip"` Limit uint16 `url:"limit"` }
VirtualAccountFetchOption is parameter for Virtual Account Fetch API
type VirtualAccountPatchPayload ¶
type VirtualAccountPatchPayload struct { ExpiryMinutes uint32 `json:"expiry_minutes"` MinAmount uint32 `json:"min_amount"` MaxAmount uint32 `json:"max_amount"` Amount uint32 `json:"amount"` IsDisabled bool `json:"is_disabled"` VaRefID string `json:"va_ref_id"` }
VirtualAccountPatchPayload is payload for Virtual Account Patch By ID API
type VirtualAccountPayload ¶
type VirtualAccountPayload struct { BankCode string `json:"bank_code"` Name string `json:"name"` IsClosed bool `json:"is_closed"` Amount string `json:"amount"` Customer VirtualAccountCustomer `json:"customer"` ExpiryMinutes uint32 `json:"expiry_minutes"` AccountSuffix string `json:"account_suffix"` IsReusable bool `json:"is_reusable"` VaRefID string `json:"va_ref_id"` MinAmount uint32 `json:"min_amount"` MaxAmount uint32 `json:"max_amount"` AutoDisableAfterPayment bool `json:"auto_disable_after_payment"` }
VirtualAccountPayload is payload for Virtual Account Create API.
type VirtualAccountPaymentSimulatePayload ¶
type VirtualAccountPaymentSimulatePayload struct { Amount string `json:"amount"` AccountNumber string `json:"account_number""` ForceFail bool `json:"force_fail"` }
VirtualAccountPaymentSimulatePayload is payload for Virtual Account Payment Simulate API
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
* File Created: Sunday, 30th July 2023 12:22:26 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Sunday, 30th July 2023 12:22:26 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Saturday, 29th July 2023 10:39:48 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Saturday, 29th July 2023 10:39:48 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Friday, 28th July 2023 6:42:39 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Friday, 28th July 2023 6:42:39 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Saturday, 2nd September 2023 2:00:00 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Saturday, 2nd September 2023 2:00:00 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Thursday, 21st September 2023 5:08:28 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Thursday, 21st September 2023 5:08:28 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
internal
|
|
tests
* File Created: Sunday, 30th July 2023 3:57:52 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Sunday, 30th July 2023 3:57:52 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
tests/mock
Package mock_common is a generated GoMock package.
|
Package mock_common is a generated GoMock package. |
* File Created: Monday, 18th September 2023 11:33:54 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Monday, 18th September 2023 11:33:54 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Thursday, 24th August 2023 6:36:16 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Thursday, 24th August 2023 6:36:16 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Tuesday, 5th September 2023 11:13:19 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Tuesday, 5th September 2023 11:13:19 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Sunday, 3rd September 2023 10:52:35 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Sunday, 3rd September 2023 10:52:35 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Friday, 1st September 2023 11:29:06 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Friday, 1st September 2023 11:29:06 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Saturday, 2nd September 2023 3:34:42 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Saturday, 2nd September 2023 3:34:42 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |
* File Created: Tuesday, 29th August 2023 10:51:07 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
|
* File Created: Tuesday, 29th August 2023 10:51:07 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author |