Documentation
¶
Index ¶
- Constants
- type APIError
- type BankAccountsResource
- type CheckoutOptions
- type CheckoutsResource
- func (r *CheckoutsResource) Cancel(ctx context.Context, checkoutID, key string) (any, error)
- func (r *CheckoutsResource) Create(ctx context.Context, body map[string]any, key string) (any, error)
- func (r *CheckoutsResource) Get(ctx context.Context, checkoutID string) (any, error)
- func (r *CheckoutsResource) List(ctx context.Context, options CheckoutOptions) (any, error)
- type Client
- type Config
- type EmailConfigsResource
- func (r *EmailConfigsResource) Create(ctx context.Context, body map[string]any) (any, error)
- func (r *EmailConfigsResource) Get(ctx context.Context, configID string) (any, error)
- func (r *EmailConfigsResource) List(ctx context.Context) (any, error)
- func (r *EmailConfigsResource) Remove(ctx context.Context, configID string) (any, error)
- func (r *EmailConfigsResource) ResendVerification(ctx context.Context, configID, email string) (any, error)
- func (r *EmailConfigsResource) Test(ctx context.Context, configID string) (any, error)
- func (r *EmailConfigsResource) Update(ctx context.Context, configID string, body map[string]any) (any, error)
- func (r *EmailConfigsResource) Verify(ctx context.Context, configID string, body map[string]any) (any, error)
- type EmailLogOptions
- type EmailLogsResource
- type EmailSuppressionsResource
- type KeysResource
- func (r *KeysResource) Destroy(ctx context.Context, keyID string) (any, error)
- func (r *KeysResource) Generate(ctx context.Context, name string) (any, error)
- func (r *KeysResource) List(ctx context.Context) (any, error)
- func (r *KeysResource) Reveal(ctx context.Context, keyID string, confirmation map[string]any) (any, error)
- func (r *KeysResource) Rotate(ctx context.Context, keyID string) (any, error)
- type PaymentProfileResource
- func (r *PaymentProfileResource) Get(ctx context.Context) (any, error)
- func (r *PaymentProfileResource) RevealReturnSecret(ctx context.Context, confirmation map[string]any) (any, error)
- func (r *PaymentProfileResource) RotateReturnSecret(ctx context.Context) (any, error)
- func (r *PaymentProfileResource) Set(ctx context.Context, body map[string]any) (any, error)
- type QRResource
- type SandboxResource
- type TransactionIterator
- type TransactionOptions
- type TransactionsResource
- func (r *TransactionsResource) Iterate(ctx context.Context, virtualAccountNumber string, options TransactionOptions) *TransactionIterator
- func (r *TransactionsResource) List(ctx context.Context, virtualAccountNumber string, options TransactionOptions) (any, error)
- func (r *TransactionsResource) Retry(ctx context.Context, transactionID, targetType, targetID string) (any, error)
- type VirtualAccountsResource
- func (r *VirtualAccountsResource) List(ctx context.Context, bankAccountID string) (any, error)
- func (r *VirtualAccountsResource) Register(ctx context.Context, body map[string]any) (any, error)
- func (r *VirtualAccountsResource) RegisterNotification(ctx context.Context, vaID string, body map[string]any) (any, error)
- func (r *VirtualAccountsResource) Verify(ctx context.Context, requestID, code string) (any, error)
- func (r *VirtualAccountsResource) VerifyNotification(ctx context.Context, requestID, code string) (any, error)
- type WebhookLogOptions
- type WebhookLogsResource
- type WebhookResult
- type WebhooksResource
- func (r *WebhooksResource) Create(ctx context.Context, body map[string]any) (any, error)
- func (r *WebhooksResource) List(ctx context.Context) (any, error)
- func (r *WebhooksResource) Remove(ctx context.Context, configID string) (any, error)
- func (r *WebhooksResource) Test(ctx context.Context, body map[string]any) (any, error)
- func (r *WebhooksResource) Update(ctx context.Context, configID string, body map[string]any) (any, error)
Constants ¶
View Source
const DefaultBaseURL = "https://api.monapay.vn"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankAccountsResource ¶
type BankAccountsResource struct {
// contains filtered or unexported fields
}
type CheckoutOptions ¶
type CheckoutsResource ¶
type CheckoutsResource struct {
// contains filtered or unexported fields
}
func (*CheckoutsResource) List ¶
func (r *CheckoutsResource) List(ctx context.Context, options CheckoutOptions) (any, error)
type Client ¶
type Client struct {
Keys *KeysResource
VA *VirtualAccountsResource
BankAccounts *BankAccountsResource
PaymentProfile *PaymentProfileResource
Checkouts *CheckoutsResource
QR *QRResource
Transactions *TransactionsResource
Webhooks *WebhooksResource
WebhookLogs *WebhookLogsResource
Sandbox *SandboxResource
EmailConfigs *EmailConfigsResource
EmailLogs *EmailLogsResource
EmailSuppressions *EmailSuppressionsResource
// contains filtered or unexported fields
}
Client is a synchronous, safe-for-concurrent-use MONA Pay API client.
func NewClientFromEnv ¶
NewClientFromEnv creates a client from MONAPAY_CLIENT_ID, MONAPAY_CLIENT_SECRET and optional MONAPAY_BASE_URL. Username/password are a legacy fallback only and should not be used by AI agents because 2FA breaks it.
func (*Client) SetClientSecret ¶
type Config ¶
type Config struct {
ClientID string
Username string
Password string
ClientSecret string
BaseURL string
HTTPClient *http.Client
}
Config configures a MONA Pay client.
type EmailConfigsResource ¶
type EmailConfigsResource struct {
// contains filtered or unexported fields
}
func (*EmailConfigsResource) List ¶
func (r *EmailConfigsResource) List(ctx context.Context) (any, error)
func (*EmailConfigsResource) ResendVerification ¶
type EmailLogOptions ¶
type EmailLogsResource ¶
type EmailLogsResource struct {
// contains filtered or unexported fields
}
func (*EmailLogsResource) List ¶
func (r *EmailLogsResource) List(ctx context.Context, options EmailLogOptions) (any, error)
func (*EmailLogsResource) Stats ¶
func (r *EmailLogsResource) Stats(ctx context.Context, options EmailLogOptions) (any, error)
type EmailSuppressionsResource ¶
type EmailSuppressionsResource struct {
// contains filtered or unexported fields
}
type KeysResource ¶
type KeysResource struct {
// contains filtered or unexported fields
}
type PaymentProfileResource ¶
type PaymentProfileResource struct {
// contains filtered or unexported fields
}
func (*PaymentProfileResource) Get ¶
func (r *PaymentProfileResource) Get(ctx context.Context) (any, error)
func (*PaymentProfileResource) RevealReturnSecret ¶
func (*PaymentProfileResource) RotateReturnSecret ¶
func (r *PaymentProfileResource) RotateReturnSecret(ctx context.Context) (any, error)
type QRResource ¶
type QRResource struct {
// contains filtered or unexported fields
}
type SandboxResource ¶
type SandboxResource struct {
// contains filtered or unexported fields
}
func (*SandboxResource) CreateTransaction ¶
type TransactionIterator ¶
type TransactionIterator struct {
// contains filtered or unexported fields
}
TransactionIterator lazily retrieves transaction pages. Value is valid after Next returns true.
func (*TransactionIterator) Err ¶
func (i *TransactionIterator) Err() error
func (*TransactionIterator) Next ¶
func (i *TransactionIterator) Next() bool
func (*TransactionIterator) Value ¶
func (i *TransactionIterator) Value() any
type TransactionOptions ¶
type TransactionsResource ¶
type TransactionsResource struct {
// contains filtered or unexported fields
}
func (*TransactionsResource) Iterate ¶
func (r *TransactionsResource) Iterate(ctx context.Context, virtualAccountNumber string, options TransactionOptions) *TransactionIterator
func (*TransactionsResource) List ¶
func (r *TransactionsResource) List(ctx context.Context, virtualAccountNumber string, options TransactionOptions) (any, error)
type VirtualAccountsResource ¶
type VirtualAccountsResource struct {
// contains filtered or unexported fields
}
func (*VirtualAccountsResource) RegisterNotification ¶
func (*VirtualAccountsResource) VerifyNotification ¶
type WebhookLogOptions ¶
type WebhookLogsResource ¶
type WebhookLogsResource struct {
// contains filtered or unexported fields
}
func (*WebhookLogsResource) List ¶
func (r *WebhookLogsResource) List(ctx context.Context, options WebhookLogOptions) (any, error)
func (*WebhookLogsResource) Stats ¶
func (r *WebhookLogsResource) Stats(ctx context.Context, options WebhookLogOptions) (any, error)
type WebhookResult ¶
func VerifyWebhook ¶
func VerifyWebhook(rawBody []byte, timestamp, signature, secret string, toleranceSeconds ...int) (WebhookResult, error)
VerifyWebhook checks timestamp + HMAC against the exact request bytes and parses JSON. toleranceSeconds defaults to 300 when omitted.
Click to show internal directories.
Click to hide internal directories.