midtrans

package
v0.0.0-...-8f0a619 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BankTransferType = "bank_transfer"
	BCA              = "bca"
	BNI              = "bni"
	BRI              = "bri"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BankTransfer

type BankTransfer struct {
	Bank string `json:"bank"`
}

type ChargeRequest

type ChargeRequest struct {
	PaymentType        string             `json:"payment_type"`
	BankTransfer       BankTransfer       `json:"bank_transfer"`
	TransactionDetails TransactionDetails `json:"transaction_details"`
}

type ChargeResponse

type ChargeResponse struct {
	StatusCode        string     `json:"status_code"`
	StatusMessage     string     `json:"status_message"`
	TransactionID     string     `json:"transaction_id"`
	OrderID           string     `json:"order_id"`
	MerchantID        string     `json:"merchant_id"`
	GrossAmount       string     `json:"gross_amount"`
	Currency          string     `json:"currency"`
	PaymentType       string     `json:"payment_type"`
	SignatureKey      string     `json:"signature_key"`
	TransactionTime   string     `json:"transaction_time"`
	TransactionStatus string     `json:"transaction_status"`
	FraudStatus       string     `json:"fraud_status"`
	PermataVaNumber   string     `json:"permata_va_number"`
	VaNumbers         []VANumber `json:"va_numbers"`
	ExpiryTime        string     `json:"expiry_time"`
}

type MidtransRepository

type MidtransRepository interface {
	Charge(ctx context.Context, req ChargeRequest) (ChargeResponse, error)
}

func NewMidtransRepository

func NewMidtransRepository(baseURL string, basicAuthKey string, logger *logrus.Logger, hc *http.Client) MidtransRepository

type TransactionDetails

type TransactionDetails struct {
	OrderID     string `json:"order_id"`
	GrossAmount int64  `json:"gross_amount"`
}

type VANumber

type VANumber struct {
	Bank     string `json:"bank"`
	VaNumber string `json:"va_number"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL