Documentation ¶
Overview ¶
Package operations provide operation objects for use with Client. The operation object itself is also used to specify the parameters to be sent. See the Client documentation and example attached to each operation for usage instruction.
!!! IMPORTANT !!! - Always refer to the official Omise's REST API documentation at https://www.omise.co/charges-api for the most up-to-date version of what each of these operations does.
Index ¶
- type CaptureCharge
- type CreateCharge
- type CreateChargeSchedule
- type CreateCustomer
- type CreateLink
- type CreateRecipient
- type CreateRefund
- type CreateSource
- type CreateToken
- type CreateTransfer
- type CreateTransferSchedule
- type DestroyCard
- type DestroyCustomer
- type DestroyRecipient
- type DestroySchedule
- type DestroyTransfer
- type List
- type ListCards
- type ListChargeSchedules
- type ListCharges
- type ListCustomerChargeSchedules
- type ListCustomers
- type ListDisputes
- type ListEvents
- type ListLinks
- type ListReceipts
- type ListRecipientTransferSchedules
- type ListRecipients
- type ListRefunds
- type ListScheduleOccurrences
- type ListSchedules
- type ListTransactions
- type ListTransferSchedules
- type ListTransfers
- type RetrieveAccount
- type RetrieveBalance
- type RetrieveCapability
- type RetrieveCard
- type RetrieveCharge
- type RetrieveCustomer
- type RetrieveDispute
- type RetrieveEvent
- type RetrieveLink
- type RetrieveOccurrence
- type RetrieveReceipt
- type RetrieveRecipient
- type RetrieveRefund
- type RetrieveSchedule
- type RetrieveSource
- type RetrieveToken
- type RetrieveTransaction
- type RetrieveTransfer
- type ReverseCharge
- type Search
- type UpdateCard
- type UpdateCharge
- type UpdateCustomer
- type UpdateDispute
- type UpdateRecipient
- type UpdateTransfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptureCharge ¶
type CaptureCharge struct {
ChargeID string `json:"-"`
}
If you have created a charge and passed capture=false you'll have an authorized only charge that you can capture at a later time. You can hold it for as long as permitted by the issuing bank. This delay may vary between cards from 1 to 30 days.
Example:
charge := &omise.Charge{ID: "chrg_1234"} if e := client.Do(charge, &CaptureCharge{charge.ID}); e != nil { panic(e) } fmt.Println("captured:", charge.Captured)
func (*CaptureCharge) Describe ¶
func (req *CaptureCharge) Describe() *core.Description
type CreateCharge ¶
type CreateCharge struct { Customer string `json:"customer,omitempty"` Card string `json:"card,omitempty"` Source map[string]interface{} `json:"source,omitempty"` Amount int64 `json:"amount"` Currency string `json:"currency"` Offsite omise.OffsiteTypes `json:"offsite,omitempty"` Description string `json:"description,omitempty"` DontCapture bool `json:"-"` // inverse, since `capture` defaults to true ReturnURI string `json:"return_uri,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Note that because bool defaults to false in GO, we use DontCapture instead of Capture here so it matches with Omise's REST API default capture=true.
Example:
charge, create := &omise.Charge{}, &CreateCharge{ Amount: 204842, Currency: "thb", Description: "initial charge.", Card: token.ID, } if e := client.Do(charge, create); e != nil { panic(e) } fmt.Println("created charge:", charge.ID)
func (*CreateCharge) Describe ¶
func (req *CreateCharge) Describe() *core.Description
func (*CreateCharge) MarshalJSON ¶
func (req *CreateCharge) MarshalJSON() ([]byte, error)
type CreateChargeSchedule ¶
type CreateChargeSchedule struct { Every int Period schedule.Period StartDate string EndDate string Weekdays schedule.Weekdays DaysOfMonth schedule.DaysOfMonth WeekdayOfMonth string Customer string Amount int Currency string Card string Description string }
CreateChargeSchedule represent create charge schedule API payload
Example:
var schd omise.Schedule create := operations.CreateChargeSchedule{ Every: 3, Period: schedule.PeriodWeek, Weekdays: []schedule.Weekday{ schedule.Monday, schedule.Saturday, }, StartDate: "2017-05-15", EndDate: "2018-05-15", Customer: "customer_id", Amount: 100000, } if e := client.Do(&schd, &create); e != nil { panic(e) } fmt.Println("created schedule:", schd.ID)
func (*CreateChargeSchedule) Describe ¶
func (req *CreateChargeSchedule) Describe() *core.Description
func (*CreateChargeSchedule) MarshalJSON ¶
func (req *CreateChargeSchedule) MarshalJSON() ([]byte, error)
type CreateCustomer ¶
type CreateCustomer struct { Email string `json:"email,omitempty"` Description string `json:"description,omitempty"` Card string `json:"card,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
customer, create := &omise.Customer{}, &CreateCustomer{ Email: "kokyaku@omise.co", Description: "I'm a customer", Card: token.ID, }) if e := client.Do(customer, create); e != nil { panic(e) } fmt.Printf("created customer: %#v\n", customer)
func (*CreateCustomer) Describe ¶
func (req *CreateCustomer) Describe() *core.Description
type CreateLink ¶
type CreateLink struct { Amount int64 `json:"amount"` Currency string `json:"currency"` Title string `json:"title"` Description string `json:"description"` Multiple bool `json:"multiple"` }
func (*CreateLink) Describe ¶
func (req *CreateLink) Describe() *core.Description
type CreateRecipient ¶
type CreateRecipient struct { Name string `json:"name"` Email string `json:"email,omitempty"` Description string `json:"description,omitempty"` Type omise.RecipientType `json:"type"` TaxID string `json:"tax_id,omitempty"` BankAccount *omise.BankAccount `json:"-"` }
Example:
bankAccount := &omise.BankAccount{ Brand: "bbl", Number: "1234567890", Name: "Joe Example", } jun, create := &omise.Recipient{}, &CreateRecipient{ Name: "Jun Hasegawa", Email: "jun@omise.co", Description: "Owns Omise", Type: omise.Individual, BankAccount: bankAccount, } if e := client.Do(jun, create); e != nil { panic(e) } fmt.Println("created recipient:", jun.ID) # For Japan Bank Account bankAccount := &omise.BankAccount{ BankCode: "0001", BranchCode: "001", AccountType: omise.Normal, Number: "0000001", Name: "Joe Example", } jun, create := &omise.Recipient{}, &CreateRecipient{ Name: "Jun Hasegawa", Email: "jun@omise.co", Description: "Owns Omise", Type: omise.Individual, BankAccount: bankAccount, } if e := client.Do(jun, create); e != nil { panic(e) } fmt.Println("created recipient:", jun.ID)
func (*CreateRecipient) Describe ¶
func (req *CreateRecipient) Describe() *core.Description
func (*CreateRecipient) MarshalJSON ¶
func (req *CreateRecipient) MarshalJSON() ([]byte, error)
type CreateRefund ¶
type CreateRefund struct { ChargeID string `json:"-"` Amount int64 `json:"amount"` Void bool `json:"void,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
refund, create := &omise.Refund{}, &CreateRefund{ ChargeID: charge.ID, Amount: charge.Amount >> 1, // half } if e := client.Do(refund, create); e != nil { panic(e) } fmt.Println("refunded half of charge with:", refund.ID)
func (*CreateRefund) Describe ¶
func (req *CreateRefund) Describe() *core.Description
type CreateSource ¶
type CreateSource struct { Type string `json:"type"` Amount int64 `json:"amount"` Currency string `json:"currency"` Bank string `json:"bank,omitempty"` Barcode string `json:"barcode,omitempty"` Email string `json:"email,omitempty"` InstallmentTerm int64 `json:"installment_term,omitempty"` Name string `json:"name,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` StoreID string `json:"store_id,omitempty"` StoreName string `json:"store_name,omitempty"` TerminalID string `json:"terminal_id,omitempty"` ZeroInterestInstallments bool `json:"zero_interest_installments,omitempty"` }
Example: Create source
source, createSource := &omise.Source{}, &CreateSource{ Amount: 100000, Currency: "thb", Type: "bill_payment_tesco_lotus", } if e := client.Do(source, createSource); e != nil { panic(e) } fmt.Println("created source:", source.ID)
func (*CreateSource) Describe ¶
func (req *CreateSource) Describe() *core.Description
type CreateToken ¶
type CreateToken struct { Name string `json:"name"` Number string `json:"number"` ExpirationMonth time.Month `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` SecurityCode string `json:"security_code"` City string `json:"city,omitempty"` PostalCode string `json:"postal_code,omitempty"` }
Example:
token, create := &omise.Token{}, &CreateToken{ Name: "Chakrit Wichian", Number: "4242424242424242", ExpirationMonth: 2, ExpirationYear: time.Now().AddDate(1, 0, 0).Year(), SecurityCode: "123", City: "Bangkok", PostalCode: "10240", } if e := client.Do(token, CreateTokenOp); e != nil { panic(e) } fmt.Println("created token:", token.ID)
func (*CreateToken) Describe ¶
func (req *CreateToken) Describe() *core.Description
func (*CreateToken) MarshalJSON ¶
func (req *CreateToken) MarshalJSON() ([]byte, error)
type CreateTransfer ¶
type CreateTransfer struct { Amount int64 `json:"amount,omitempty"` Recipient string `json:"recipient,omitempty"` FailFast bool `json:"fail_fast,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
transfer, create := &omise.Transfer{}, &CreateTransfer{ Amount: 32100, } if e := client.Do(transfer, create); e != nil { panic(e) } fmt.Println("transferred to default recipient with:", transfer.ID)
func (*CreateTransfer) Describe ¶
func (req *CreateTransfer) Describe() *core.Description
type CreateTransferSchedule ¶
type CreateTransferSchedule struct { Every int Period schedule.Period StartDate string EndDate string Weekdays schedule.Weekdays DaysOfMonth schedule.DaysOfMonth WeekdayOfMonth string Recipient string Amount int PercentageOfBalance float64 }
CreateTransferSchedule represent create transfer schedule API payload
Example:
var schd omise.Schedule create = operations.CreateTransferSchedule{ Every: 3, Period: schedule.PeriodWeek, Weekdays: []schedule.Weekday{ schedule.Monday, schedule.Saturday, }, StartDate: "2017-05-15", EndDate: "2018-05-15", Recipient: "recipient_id", Amount: 100000, } if e := client.Do(&schd, &create); e != nil { panic(e) } fmt.Println("created schedule:", schd.ID)
func (*CreateTransferSchedule) Describe ¶
func (req *CreateTransferSchedule) Describe() *core.Description
func (*CreateTransferSchedule) MarshalJSON ¶
func (req *CreateTransferSchedule) MarshalJSON() ([]byte, error)
type DestroyCard ¶
Example:
del, destroy := &omise.Deletion{}, &DestroyCard{ CustomerID: "cust_123", CardID: "card_456", } if e := client.Do(del, destroy); e != nil { panic(e) } fmt.Println("deleted:", del.ID, del.Deleted)
func (*DestroyCard) Describe ¶
func (req *DestroyCard) Describe() *core.Description
type DestroyCustomer ¶
type DestroyCustomer struct {
CustomerID string `json:"-"`
}
Example:
del, destroy := &omise.Deletion{}, &DestroyCustomer{ CustomerID: "cust_123", } if e := client.Do(del, destroy); e != nil { panic(e) } fmt.Println("destroyed customer:", del.ID)
func (*DestroyCustomer) Describe ¶
func (req *DestroyCustomer) Describe() *core.Description
type DestroyRecipient ¶
type DestroyRecipient struct {
RecipientID string `json:"-"`
}
Example:
del, destroy := &omise.Deletion{}, &DestroyRecipient{"recp-123"} if e := client.Do(del, destroy); e != nil { panic(e) } fmt.Println("destroyed recipient:", del.ID)
func (*DestroyRecipient) Describe ¶
func (req *DestroyRecipient) Describe() *core.Description
type DestroySchedule ¶
type DestroySchedule struct {
ScheduleID string `json:"-"`
}
DestroySchedule represent destroy schedule API payload
Example:
var deletedSchd omise.Schedule if e := client.Do(&deletedSchd, &DestroySchedule{ScheduleID: "schd_57z9hj228pusa652nk1"}); e != nil { panic(e) } fmt.Println("destroyed schedule:", deletedSchd.ID)
func (*DestroySchedule) Describe ¶
func (req *DestroySchedule) Describe() *core.Description
type DestroyTransfer ¶
type DestroyTransfer struct {
TransferID string `json:"-"`
}
Example:
del, destroy := &omise.Deletion{}, &DestroyTransfer{"trsf_777"} if e := client.Do(del, destroy); e != nil { panic(e) } fmt.Println("not transferring anymore:", del.ID)
func (*DestroyTransfer) Describe ¶
func (req *DestroyTransfer) Describe() *core.Description
type List ¶
type List struct { Offset int `json:"offset,omitempty"` Limit int `json:"limit,omitempty"` From time.Time `json:"-"` To time.Time `json:"-"` Order omise.Ordering `json:"order,omitempty"` }
List contains fields that represent parameters common to most list operations. List struct is not an operation in and of itself and cannot be used with client.Do directly. Use one of the predefined XXXList operations defined blow instead and supply List struct as the first field.
See the Pagination and Lists documentation at https://www.omise.co/api-pagination for more information.
type ListCards ¶
Example:
cards, list := &omise.CardList{}, &ListCards{ CustomerID: "cust_333", } if e := client.Do(cards, list); e != nil { panic(e) } fmt.Println("# of customer's cards:", len(cards.Data))
func (*ListCards) Describe ¶
func (req *ListCards) Describe() *core.Description
type ListChargeSchedules ¶
type ListChargeSchedules struct {
List
}
ListChargeSchedules represent list charge schedules API payload
Example:
var schds omise.ScheduleList list = ListChargeSchedules{ List: List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(&schds, &list); e != nil { panic(e) } fmt.Println("# of charge schedules made in the last hour:", len(schds.Data))
func (*ListChargeSchedules) Describe ¶
func (req *ListChargeSchedules) Describe() *core.Description
type ListCharges ¶
type ListCharges struct {
List
}
Example:
charges, list := &omise.ChargeList{}, &ListCharges{ List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(charges, list); e != nil { panic(e) } fmt.Println("# of charges made in the last hour:", len(charges.Data))
func (*ListCharges) Describe ¶
func (req *ListCharges) Describe() *core.Description
type ListCustomerChargeSchedules ¶
ListCustomerChargeSchedules represent list customer schedule schedules API payload
Example:
var schds omise.ScheduleList list := ListCustomerChargeSchedules{ CustomerID: "cust_123" List: List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(&schds, &list); e != nil { panic(e) } fmt.Println("# of schedules made in the last hour:", len(schds.Data))
func (*ListCustomerChargeSchedules) Describe ¶
func (req *ListCustomerChargeSchedules) Describe() *core.Description
type ListCustomers ¶
type ListCustomers struct {
List
}
Example:
customers, list := &omise.CustomerList{}, &ListCustomers{ List{ From: time.Now().Add(-1 * time.Hour), Limit: 100 }, } if e := client.Do(customers, list); e != nil { panic(e) } fmt.Println("# of new customers in the last hour:", len(customers.Data))
func (*ListCustomers) Describe ¶
func (req *ListCustomers) Describe() *core.Description
type ListDisputes ¶
type ListDisputes struct { State omise.DisputeStatus List }
Example:
disputes, list := &omise.DisputeList{}, &ListDisputes{ State: omise.Open, } if e := client.Do(disputes, list); e != nil { panic(e) } fmt.Println("# of open disputes:", len(disputes.Data))
func (*ListDisputes) Describe ¶
func (req *ListDisputes) Describe() *core.Description
type ListEvents ¶
type ListEvents struct {
List
}
Example:
events, list := &omise.EventList{}, &ListEvents{} if e := client.Do(events, list); e != nil { panic(e) } fmt.Println("# of events:", len(events.Data))
func (*ListEvents) Describe ¶
func (req *ListEvents) Describe() *core.Description
type ListLinks ¶
type ListLinks struct {
List
}
func (*ListLinks) Describe ¶
func (req *ListLinks) Describe() *core.Description
type ListReceipts ¶
type ListReceipts struct {
List
}
Example:
receipts, list := &omise.ReceiptList{}, &ListReceipts{ List{Offset: 100, Limit: 20}, } if e := client.Do(receipts, list); e != nil { panic(e) } fmt.Println("receipts #100-#120:", receipts.Data)
func (*ListReceipts) Describe ¶
func (req *ListReceipts) Describe() *core.Description
type ListRecipientTransferSchedules ¶
ListRecipientTransferSchedules represent list recipient transfer schedules API payload
Example:
var schds omise.ScheduleList list := ListRecipientTransferSchedules{ RecipientID: "reci_123" List: List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(&schds, &list); e != nil { panic(e) } fmt.Println("# of schedules made in the last hour:", len(schds.Data))
func (*ListRecipientTransferSchedules) Describe ¶
func (req *ListRecipientTransferSchedules) Describe() *core.Description
type ListRecipients ¶
type ListRecipients struct {
List
}
Example:
recipients, list := &omise.RecipientList{}, &ListRecipients{ List{Offset: 100, Limit: 20}, } if e := client.Do(recipients, list); e != nil { panic(e) } fmt.Println("recipients #100-#120:", recipients.Data)
func (*ListRecipients) Describe ¶
func (req *ListRecipients) Describe() *core.Description
type ListRefunds ¶
Example:
refunds, list := &omise.RefundList{}, &ListRefunds{"chrg_333"} if e := client.Do(refunds, list); e != nil { panic(e) } fmt.Println("refunded on chrg_333:", refunds.Data[0].Amount)
func (*ListRefunds) Describe ¶
func (req *ListRefunds) Describe() *core.Description
type ListScheduleOccurrences ¶
ListScheduleOccurrences represent list schedule occurrences API payload
Example:
var occurrences omise.OccurrenceList list := ListOccurrenceSchedules{ ScheduleID: "schd_57z9hj228pusa652nk1", List: List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(&occurrences, &list); e != nil { panic(e) } fmt.Println("occurrences made in the last hour:", len(occurrences.Data))
func (*ListScheduleOccurrences) Describe ¶
func (req *ListScheduleOccurrences) Describe() *core.Description
type ListSchedules ¶
type ListSchedules struct {
List
}
ListSchedules represent list schedule API payload
Example:
var schds omise.ScheduleList list := ListSchedules{ List: List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(&schds, &list); e != nil { panic(e) } fmt.Println("# of schedules made in the last hour:", len(schds.Data))
func (*ListSchedules) Describe ¶
func (req *ListSchedules) Describe() *core.Description
type ListTransactions ¶
type ListTransactions struct {
List
}
Example:
transactions, list := &omise.TransactionList{}, &ListTransaction{ List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(transactions, list); !a.NoError(t, e) { return } fmt.Println("# of transactions in the last hour:", len(transactions.Data))
func (*ListTransactions) Describe ¶
func (req *ListTransactions) Describe() *core.Description
type ListTransferSchedules ¶
type ListTransferSchedules struct {
List
}
ListTransferSchedules represent list transfer schedules API payload
Example:
var schds omise.ScheduleList list = ListTransferSchedules{ List: List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(&schds, &list); e != nil { panic(e) } fmt.Println("# of transfer schedules made in the last hour:", len(schds.Data))
func (*ListTransferSchedules) Describe ¶
func (req *ListTransferSchedules) Describe() *core.Description
type ListTransfers ¶
type ListTransfers struct {
List
}
Example:
transfers, list := &omise.TransferList{}, &ListTransfers{ List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, } if e := client.Do(transfers, list); e != nil { panic(e) } fmt.Println("# of transfers in the last hour:", len(transfers.Data))
func (*ListTransfers) Describe ¶
func (req *ListTransfers) Describe() *core.Description
type RetrieveAccount ¶
type RetrieveAccount struct{}
Example:
account := &omise.Account{} if e := client.Do(account, &RetrieveAccount{}); e != nil { panic(e) } fmt.Printf("my account!: %#v\n", account)
func (*RetrieveAccount) Describe ¶
func (req *RetrieveAccount) Describe() *core.Description
type RetrieveBalance ¶
type RetrieveBalance struct{}
Example:
balance := &omise.Balance{} if e := client.Do(balance, &RetrieveBalance{}); e != nil { panic(e) } fmt.Println("we have $", balance.Available)
func (*RetrieveBalance) Describe ¶
func (req *RetrieveBalance) Describe() *core.Description
type RetrieveCapability ¶
type RetrieveCapability struct{}
Example: Retrieve Capability
capability, retrieve := &omise.RetrieveCapability{}, &RetrieveCapability{} if e := client.Do(capability, retrieve); e != nil { panic(e) } fmt.Printf("list payment methods: %#v\n", capability.PaymentMethods)
func (*RetrieveCapability) Describe ¶
func (req *RetrieveCapability) Describe() *core.Description
type RetrieveCard ¶
Example:
card, retrieve := &omise.Card{}, &RetrieveCard{ CustomerID: "cust_888", CardID: "card_999", } if e := client.Do(card, retrieve); e != nil { panic(e) } fmt.Printf("the card: %#v\n", card)
func (*RetrieveCard) Describe ¶
func (req *RetrieveCard) Describe() *core.Description
type RetrieveCharge ¶
type RetrieveCharge struct {
ChargeID string `json:"-"`
}
Example:
charge := &omise.Charge{ID: "chrg_323"} if e := client.Do(charge, &RetrieveCharge{charge.ID}); e != nil { panic(e) } fmt.Printf("charge #chrg_323: %#v\n", charge)
func (*RetrieveCharge) Describe ¶
func (req *RetrieveCharge) Describe() *core.Description
type RetrieveCustomer ¶
type RetrieveCustomer struct {
CustomerID string `json:"-"`
}
Example:
cust, retrieve := &omise.Customer{}, &RetrieveCustomer{"cust_123"} if e := client.Do(cust, retrieve); e != nil { panic(e) } fmt.Printf("cust_123: %#v\n", cust)
func (*RetrieveCustomer) Describe ¶
func (req *RetrieveCustomer) Describe() *core.Description
type RetrieveDispute ¶
type RetrieveDispute struct {
DisputeID string `json:"-"`
}
Example:
dispute, retrieve := &omise.Dispute{}, &RetrieveDispute{"dspt_123"} if e := client.Do(dispute, retrieve); e != nil { panic(e) } fmt.Printf("dispute #123: %#v\n", dispute)
func (*RetrieveDispute) Describe ¶
func (req *RetrieveDispute) Describe() *core.Description
type RetrieveEvent ¶
type RetrieveEvent struct {
EventID string `json:"-"`
}
Example:
event, retrieve := &omise.Event{}, &RetrieveEvent{"evnt_123"} if e := client.Do(event, retrieve); e != nil { panic(e) } fmt.Printf("evnt_123: %#v\n", event)
func (*RetrieveEvent) Describe ¶
func (req *RetrieveEvent) Describe() *core.Description
type RetrieveLink ¶
type RetrieveLink struct {
LinkID string `json:"-"`
}
func (*RetrieveLink) Describe ¶
func (req *RetrieveLink) Describe() *core.Description
type RetrieveOccurrence ¶
type RetrieveOccurrence struct {
OccurrenceID string `json:"-"`
}
RetrieveOccurrence represent retrieve occurrence API payload
Example:
var occurrence omise.Occurrence if e := client.Do(&occurrence, &RetrieveOccurrence{OccurrenceID: "occu_57z9hj228pusa652nk1"}); e != nil { panic(e) } fmt.Printf("occurrence #occu_57z9hj228pusa652nk1: %#v\n", occurrence)
func (*RetrieveOccurrence) Describe ¶
func (req *RetrieveOccurrence) Describe() *core.Description
type RetrieveReceipt ¶
type RetrieveReceipt struct {
ReceiptID string `json:"-"`
}
Example:
rcpt, receipt := &omise.Receipt{}, &RetrieveReceipt{"rcpt_123"} if e := client.Do(rcpt, receipt); e != nil { panic(e) } fmt.Printf("receipt #123: %#v\n", rcpt)
func (*RetrieveReceipt) Describe ¶
func (req *RetrieveReceipt) Describe() *core.Description
type RetrieveRecipient ¶
type RetrieveRecipient struct {
RecipientID string `json:"-"`
}
Example:
recp, retrieve := &omise.Recipient{}, &RetrieveRecipient{"recp_123"} if e := client.Do(recp, retrieve); e != nil { panic(e) } fmt.Printf("recipient #123: %#v\n", recp)
func (*RetrieveRecipient) Describe ¶
func (req *RetrieveRecipient) Describe() *core.Description
type RetrieveRefund ¶
Example:
refund, retrieve := &omise.Refund{}, &RetrieveRefund{ ChargeID: "chrg_123", RefundID: "rfnd_777", } if e := client.Do(refund, retrieve); e != nil { panic(e) } fmt.Printf("refund #777: %#v\n", refund)
func (*RetrieveRefund) Describe ¶
func (req *RetrieveRefund) Describe() *core.Description
type RetrieveSchedule ¶
type RetrieveSchedule struct {
ScheduleID string `json:"-"`
}
RetrieveSchedule represent retrieve schedule API payload
Example:
var schd omise.Schedule if e := client.Do(&schd, &RetrieveSchedule{ScheduleID: "schd_57z9hj228pusa652nk1"}); e != nil { panic(e) } fmt.Printf("schedule #schd_57z9hj228pusa652nk1: %#v\n", schd)
func (*RetrieveSchedule) Describe ¶
func (req *RetrieveSchedule) Describe() *core.Description
type RetrieveSource ¶
type RetrieveSource struct {
SourceID string `json:"-"`
}
Example: Retrieve Source
source, retrieve := &omise.Source{}, &RetrieveSource{"src_123"} if e := client.Do(source, retrieve); e != nil { panic(e) } fmt.Printf("source #123: %#v\n", source)
func (*RetrieveSource) Describe ¶
func (req *RetrieveSource) Describe() *core.Description
type RetrieveToken ¶
type RetrieveToken struct {
ID string `json:"-"`
}
Example:
token, retrieve := &omise.Token{}, &RetrieveToken{"tok_789"} if e := client.Do(token, retrieve); e != nil { panic(e) } fmt.Printf("token: %#v\n", token)
func (*RetrieveToken) Describe ¶
func (token *RetrieveToken) Describe() *core.Description
type RetrieveTransaction ¶
type RetrieveTransaction struct {
TransactionID string `json:"-"`
}
Example:
transaction, retrieve := &omise.Transaction{}, &RetrieveTransaction{"trxn_987"} TransactionID: transactions.Data[0].ID, } if e := client.Do(transaction, retrieve); e != nil { panic(e) } fmt.Printf("transaction #trxn_987: %#v\n", transaction)
func (*RetrieveTransaction) Describe ¶
func (req *RetrieveTransaction) Describe() *core.Description
type RetrieveTransfer ¶
type RetrieveTransfer struct {
TransferID string `json:"-"`
}
Example:
transfer, retrieve := &omise.Transfer{}, &RetrieveTransfer{"trsf_123"} if e := client.Do(transfer, retrieve); e != nil { panic(e) } fmt.Printf("transfer #123: %#v\n", transfer)
func (*RetrieveTransfer) Describe ¶
func (req *RetrieveTransfer) Describe() *core.Description
type ReverseCharge ¶
type ReverseCharge struct {
ChargeID string `json:"-"`
}
If you have created a charge and passed capture=false you'll have an authorized only charge that can be reversed, releasing held money, at a later time without incurring a refund fee.
func (*ReverseCharge) Describe ¶
func (req *ReverseCharge) Describe() *core.Description
type Search ¶
type Search struct { Scope omise.SearchScope `json:"scope"` Query string `json:"query,omitempty"` Filters map[string]string `json:"filters,omitempty"` Order omise.Ordering `json:"order,omitempty"` Page int `json:"page,omitempty"` PerPage int `json:"per_page,omitempty"` }
Example:
result, search := &omise.ChargeSearchResult{}, &Search{ Scope: omise.ChargeScope, Query: "chrg_test_12345", } if e := client.Do(result, search); e != nil { panic(e) }
func (*Search) Describe ¶
func (req *Search) Describe() *core.Description
type UpdateCard ¶
type UpdateCard struct { CustomerID string `json:"-"` CardID string `json:"-"` Name string `json:"name,omitempty"` City string `json:"city,omitempty"` PostalCode string `json:"postal_code,omitempty"` ExpirationMonth time.Month `json:"expiration_month,omitempty"` ExpirationYear int `json:"expiration_year,omitempty"` }
Example:
card, update := &omise.Card{}, &UpdateCard{ CustomerID: "cust_123", CardID: "card_123", Name: "Changed my name", } if e := client.Do(card, update); e != nil { panic(e) } fmt.Printf("updated card: %#v\n", card)
func (*UpdateCard) Describe ¶
func (req *UpdateCard) Describe() *core.Description
type UpdateCharge ¶
type UpdateCharge struct { ChargeID string `json:"-"` Description string `json:"description"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
charge, update := &omise.Charge{}, &UpdateCharge{ ChargeID: "chrg_456", Description: "updated charge.", } if e := client.Do(charge, update); e != nil { panic(e) } fmt.Printf("updated charge: %#v\n", charge)
func (*UpdateCharge) Describe ¶
func (req *UpdateCharge) Describe() *core.Description
type UpdateCustomer ¶
type UpdateCustomer struct { CustomerID string `json:"-"` Email string `json:"email,omitempty"` Description string `json:"description,omitempty"` Card string `json:"card,omitempty"` DefaultCard string `json:"default_card,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
cust, update := &&omise.Customer{}, UpdateCustomer{ CustomerID: "cust_987", Description: "I'm JOHN now.", } if e := client.Do(cust, update); e != nil { panic(e) } fmt.Printf("updated customer: %#v\n", cust)
func (*UpdateCustomer) Describe ¶
func (req *UpdateCustomer) Describe() *core.Description
type UpdateDispute ¶
type UpdateDispute struct { DisputeID string `json:"-"` Message string `json:"message"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
dispute, update := &omise.Dispute{}, &UpdateDispute{ DisputeID: "dspt_777", Message: "update me!", } if e := client.Do(dispute, update); e != nil { panic(e) } fmt.Printf("updated dispute: %#v\n", dispute)
func (*UpdateDispute) Describe ¶
func (req *UpdateDispute) Describe() *core.Description
type UpdateRecipient ¶
type UpdateRecipient struct { RecipientID string `json:"-"` Name string `json:"name"` Email string `json:"email,omitempty"` Description string `json:"description,omitempty"` Type omise.RecipientType `json:"type"` TaxID string `json:"tax_id,omitempty"` BankAccount *omise.BankAccount `json:"-"` }
Example:
jones, update := &omise.Recipient{}, &UpdateRecipient{ RecipientID: "recp_123", Description: "I'm JONES now.", } if e := client.Do(jones, update); e != nil { panic(e) } fmt.Printf("jones: %#v\n", jones)
func (*UpdateRecipient) Describe ¶
func (req *UpdateRecipient) Describe() *core.Description
func (*UpdateRecipient) MarshalJSON ¶
func (req *UpdateRecipient) MarshalJSON() ([]byte, error)
type UpdateTransfer ¶
type UpdateTransfer struct { TransferID string `json:"-"` Amount int64 `json:"amount,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Example:
transfer, update := &omise.Transfer{}, &UpdateTransfer{ TransferID: "trsf_777", Amount: 12300, } if e := client.Do(transfer, update); e != nil { panic(e) } fmt.Printf("updated transfer #777: %#v\n", transfer)
func (*UpdateTransfer) Describe ¶
func (req *UpdateTransfer) Describe() *core.Description