Documentation ¶
Overview ¶
Package omise provides GO binding for Omise REST API. Full REST API documentation is available at https://www.omise.co/docs.
Usage ¶
Create a client with omise.NewClient, supply your public and secret key. Then use the client.Do method with operation objects from the operations subpackage to perform API calls. The first parameter to client.Do lets you supply a struct to unmarshal the result into.
Example:
client, e := omise.NewClient(OMISE_PUBKEY, OMISE_KEY) if e != nil { panic(e) } charge, create := &omise.Charge{}, &operations.CreateCharge{ Amount: 100000, // ฿1,000.00 Currency: "thb", Card: "tok_1234", } if e := client.Do(charge, create); e != nil { panic(e) } fmt.Printf("%#v\n", charge)
Handling nils ¶
For REQUESTS: Where optional parameters are concerned, empty values are considered as not sending the value except where doing so may have undesirable implications. This is to avoid the need for pointer indirections when creating the struct.
For RESPONSES: Optional fields always use nillable types or types with well-defined "empty" value. For example, an optional `string` field will have `*string` type.
Test keys ¶
You will need to supply a valid Omise API keys in order to run tests. Refer to the official documentation on Authentication at https://www.omise.co/api-authentication for more information.
To specify the keys, set the environment variables before running the tests as follows:
export OMISE_PUBKEY=pkey_test_yourpublickey export OMISE_KEY=skey_test_yoursecretkey
Live tests ¶
Tests are run against fixtures by default. If you want to run network test against Omise test servers you can do so by supplying valid test keys *and* setting NETWORK environment variable to 1.
cd $GOPATH/src/github.com/omise/omise-go NETWORK=1 go test -v ./operations
Index ¶
- Variables
- func WebhookHTTPHandler(handler EventHandler) http.Handler
- type Account
- type AccountList
- type Balance
- type BalanceList
- type Bank
- type BankAccount
- type BankAccountList
- type BankAccountType
- type Base
- type Capability
- type Card
- type CardList
- type Charge
- type ChargeList
- type ChargeSearchResult
- type ChargeStatus
- type Client
- type Customer
- type CustomerList
- type CustomerSearchResult
- type Date
- type Deletion
- type DeletionList
- type Dispute
- type DisputeList
- type DisputeSearchResult
- type DisputeStatus
- type Document
- type DocumentList
- type ErrInternal
- type ErrTransport
- type Error
- type Event
- type EventHandler
- type EventHandlerFunc
- type EventList
- type Link
- type LinkList
- type LinkSearchResult
- type List
- type Occurrence
- type OccurrenceList
- type OccurrenceStatus
- type OffsiteTypes
- type Ordering
- type PaymentMethod
- type Receipt
- type ReceiptList
- type Recipient
- type RecipientList
- type RecipientSearchResult
- type RecipientType
- type Refund
- type RefundList
- type RefundSearchResult
- type Schedule
- type ScheduleList
- type SearchResult
- type SearchScope
- type Source
- type SourceOfFunds
- type Token
- type TokenList
- type Transaction
- type TransactionList
- type TransactionType
- type Transfer
- type TransferList
- type TransferSearchResult
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidKey = errors.New("invalid public or secret key")
ErrInvalidKey represents missing or bad API key errors.
Functions ¶
func WebhookHTTPHandler ¶
func WebhookHTTPHandler(handler EventHandler) http.Handler
WebhookHTTPHandler creates an http.Handler that you can use to receive Omise's webhook API calls for events. The returned handler will automatically consume the request body and unmarshals an Event object from JSON for you.
See https://www.omise.co/api-webhooks for more information.
Types ¶
type Account ¶
Account represents Omise's account object. See https://www.omise.co/account-api for more information.
type AccountList ¶
AccountList represents the list structure returned by Omise's REST API that contains Account struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*AccountList) Find ¶
func (list *AccountList) Find(id string) *Account
Find finds and returns Account with the given id. Returns nil if not found.
type Balance ¶
type Balance struct { Base Available int64 `json:"available"` Total int64 `json:"total"` Currency string `json:"currency"` }
Balance represents Omise's balance object. See https://www.omise.co/balance-api for more information.
type BalanceList ¶
BalanceList represents the list structure returned by Omise's REST API that contains Balance struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*BalanceList) Find ¶
func (list *BalanceList) Find(id string) *Balance
Find finds and returns Balance with the given id. Returns nil if not found.
type Bank ¶ added in v1.0.6
type Bank struct { Code string `json:"code"` Name string `json:"name"` Active bool `json:"active"` }
Bank represents a bank object in the payment method of the capability object.
type BankAccount ¶
type BankAccount struct { Base Brand string `json:"brand"` Number string `json:"number"` LastDigits string `json:"last_digits"` Name string `json:"name"` // for Omise Japan BankCode string `json:"bank_code"` BranchCode string `json:"branch_code"` AccountType BankAccountType `json:"account_type"` }
BankAccount represents Omise's bank account object. See https://www.omise.co/bank-account-api for more information.
type BankAccountList ¶
type BankAccountList struct { List Data []*BankAccount `json:"data"` }
BankAccountList represents the list structure returned by Omise's REST API that contains BankAccount struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*BankAccountList) Find ¶
func (list *BankAccountList) Find(id string) *BankAccount
Find finds and returns BankAccount with the given id. Returns nil if not found.
type BankAccountType ¶
type BankAccountType string
BankAccountType BankAccount an enumeration of possible types of BackAccount(s) which can be
const ( Normal BankAccountType = "normal" Current BankAccountType = "current" )
BankAccountType can be one of the following list of constants:
type Base ¶
type Base struct { Object string `json:"object"` ID string `json:"id"` Live bool `json:"livemode"` Location *string `json:"location"` Created time.Time `json:"created"` }
Base structure contains fields that are common to objects returned by the Omise's REST API.
type Capability ¶ added in v1.0.6
type Capability struct { Object string `json:"object"` Location string `json:"location"` Banks []string `json:"banks"` Country string `json:"country"` PaymentMethods []PaymentMethod `json:"payment_methods"` ZeroInterestInstallments bool `json:"zero_interest_installments"` }
Capability represents Omise's capability object. See https://www.omise.co/capability-api for more information.
type Card ¶
type Card struct { Base Country string `json:"country"` City string `json:"city"` Bank string `json:"bank"` PostalCode string `json:"postal_code"` Financing string `json:"financing"` LastDigits string `json:"last_digits"` Brand string `json:"brand"` ExpirationMonth time.Month `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` Fingerprint string `json:"fingerprint"` Name string `json:"name"` SecurityCodeCheck bool `json:"security_code_check"` }
Card represents Omise's card object. See https://www.omise.co/cards-api for more information.
type CardList ¶
CardList represents the list structure returned by Omise's REST API that contains Card struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
type Charge ¶
type Charge struct { Base Status ChargeStatus `json:"status"` Amount int64 `json:"amount"` Currency string `json:"currency"` Description *string `json:"description"` Capture bool `json:"capture"` Authorized bool `json:"authorized"` Reversed bool `json:"reversed"` Paid bool `json:"paid"` Transaction string `json:"transaction"` Card *Card `json:"card"` Refunded int64 `json:"refunded"` Refunds *RefundList `json:"refunds"` FailureCode *string `json:"failure_code"` FailureMessage *string `json:"failure_message"` CustomerID string `json:"customer"` IP *string `json:"ip"` Dispute *Dispute `json:"dispute"` ReturnURI string `json:"return_uri"` AuthorizeURI string `json:"authorize_uri"` SourceOfFund SourceOfFunds `json:"source_of_fund"` Offsite OffsiteTypes `json:"offsite"` Source *Source `json:"source"` Metadata map[string]interface{} `json:"metadata"` }
Charge represents Omise's charge object. See https://www.omise.co/charges-api for more information.
type ChargeList ¶
ChargeList represents the list structure returned by Omise's REST API that contains Charge struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*ChargeList) Find ¶
func (list *ChargeList) Find(id string) *Charge
Find finds and returns Charge with the given id. Returns nil if not found.
type ChargeSearchResult ¶
type ChargeSearchResult struct { SearchResult Data []*Charge `json:"data"` }
ChargeSearchResult represents search result structure returned by Omise's Search API that contains Charge struct as result elements.
type ChargeStatus ¶
type ChargeStatus string
ChargeStatus represents an enumeration of possible status of a Charge object.
const ( ChargeFailed ChargeStatus = "failed" ChargePending ChargeStatus = "pending" ChargeSuccessful ChargeStatus = "successful" ChargeReversed ChargeStatus = "reversed" )
ChargeStatus can be one of the following list of constants:
type Client ¶
type Client struct { *http.Client // Overrides Endpoints map[internal.Endpoint]string // configuration APIVersion string GoVersion string // contains filtered or unexported fields }
Client helps you configure and perform HTTP operations against Omise's REST API. It should be used with operation structures from the operations subpackage.
func NewClient ¶
NewClient creates and returns a Client with the given public key and secret key. Signs in to http://omise.co and visit https://dashboard.omise.co/test/dashboard to obtain your test (or live) keys.
func (*Client) Do ¶
Do performs the supplied operation against Omise's REST API and unmarshal the response into the given result parameter. Results are usually basic objects or a list that corresponds to the operations being done.
If the operation is successful, result should contains the response data. Otherwise a non-nil error should be returned. Error maybe of the omise-go.Error struct type, in which case you can further inspect the Code and Message field for more information.
Example ¶
// gets your API keys pkey, skey := "pkey_test_4yq6tct0llin5nyyi5l", "skey_test_4yq6tct0lblmed2yp5t" // creates a client client, err := NewClient(pkey, skey) if err != nil { log.Fatal(err) } // creates a charge charge, create := &Charge{}, &operations.CreateCharge{ Amount: 100000, // ¥10,000 Currency: "jpy", Card: "tok_1234", } // checks for error if err := client.Do(charge, create); err != nil { if omiseErr, ok := err.(*Error); ok { log.Fatal(omiseErr.Code + " " + omiseErr.Message) } else { log.Fatal("transport error: " + err.Error()) } } // verify fmt.Printf("authorized charge: %#v\n", charge)
Output:
type Customer ¶
type Customer struct { Base DefaultCard string `json:"default_card"` Email string `json:"email"` Description string `json:"description"` Cards *CardList `json:"cards"` Metadata map[string]interface{} `json:"metadata"` }
Customer represents Omise's customer object. See https://www.omise.co/customers-api for more information.
type CustomerList ¶
CustomerList represents the list structure returned by Omise's REST API that contains Customer struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*CustomerList) Find ¶
func (list *CustomerList) Find(id string) *Customer
Find finds and returns Customer with the given id. Returns nil if not found.
type CustomerSearchResult ¶
type CustomerSearchResult struct { SearchResult Data []*Customer `json:"data"` }
CustomerSearchResult represents search result structure returned by Omise's Search API that contains Customer struct as result elements.
type DeletionList ¶
DeletionList represents the list structure returned by Omise's REST API that contains Deletion struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*DeletionList) Find ¶
func (list *DeletionList) Find(id string) *Deletion
Find finds and returns Deletion with the given id. Returns nil if not found.
type Dispute ¶
type Dispute struct { Base Amount int64 `json:"amount"` Currency string `json:"currency"` Status DisputeStatus `json:"status"` Message string `json:"message"` Charge string `json:"charge"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Dispute represents Omise's dispute object. See https://www.omise.co/disputes-api for more information.
type DisputeList ¶
DisputeList represents the list structure returned by Omise's REST API that contains Dispute struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*DisputeList) Find ¶
func (list *DisputeList) Find(id string) *Dispute
Find finds and returns Dispute with the given id. Returns nil if not found.
type DisputeSearchResult ¶
type DisputeSearchResult struct { SearchResult Data []*Dispute `json:"data"` }
DisputeSearchResult represents search result structure returned by Omise's Search API that contains Dispute struct as result elements.
type DisputeStatus ¶
type DisputeStatus string
DisputeStatus represents an enumeration of possible status of a Dispute object.
const ( Open DisputeStatus = "open" Pending DisputeStatus = "pending" Won DisputeStatus = "won" Lost DisputeStatus = "lost" Closed DisputeStatus = "closed" // meta-status only for querying, does not actually appear. )
DisputeStatus can be one of the following list of constants:
type Document ¶
Document represents Omise's document object. See https://www.omise.co/documents-api for more information.
type DocumentList ¶
DocumentList represents the list structure returned by Omise's REST API that contains Document struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*DocumentList) Find ¶
func (list *DocumentList) Find(id string) *Document
Find finds and returns Document with the given id. Returns nil if not found.
type ErrInternal ¶
type ErrInternal string
ErrInternal represents internal library error. If you encounter this, it is mostly likely due to a bug in the omise-go library itself. Please report it by opening a new GitHub issue or contacting support.
func (ErrInternal) Error ¶
func (err ErrInternal) Error() string
type ErrTransport ¶
ErrTransport wraps error returned by omise-go internal HTTP transport implementation.
func (ErrTransport) Error ¶
func (err ErrTransport) Error() string
type Error ¶
type Error struct { Location string `json:"location"` StatusCode int `json:"status"` Code string `json:"code"` Message string `json:"message"` }
Error struct represents errors that may be returned from Omise's REST API. You can use the Code or the HTTP StatusCode field to test for the exact error condition in your code.
type Event ¶
Event represents Omise's event object.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON unmarshals the buffer into an internal shim structure first, in order to determine the right structure to use for the .Data field. Then will re-unmarshal the structure as normal.
type EventHandler ¶
type EventHandler interface {
HandleEvent(http.ResponseWriter, *http.Request, *Event)
}
EventHandler is an interface for handling events from the webhook http.Handler.
type EventHandlerFunc ¶
type EventHandlerFunc func(http.ResponseWriter, *http.Request, *Event)
EventHandlerFunc lets you use a plain function as an EventHandler type.
func (EventHandlerFunc) HandleEvent ¶
func (f EventHandlerFunc) HandleEvent(resp http.ResponseWriter, req *http.Request, event *Event)
HandleEvent implements the EventHandler interface by calling the underlying funciton.
type EventList ¶
EventList represents the list structure returned by Omise's REST API that contains Event struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
type Link ¶
type Link struct { Base Amount int64 `json:"amount"` Currency string `json:"currency"` Used bool `json:"used"` Multiple bool `json:"multiple"` PaymentURI string `json:"payment_uri"` Title string `json:"title"` Description string `json:"description"` Charges ChargeList `json:"charges"` }
Link represents Omise's link object. See https://www.omise.co/links-api for more information.
type LinkList ¶
LinkList represents the list structure returned by Omise's REST API that contains Link struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
type LinkSearchResult ¶
type LinkSearchResult struct { SearchResult Data []*Link `json:"data"` }
LinkSearchResult represents search result structure returned by Omise's Search API that contains Link struct as result elements.
type List ¶
type List struct { Base From string `json:"from"` To string `json:"to"` Offset int `json:"offset"` Limit int `json:"limit"` Total int `json:"total"` Order Ordering `json:"order"` }
List structure contains fields that are common to list objects returned by the Omise's REST API. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
type Occurrence ¶
type Occurrence struct { Base Schedule string `json:"schedule"` ScheduleDate Date `json:"schedule_date"` RetryDate Date `json:"retry_date"` ProcessedAt time.Time `json:"processed_at"` Status schedule.OccurrenceStatus `json:"status"` Message string `json:"message"` Result string `json:"result"` }
Occurrence represents occurrence charge from Schedule
type OccurrenceList ¶
type OccurrenceList struct { List Data []*Occurrence `json:"data"` }
OccurrenceList represents the list structure returned by Omise's REST API that contains Occurrence struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*OccurrenceList) Find ¶
func (list *OccurrenceList) Find(id string) *Occurrence
Find finds and returns Occurrence with the given id. Returns nil if not found.
type OccurrenceStatus ¶
type OccurrenceStatus string
OccurrenceStatus represents an enumeration of possible status of a Occurrence object.
const ( OccurrenceSkip OccurrenceStatus = "skipped" OccurrenceFailed OccurrenceStatus = "failed" OccurrenceSuccessful OccurrenceStatus = "successful" )
OccurrenceStatus can be one of the following list of constants:
type OffsiteTypes ¶
type OffsiteTypes string
OffsiteTypes represents an enumeration of possible types of offsite charges.
const ( InternetBankingSCB OffsiteTypes = "internet_banking_scb" InternetBankingBBL OffsiteTypes = "internet_banking_bbl" InternetBankingKTB OffsiteTypes = "internet_banking_ktb" InternetBankingBAY OffsiteTypes = "internet_banking_bay" Alipay OffsiteTypes = "alipay" )
OffsiteTypes can be one of the following list of constants:
type Ordering ¶
type Ordering string
Ordering represents an enumeration of possible values for list ordering while performing operations against the Omise API that result in List objects being returned.
type PaymentMethod ¶ added in v1.0.6
type PaymentMethod struct { Object string `json:"object"` Name string `json:"name"` Currencies []string `json:"currencies"` CardBrands []string `json:"card_brands"` InstallmentTerms []int `json:"installment_terms"` Banks []Bank `json:"banks"` }
PaymentMethod represents a payment method in the Omise's capability object.
type Receipt ¶
type Receipt struct { Base Number string `json:"number"` Date time.Time `json:"date"` CustomerName string `json:"customer_name"` CustomerAddress string `json:"customer_address"` CustomerTaxID string `json:"customer_tax_id"` CustomerEmail string `json:"customer_email"` CustomerStatementName string `json:"customer_statement_name"` CompanyName string `json:"company_name"` CompanyAddress string `json:"company_address"` CompanyTaxID string `json:"company_tax_id"` ChargeFee int64 `json:"charge_fee"` VoidedFee int64 `json:"voided_fee"` TransferFee int64 `json:"transfer_fee"` SubTotal int64 `json:"subtotal"` VAT int64 `json:"vat"` WHT int64 `json:"wht"` Total int64 `json:"total"` CreditNote bool `json:"credit_note"` Currency string `json:"currency"` }
Receipt represents Omise's receipt object. See https://www.omise.co/receipt-api for more information.
type ReceiptList ¶
ReceiptList represents the list structure returned by Omise's REST API that contains Receipt struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*ReceiptList) Find ¶
func (list *ReceiptList) Find(id string) *Receipt
Find finds and returns Receipt with the given id. Returns nil if not found.
type Recipient ¶
type Recipient struct { Base Verified bool `json:"verified"` Active bool `json:"active"` Name string `json:"name"` Email string `json:"email"` Description *string `json:"description"` Type RecipientType `json:"type"` TaxID *string `json:"tax_id"` BankAccount *BankAccount `json:"bank_account"` FailureCode *string `json:"failure_code"` }
Recipient represents Omise's recipient object. See https://www.omise.co/recipients-api for more information.
type RecipientList ¶
RecipientList represents the list structure returned by Omise's REST API that contains Recipient struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*RecipientList) Find ¶
func (list *RecipientList) Find(id string) *Recipient
Find finds and returns Recipient with the given id. Returns nil if not found.
type RecipientSearchResult ¶
type RecipientSearchResult struct { SearchResult Data []*Recipient `json:"data"` }
RecipientSearchResult represents search result structure returned by Omise's Search API that contains Recipient struct as result elements.
type RecipientType ¶
type RecipientType string
RecipientType represents an enumeration of possible types of Recipient(s).
const ( Individual RecipientType = "individual" Corporation RecipientType = "corporation" )
RecipientType can be one of the following list of constants:
type Refund ¶
type Refund struct { Base Amount int64 `json:"amount"` Currency string `json:"currency"` Charge string `json:"charge"` Transaction string `json:"transaction"` Metadata map[string]interface{} `json:"metadata"` }
Refund represents Omise's refund object. See https://www.omise.co/refunds-api for more information.
type RefundList ¶
RefundList represents the list structure returned by Omise's REST API that contains Refund struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*RefundList) Find ¶
func (list *RefundList) Find(id string) *Refund
Find finds and returns Refund with the given id. Returns nil if not found.
type RefundSearchResult ¶
type RefundSearchResult struct { SearchResult Data []*Refund `json:"data"` }
RefundSearchResult represents search result structure returned by Omise's Search API that contains Refund struct as result elements.
type Schedule ¶
type Schedule struct { Base Status schedule.Status `json:"status"` Every int `json:"every"` Period schedule.Period `json:"period"` On schedule.On `json:"on"` InWords string `json:"in_words"` StartDate Date `json:"start_date"` EndDate Date `json:"end_date"` Charge *schedule.ChargeDetail `json:"charge"` Transfer *schedule.TransferDetail `json:"transfer"` Occurrences OccurrenceList `json:"occurrences"` NextOccurrences []Date `json:"next_occurrences"` }
Schedule represents Omise's schedule object. See https://www.omise.co/schedule-api for more information.
type ScheduleList ¶
ScheduleList represents the list structure returned by Omise's REST API that contains Schedule struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*ScheduleList) Find ¶
func (list *ScheduleList) Find(id string) *Schedule
Find finds and returns Schedule with the given id. Returns nil if not found.
type SearchResult ¶
type SearchResult struct { Base Scope SearchScope `json:"scope"` Query string `json:"query"` Filters map[string]string `json:"filters"` Page int `json:"page"` Total int `json:"total"` TotalPages int `json:"total_pages"` Order Ordering `json:"order"` }
SearchResult structure contains fields that are common to search result objects returned by Omise's REST API.
type SearchScope ¶
type SearchScope string
SearchScope represents an enumeration of possible scopes that can be used with the Search API.
const ( UnspecifiedScope SearchScope = "" ChargeScope SearchScope = "charge" DisputeScope SearchScope = "dispute" RecipientScope SearchScope = "recipient" CustomerScope SearchScope = "customer" RefundScope SearchScope = "refund" TransferScope SearchScope = "transfer" LinkScope SearchScope = "link" )
SearchScope can be one of the following constants:
type Source ¶
type Source struct { Object string `json:"object"` ID string `json:"id"` Live bool `json:"livemode"` Location *string `json:"location"` Type string `json:"type"` Flow string `json:"flow"` Amount int64 `json:"amount"` Currency string `json:"currency"` }
Source represents Omise's source object. See https://www.omise.co/source-api for more information.
type SourceOfFunds ¶
type SourceOfFunds string
SourceOfFunds represents an enumeration of possible source of funds on a Charge object.
const ( FromCard SourceOfFunds = "card" FromOffsite SourceOfFunds = "offsite" )
SourceOfFunds can be one the following list of constants:
type Token ¶
Token represents Omise's token object. See https://www.omise.co/tokens-api for more information.
!!! IMPORTANT !!! - Full Credit Card data should never go through your server.
Sending card data from server requires a valid PCI-DSS certification. You can learn more about this on the Security Best Practices page at https://www.omise.co/security-best-practices
type TokenList ¶
TokenList represents the list structure returned by Omise's REST API that contains Token struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
type Transaction ¶
type Transaction struct { Base Source string `json:"source"` Type TransactionType `json:"type"` Amount int64 `json:"amount"` Currency string `json:"currency"` Transferable time.Time `json:"transferable"` }
Transaction represents Omise's transaction object. See https://www.omise.co/transactions-api for more information.
type TransactionList ¶
type TransactionList struct { List Data []*Transaction `json:"data"` }
TransactionList represents the list structure returned by Omise's REST API that contains Transaction struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*TransactionList) Find ¶
func (list *TransactionList) Find(id string) *Transaction
Find finds and returns Transaction with the given id. Returns nil if not found.
type TransactionType ¶
type TransactionType string
TransactionType represents an enumeration of possible types of Transaction.
const ( Credit TransactionType = "credit" Debit TransactionType = "debit" )
TransactionType can be one of the following list of constants:
type Transfer ¶
type Transfer struct { Base Recipient string `json:"recipient"` BankAccount *BankAccount `json:"bank_account"` Sent bool `json:"sent"` Paid bool `json:"paid"` Fee int64 `json:"fee"` Amount int64 `json:"amount"` Currency string `json:"currency"` FailureCode *string `json:"failure_code"` FailureMessage *string `json:"failure_message"` Transaction *string `json:"transaction"` Metadata map[string]interface{} `json:"metadata"` }
Transfer represents Omise's transfer object. See https://www.omise.co/transfers-api for more information.
type TransferList ¶
TransferList represents the list structure returned by Omise's REST API that contains Transfer struct as member elements. See the pagination and lists documentation at https://www.omise.co/api-pagination for more information.
func (*TransferList) Find ¶
func (list *TransferList) Find(id string) *Transfer
Find finds and returns Transfer with the given id. Returns nil if not found.
type TransferSearchResult ¶
type TransferSearchResult struct { SearchResult Data []*Transfer `json:"data"` }
TransferSearchResult represents search result structure returned by Omise's Search API that contains Transfer struct as result elements.
Source Files ¶
- account.go
- balance.go
- bank_account.go
- base.go
- capability.go
- card.go
- charge.go
- charge_status.go
- client.go
- customer.go
- date.go
- dispute.go
- dispute_status.go
- document.go
- error.go
- event.go
- link.go
- list.go
- list_types.go
- occurrence.go
- occurrence_status.go
- offsite_types.go
- omise.go
- ordering.go
- receipt.go
- recipient.go
- recipient_type.go
- refund.go
- schedule.go
- search_result.go
- search_result_types.go
- search_scope.go
- source.go
- source_of_funds.go
- token.go
- transaction.go
- transaction_type.go
- transfer.go
- transport.go
- webhook.go