diff --git a/.gitignore b/.gitignore index 485dee64..15a0d587 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .idea +examples/.env +examples/.DS_Store \ No newline at end of file diff --git a/balance.go b/balance.go index 060e07df..2fc3a015 100644 --- a/balance.go +++ b/balance.go @@ -4,7 +4,7 @@ package omise // See https://www.omise.co/balance-api for more information. type Balance struct { Base - Available int64 `json:"available"` - Total int64 `json:"total"` - Currency string `json:"currency"` + Transferable int64 `json:"transferable"` + Total int64 `json:"total"` + Currency string `json:"currency"` } diff --git a/bank_account.go b/bank_account.go index ff07a021..42b1f151 100644 --- a/bank_account.go +++ b/bank_account.go @@ -2,17 +2,30 @@ package omise // BankAccount represents Omise's bank account object. // See https://www.omise.co/bank-account-api for more information. +type BankAccountRequest struct { + Base + Brand string `json:"brand"` + LastDigits string `json:"last_digits"` + Name string `json:"name"` + + // for Omise Japan + BankCode string `json:"bank_code"` + BranchCode string `json:"branch_code"` + Type BankAccountType `json:"type"` + Number string `json:"number"` +} + 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"` + BankCode string `json:"bank_code"` + BranchCode string `json:"branch_code"` + Type BankAccountType `json:"type"` + AccountNumber string `json:"account_number"` } // BankAccountType BankAccount an enumeration of possible types of BackAccount(s) which can be diff --git a/base.go b/base.go index 3142c8fe..e78446b6 100644 --- a/base.go +++ b/base.go @@ -5,11 +5,11 @@ import "time" // Base structure contains fields that are common to objects returned by the Omise's REST // API. type Base struct { - Object string `json:"object"` - ID string `json:"id"` - Live bool `json:"livemode"` - Location *string `json:"location"` - Created time.Time `json:"created"` + Object string `json:"object"` + ID string `json:"id"` + Live bool `json:"livemode"` + Location *string `json:"location"` + CreatedAt time.Time `json:"created_at"` } // Deletion struct is used to receive deletion responses from delete operations. diff --git a/charge.go b/charge.go index d0fa42e2..92d99f63 100644 --- a/charge.go +++ b/charge.go @@ -6,13 +6,13 @@ import "time" // See https://www.omise.co/charges-api for more information. type Charge struct { Base - Status ChargeStatus `json:"status"` - Amount int64 `json:"amount"` - AuthorizationType AuthorizationType `json:"authorization_type"` - AuthorizedAmount int64 `json:"authorized_amount"` - CapturedAmount int64 `json:"captured_amount"` - Currency string `json:"currency"` - Description *string `json:"description"` + Status ChargeStatus `json:"status"` + Amount int64 `json:"amount"` + AuthorizationType AuthorizationType `json:"authorization_type"` + AuthorizedAmount int64 `json:"authorized_amount"` + CapturedAmount int64 `json:"captured_amount"` + Currency string `json:"currency"` + Description *string `json:"description"` Capture bool `json:"capture"` Authorized bool `json:"authorized"` @@ -22,7 +22,7 @@ type Charge struct { Transaction string `json:"transaction"` Card *Card `json:"card"` - Refunded int64 `json:"refunded"` + RefundedAmount int64 `json:"refunded_amount"` Refunds *RefundList `json:"refunds"` FailureCode *string `json:"failure_code"` FailureMessage *string `json:"failure_message"` @@ -35,9 +35,35 @@ type Charge struct { 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"` ExpiresAt time.Time `json:"expires_at"` } + +type TransactionIndicator string + +const ( + MIT TransactionIndicator = "MIT" + CIT TransactionIndicator = "CIT" +) + +type RecurringReason string + +const ( + Blank RecurringReason = "" + Unscheduled RecurringReason = "unscheduled" + StandingOrder RecurringReason = "standing_order" + Subscription RecurringReason = "subscription" + Installment RecurringReason = "installment" + PartialShipment RecurringReason = "partial_shipment" + DelayedCharge RecurringReason = "delayed_charge" + NoShow RecurringReason = "no_show" + Resubmission RecurringReason = "resubmission" +) + +type PlatformFee struct { + Fixed int32 `json:"fixed,omitempty"` + Percentage float32 `json:"percentage,omitempty"` + Amount int64 `json:"Amount,omitempty"` +} diff --git a/client.go b/client.go index c6333604..4ccae409 100644 --- a/client.go +++ b/client.go @@ -28,7 +28,6 @@ type Client struct { Endpoints map[internal.Endpoint]string // configuration - APIVersion string GoVersion string customHeaders map[string]string ctx context.Context @@ -138,9 +137,7 @@ func (c *Client) setRequestHeaders(req *http.Request, desc *internal.Description } req.Header.Add("User-Agent", strings.TrimSpace(ua)) - if c.APIVersion != "" { - req.Header.Add("Omise-Version", c.APIVersion) - } + req.Header.Add("Omise-Version", internal.Version) // setting custom headers passed from the caller for k, v := range c.customHeaders { diff --git a/client_test.go b/client_test.go index e223464b..29f11d5c 100644 --- a/client_test.go +++ b/client_test.go @@ -76,14 +76,12 @@ func TestClient_Request(t *testing.T) { r.Contains(t, req.Header.Get("User-Agent"), "OmiseGo/") r.Contains(t, req.Header.Get("User-Agent"), "Go/go") r.Contains(t, req.Header.Get("X-Header-ABC"), "ABC") - r.Empty(t, req.Header.Get("Omise-Version"), "Omise-Version header sent when APIVersion is not specified.") + r.Equal(t, req.Header.Get("Omise-Version"), internal.Version) client.GoVersion = "RANDOMXXXVERSION" - client.APIVersion = "yadda" req, err = client.Request(desc) r.NoError(t, err) r.Contains(t, req.Header.Get("User-Agent"), "Go/RANDOMXXXVERSION") - r.Equal(t, req.Header.Get("Omise-Version"), "yadda") client.WithUserAgent("OmiseShopify/2.0.0 CheckoutPage/1.0.0") req, err = client.Request(desc) diff --git a/examples/env.example b/examples/env.example new file mode 100644 index 00000000..5f42017e --- /dev/null +++ b/examples/env.example @@ -0,0 +1,2 @@ +PUBLIC_KEY=**** +SECRET_KEY=**** \ No newline at end of file diff --git a/examples/go.mod b/examples/go.mod new file mode 100644 index 00000000..f41630c4 --- /dev/null +++ b/examples/go.mod @@ -0,0 +1,10 @@ +module github.com/omise/omise-go/examples + +go 1.21.3 + +require ( + github.com/joho/godotenv v1.5.1 // indirect + github.com/omise/omise-go v1.5.0 // indirect +) + +replace github.com/omise/omise-go => /Users/aashish/go/src/github.com/omise/omise-go diff --git a/examples/go.sum b/examples/go.sum new file mode 100644 index 00000000..cd686f5b --- /dev/null +++ b/examples/go.sum @@ -0,0 +1,16 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/omise/omise-go v1.5.0 h1:LVkNDMWVI3HdChugA6QmZuyTk63R00Army+TbZzxh/c= +github.com/omise/omise-go v1.5.0/go.mod h1:P2sXynkJeQOAe46sk1krS/v2irWUxuI+cKoQgm5Ayp4= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/main.go b/examples/main.go new file mode 100644 index 00000000..43ec95cc --- /dev/null +++ b/examples/main.go @@ -0,0 +1,93 @@ +package main + +import ( + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/omise/omise-go" + "github.com/omise/omise-go/examples/src" +) + +func main() { + err := godotenv.Load() + + if err != nil { + log.Fatalf("Error loading .env file") + } + + client, _ := omise.NewClient( + os.Getenv("PUBLIC_KEY"), + os.Getenv("SECRET_KEY"), + ) + + // client.SetDebug(true) + + /** + * Start: Create charge with QR + */ + chargeQR, err := src.CreateChargeQR(client) + + if err != nil { + log.Println(err) + } + + src.CustomLog(chargeQR) + + // Calling Sleep method + time.Sleep(1 * time.Second) + + /** + * Start: Create charge with card + */ + chargeCard, err := src.CreateChargeCard(client) + + if err != nil { + log.Println(err) + } + + src.CustomLog(chargeCard) + + // Calling Sleep method + time.Sleep(1 * time.Second) + + // /** + // * Start: Create recipient + // */ + recipient, err := src.CreateRecipient(client) + + if err != nil { + log.Println(err) + } + + src.CustomLog(recipient) + + // Calling Sleep method + time.Sleep(1 * time.Second) + + // /** + // * Start: Create charge schedule + // */ + chargeSchedule, err := src.CreateChargeSchedule(client) + + if err != nil { + log.Println(err) + } + + src.CustomLog(chargeSchedule) + + // Calling Sleep method + time.Sleep(1 * time.Second) + + // /** + // * Start: Create transfer schedule + // */ + transferSchedule, err := src.CreateTransferSchedule(client) + + if err != nil { + log.Println(err) + } + + src.CustomLog(transferSchedule) +} diff --git a/examples/src/account.go b/examples/src/account.go new file mode 100644 index 00000000..804a02cd --- /dev/null +++ b/examples/src/account.go @@ -0,0 +1,18 @@ +package src + +import ( + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func GetAccount(client *omise.Client) (*omise.Account, error) { + account := &omise.Account{} + + err := client.Do(account, &operations.RetrieveAccount{}) + + if err != nil { + return nil, err + } + + return account, nil +} diff --git a/examples/src/capability.go b/examples/src/capability.go new file mode 100644 index 00000000..7bf42da2 --- /dev/null +++ b/examples/src/capability.go @@ -0,0 +1,18 @@ +package src + +import ( + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func GetCapabilities(client *omise.Client) (*omise.Capability, error) { + capability := &omise.Capability{} + + err := client.Do(capability, &operations.RetrieveCapability{}) + + if err != nil { + return nil, err + } + + return capability, nil +} diff --git a/examples/src/charge_card.go b/examples/src/charge_card.go new file mode 100644 index 00000000..d8a4f0ff --- /dev/null +++ b/examples/src/charge_card.go @@ -0,0 +1,72 @@ +package src + +import ( + "fmt" + "time" + + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func CreateChargeCard(client *omise.Client) (*omise.Charge, error) { + // Creates a charge from the token + token, createToken := &omise.Token{}, &operations.CreateToken{ + Name: "Chakrit Wichian", + Number: "4242424242424242", + ExpirationMonth: 2, + ExpirationYear: time.Now().AddDate(1, 0, 0).Year(), + SecurityCode: "123", + Email: "aashish@omise.co", + PhoneNumber: "1234567890", + Country: "TH", + City: "Bangkok", + PostalCode: "10240", + Street1: "Sukumvit 63, Street 1", + Street2: "Sukumvit 63, Street 2", + } + + if e := client.Do(token, createToken); e != nil { + return nil, e + } + + timeString := "2024-09-15 02:30:45" + theTime, err := time.Parse("2006-01-02 03:04:05", timeString) + + if err != nil { + fmt.Println("Could not parse time:", err) + } + + client.WithCustomHeaders(map[string]string{ + "SUB_MERCHANT_ID": "team_60vxq170pzvgq8w7cz5", + }) + + // Creates a charge from the token + charge, createCharge := &omise.Charge{}, &operations.CreateCharge{ + Amount: 300000, // ฿ 1,000.00 + Currency: "thb", + ReturnURI: "http://opn.ooo", + Card: token.ID, + WebhookEndpoints: []string{"https://webhook.site/e3e511da-f9ab-4b69-b93d-dd868459a760"}, + + // Customer + Description: "This is a card cahrge", + DontCapture: false, + Metadata: map[string]interface{}{ + "Hello": "World", + }, + ExpiresAt: &theTime, + Ip: "192.168.1.1", + TransactionIndicator: omise.MIT, + RecurringReason: omise.Blank, + PlatformFee: omise.PlatformFee{ + Fixed: 10, + Percentage: 2, + }, + } + + if e := client.Do(charge, createCharge); e != nil { + return nil, e + } + + return charge, nil +} diff --git a/examples/src/charge_qr.go b/examples/src/charge_qr.go new file mode 100644 index 00000000..3f4d5790 --- /dev/null +++ b/examples/src/charge_qr.go @@ -0,0 +1,31 @@ +package src + +import ( + "log" + + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func CreateChargeQR(client *omise.Client) (*omise.Charge, error) { + source, err := CreateSource(client) + + if err != nil { + log.Fatal(err) + } + + // Creates a charge from the token + charge, createCharge := &omise.Charge{}, &operations.CreateCharge{ + Amount: 100000, // ฿ 1,000.00 + Currency: "thb", + ReturnURI: "http://opn.ooo", + WebhookEndpoints: []string{"https://webhook.site/e3e511da-f9ab-4b69-b93d-dd868459a760"}, + Source: source.ID, + } + + if e := client.Do(charge, createCharge); e != nil { + return nil, e + } + + return charge, nil +} diff --git a/examples/src/customer.go b/examples/src/customer.go new file mode 100644 index 00000000..7f8a1dda --- /dev/null +++ b/examples/src/customer.go @@ -0,0 +1,19 @@ +package src + +import ( + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func CreateCustomer(client *omise.Client) (*omise.Customer, error) { + customer, createCustomer := &omise.Customer{}, &operations.CreateCustomer{ + Email: "john.doe@example.com", + Description: "John Doe (id: 30)", + } + + if err := client.Do(customer, createCustomer); err != nil { + return nil, err + } + + return customer, nil +} diff --git a/examples/src/log.go b/examples/src/log.go new file mode 100644 index 00000000..1c54be52 --- /dev/null +++ b/examples/src/log.go @@ -0,0 +1,16 @@ +package src + +import ( + "encoding/json" + "log" +) + +func CustomLog(d interface{}) { + result, err := json.Marshal(d) + + if err != nil { + log.Println(err) + } + + log.Println(string(result)) +} diff --git a/examples/src/receipient.go b/examples/src/receipient.go new file mode 100644 index 00000000..ea20a5e1 --- /dev/null +++ b/examples/src/receipient.go @@ -0,0 +1,32 @@ +package src + +import ( + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func CreateRecipient(client *omise.Client) (*omise.Recipient, error) { + recipient, createRecipient := &omise.Recipient{}, &operations.CreateRecipient{ + Name: "Omise", + Email: "aashish@opn.ooo", + Description: "This is a test recipient", + Type: omise.Corporation, + TaxID: "tax_123", + BankAccount: &omise.BankAccountRequest{ + Brand: "bbl", + Number: "acc12345", + Name: "Aashish", + BankCode: "bbl", + Type: omise.Current, + }, + Metadata: map[string]interface{}{ + "Hello": "World", + }, + } + + if e := client.Do(recipient, createRecipient); e != nil { + return nil, e + } + + return recipient, nil +} diff --git a/examples/src/schedule.go b/examples/src/schedule.go new file mode 100644 index 00000000..66f791e2 --- /dev/null +++ b/examples/src/schedule.go @@ -0,0 +1,54 @@ +package src + +import ( + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" + "github.com/omise/omise-go/schedule" +) + +func CreateChargeSchedule(client *omise.Client) (*omise.Schedule, error) { + customer, err := CreateCustomer(client) + + if err != nil { + return nil, err + } + + schedule, createSchedule := &omise.Schedule{}, &operations.CreateChargeSchedule{ + Every: 2, + Period: schedule.PeriodDay, + StartDate: "2024-09-01", + EndDate: "2024-12-01", + Customer: customer.ID, + Amount: 100000, + Description: "Membership fee", + } + + if err := client.Do(schedule, createSchedule); err != nil { + return nil, err + } + + return schedule, nil +} + +func CreateTransferSchedule(client *omise.Client) (*omise.Schedule, error) { + recipient, err := CreateRecipient(client) + + if err != nil { + return nil, err + } + + schedule, createSchedule := &omise.Schedule{}, &operations.CreateTransferSchedule{ + Every: 2, + Period: schedule.PeriodDay, + StartDate: "2024-09-01", + EndDate: "2024-12-01", + Amount: 100000, + Recipient: recipient.ID, + } + + if err := client.Do(schedule, createSchedule); err != nil { + return nil, err + } + + return schedule, nil +} diff --git a/examples/src/source.go b/examples/src/source.go new file mode 100644 index 00000000..f5032881 --- /dev/null +++ b/examples/src/source.go @@ -0,0 +1,51 @@ +package src + +import ( + "github.com/omise/omise-go" + "github.com/omise/omise-go/operations" +) + +func CreateSource(client *omise.Client) (*omise.Source, error) { + result := &omise.Source{} + + err := client.Do(result, &operations.CreateSource{ + Type: "promptpay", + Amount: 100000, + Currency: "THB", + Billing: omise.BillingShipping{ + Country: "TH", + City: "Bangkok", + PostalCode: "10260", + State: "Bangkok", + Street1: "Sukumvit 63", + Street2: "Sukumvit 63", + }, + Shipping: omise.BillingShipping{ + Country: "TH", + City: "Chang Mai", + PostalCode: "10260", + State: "Chang Mai", + Street1: "Sukumvit 63", + Street2: "Sukumvit 63", + }, + PromotionCode: "Hello", + Items: []omise.Items{ + { + Amount: 100000, + Sku: "sku-110", + Name: "Book", + Quantity: 1, + Category: "Reding", + Brand: "No brand", + ItemUri: "https://assets2.staging-omise.co/assets/external-logo-0059ea57dfd850a136e2fa75871113674eed0a23ca5340bded0d994fd674e9f2.svg", + ImageUri: "https://assets2.staging-omise.co/assets/external-logo-0059ea57dfd850a136e2fa75871113674eed0a23ca5340bded0d994fd674e9f2.svg", + }, + }, + }) + + if err != nil { + return nil, err + } + + return result, nil +} diff --git a/internal/endpoint.go b/internal/endpoint.go index b413b6f1..f4f92862 100644 --- a/internal/endpoint.go +++ b/internal/endpoint.go @@ -6,3 +6,7 @@ const ( API Endpoint = "https://api.omise.co" Vault Endpoint = "https://vault.omise.co" ) + +const ( + Version string = "2019-05-29" +) diff --git a/operations/charge.go b/operations/charge.go index 4bdccb3a..a4ba7421 100644 --- a/operations/charge.go +++ b/operations/charge.go @@ -51,20 +51,25 @@ func (req *ListCharges) Describe() *internal.Description { // // fmt.Println("created charge:", charge.ID) type CreateCharge struct { - Customer string `json:"customer,omitempty"` - Card string `json:"card,omitempty"` - Source string `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"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` - ZeroInterestInstallments *bool `json:"zero_interest_installments,omitempty"` - AuthorizationType omise.AuthorizationType `json:"authorization_type,omitempty"` - WebhookEndpoints []string `json:"webhook_endpoints,omitempty"` + Customer string `json:"customer,omitempty"` + Card string `json:"card,omitempty"` + Source string `json:"source,omitempty"` + Amount int64 `json:"amount"` + Currency string `json:"currency"` + 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"` + ExpiresAt *time.Time `json:"expires_at,omitempty"` + ZeroInterestInstallments *bool `json:"zero_interest_installments,omitempty"` + AuthorizationType omise.AuthorizationType `json:"authorization_type,omitempty"` + WebhookEndpoints []string `json:"webhook_endpoints,omitempty"` + Ip string `json:"ip,omitempty"` + TransactionIndicator omise.TransactionIndicator `json:"transaction_indicator,omitempty"` + RecurringReason omise.RecurringReason `json:"recurring_reason,omitempty"` + LinkedAccount string `json:"linked_account,omitempty"` + FirstCharge string `json:"first_charge,omitempty"` + PlatformFee omise.PlatformFee `json:"platform_fee,omitempty"` } func (req *CreateCharge) MarshalJSON() ([]byte, error) { diff --git a/operations/charge_test.go b/operations/charge_test.go index 6f280d71..0b93c697 100644 --- a/operations/charge_test.go +++ b/operations/charge_test.go @@ -21,7 +21,7 @@ func TestCreateChargeMarshal(t *testing.T) { Amount: 10000, Currency: "thb", }, - `{"amount":10000,"currency":"thb"}`, + `{"amount":10000,"currency":"thb","platform_fee":{}}`, }, { &CreateCharge{ @@ -29,7 +29,7 @@ func TestCreateChargeMarshal(t *testing.T) { Currency: "thb", DontCapture: true, }, - `{"amount":10000,"currency":"thb","capture":false}`, + `{"amount":10000,"currency":"thb","platform_fee":{},"capture":false}`, }, { &CreateCharge{ @@ -38,7 +38,7 @@ func TestCreateChargeMarshal(t *testing.T) { DontCapture: true, AuthorizationType: omise.PreAuth, }, - `{"amount":10000,"currency":"thb","authorization_type":"pre_auth","capture":false}`, + `{"amount":10000,"currency":"thb","authorization_type":"pre_auth","platform_fee":{},"capture":false}`, }, { &CreateCharge{ @@ -47,7 +47,7 @@ func TestCreateChargeMarshal(t *testing.T) { DontCapture: true, AuthorizationType: omise.FinalAuth, }, - `{"amount":10000,"currency":"thb","authorization_type":"final_auth","capture":false}`, + `{"amount":10000,"currency":"thb","authorization_type":"final_auth","platform_fee":{},"capture":false}`, }, { &CreateCharge{ @@ -55,7 +55,26 @@ func TestCreateChargeMarshal(t *testing.T) { Currency: "thb", WebhookEndpoints: []string{"https://docs.opn.ooo/api-webhooks"}, }, - `{"amount":10000,"currency":"thb","webhook_endpoints":["https://docs.opn.ooo/api-webhooks"]}`, + `{"amount":10000,"currency":"thb","webhook_endpoints":["https://docs.opn.ooo/api-webhooks"],"platform_fee":{}}`, + }, + { + &CreateCharge{ + Amount: 10000, + Currency: "thb", + WebhookEndpoints: []string{"https://docs.opn.ooo/api-webhooks"}, + Description: "This is a card cahrge", + Metadata: map[string]interface{}{ + "Hello": "World", + }, + Ip: "192.168.1.1", + TransactionIndicator: omise.MIT, + RecurringReason: omise.Blank, + PlatformFee: omise.PlatformFee{ + Fixed: 10, + Percentage: 2, + }, + }, + `{"amount":10000,"currency":"thb","description":"This is a card cahrge","metadata":{"Hello":"World"},"webhook_endpoints":["https://docs.opn.ooo/api-webhooks"],"ip":"192.168.1.1","transaction_indicator":"MIT","platform_fee":{"fixed":10,"percentage":2}}`, }, } for _, td := range testdata { @@ -250,7 +269,7 @@ func TestCreateChargeMarshal_WithMetadata(t *testing.T) { }, } - expected := `{"customer":"customer_id","amount":100000,"currency":"thb","metadata":{"color":"red"}}` + expected := `{"customer":"customer_id","amount":100000,"currency":"thb","metadata":{"color":"red"},"platform_fee":{}}` b, err := json.Marshal(req) r.Nil(t, err, "error should be nothing") @@ -264,7 +283,7 @@ func TestCreateChargeMarshal_WithoutMetadata(t *testing.T) { Currency: "thb", } - expected := `{"customer":"customer_id","amount":100000,"currency":"thb"}` + expected := `{"customer":"customer_id","amount":100000,"currency":"thb","platform_fee":{}}` b, err := json.Marshal(req) r.Nil(t, err, "err should be nothing") diff --git a/operations/customer.go b/operations/customer.go index 7505c88c..a2e3ce8a 100644 --- a/operations/customer.go +++ b/operations/customer.go @@ -17,7 +17,6 @@ import ( // } // // fmt.Println("# of new customers in the last hour:", len(customers.Data)) -// type ListCustomers struct { List } @@ -43,12 +42,12 @@ func (req *ListCustomers) Describe() *internal.Description { // } // // fmt.Printf("created customer: %#v\n", customer) -// 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"` + Email string `json:"email,omitempty"` + Description string `json:"description,omitempty"` + Card string `json:"card,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + LinkedAccount string `json:"linked_account,omitempty"` } func (req *CreateCustomer) Describe() *internal.Description { @@ -68,7 +67,6 @@ func (req *CreateCustomer) Describe() *internal.Description { // } // // fmt.Printf("cust_123: %#v\n", cust) -// type RetrieveCustomer struct { CustomerID string `json:"-"` } @@ -93,14 +91,14 @@ func (req *RetrieveCustomer) Describe() *internal.Description { // } // // fmt.Printf("updated customer: %#v\n", cust) -// 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"` + 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"` + LinkedAccount string `json:"linked_account,omitempty"` } func (req *UpdateCustomer) Describe() *internal.Description { @@ -122,7 +120,6 @@ func (req *UpdateCustomer) Describe() *internal.Description { // } // // fmt.Println("destroyed customer:", del.ID) -// type DestroyCustomer struct { CustomerID string `json:"-"` } @@ -140,20 +137,19 @@ func (req *DestroyCustomer) Describe() *internal.Description { // // 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)) -// +// 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)) type ListCustomerChargeSchedules struct { CustomerID string List diff --git a/operations/link.go b/operations/link.go index e805f74d..231aafef 100644 --- a/operations/link.go +++ b/operations/link.go @@ -22,7 +22,7 @@ type CreateLink struct { Currency string `json:"currency"` Title string `json:"title"` Description string `json:"description"` - Multiple bool `json:"multiple"` + Multiple bool `json:"multiple,omitempty"` } func (req *CreateLink) Describe() *internal.Description { diff --git a/operations/recipient.go b/operations/recipient.go index 79a78229..c2cf183f 100644 --- a/operations/recipient.go +++ b/operations/recipient.go @@ -17,7 +17,6 @@ import ( // } // // fmt.Println("recipients #100-#120:", recipients.Data) -// type ListRecipients struct { List } @@ -33,54 +32,54 @@ func (req *ListRecipients) Describe() *internal.Description { // 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) -// +// bankAccount := &omise.BankAccountRequest{ +// 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.BankAccountRequest{ +// 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) 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:"-"` + 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.BankAccountRequest `json:"-"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } type bankAccountParams struct { @@ -89,9 +88,9 @@ type bankAccountParams struct { Name string `json:"name"` // for Omise Japan - BankCode string `json:"bank_code,omitempty"` - BranchCode string `json:"branch_code,omitempty"` - AccountType omise.BankAccountType `json:"account_type,omitempty"` + BankCode string `json:"bank_code,omitempty"` + BranchCode string `json:"branch_code,omitempty"` + Type omise.BankAccountType `json:"type,omitempty"` } func (req *CreateRecipient) MarshalJSON() ([]byte, error) { @@ -104,12 +103,12 @@ func (req *CreateRecipient) MarshalJSON() ([]byte, error) { } if ba := params.BankAccount; ba != nil { params.BankAccountParams = bankAccountParams{ - Brand: ba.Brand, - Number: ba.Number, - Name: ba.Name, - BankCode: ba.BankCode, - BranchCode: ba.BranchCode, - AccountType: ba.AccountType, + Brand: ba.Brand, + Number: ba.Number, + Name: ba.Name, + BankCode: ba.BankCode, + BranchCode: ba.BranchCode, + Type: ba.Type, } } return json.Marshal(params) @@ -132,7 +131,6 @@ func (req *CreateRecipient) Describe() *internal.Description { // } // // fmt.Printf("recipient #123: %#v\n", recp) -// type RetrieveRecipient struct { RecipientID string `json:"-"` } @@ -157,15 +155,15 @@ func (req *RetrieveRecipient) Describe() *internal.Description { // } // // fmt.Printf("jones: %#v\n", jones) -// 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:"-"` + 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.BankAccountRequest `json:"-"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } func (req *UpdateRecipient) MarshalJSON() ([]byte, error) { @@ -178,12 +176,12 @@ func (req *UpdateRecipient) MarshalJSON() ([]byte, error) { } if ba := params.BankAccount; ba != nil { params.BankAccountParams = bankAccountParams{ - Brand: ba.Brand, - Number: ba.Number, - Name: ba.Name, - BankCode: ba.BankCode, - BranchCode: ba.BranchCode, - AccountType: ba.AccountType, + Brand: ba.Brand, + Number: ba.Number, + Name: ba.Name, + BankCode: ba.BankCode, + BranchCode: ba.BranchCode, + Type: ba.Type, } } return json.Marshal(params) @@ -206,7 +204,6 @@ func (req *UpdateRecipient) Describe() *internal.Description { // } // // fmt.Println("destroyed recipient:", del.ID) -// type DestroyRecipient struct { RecipientID string `json:"-"` } @@ -224,20 +221,19 @@ func (req *DestroyRecipient) Describe() *internal.Description { // // 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)) -// +// 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)) type ListRecipientTransferSchedules struct { RecipientID string List diff --git a/operations/recipient_test.go b/operations/recipient_test.go index 0113a2ab..2b68ed6b 100644 --- a/operations/recipient_test.go +++ b/operations/recipient_test.go @@ -22,6 +22,28 @@ func TestRecipient(t *testing.T) { client := testutil.NewFixedClient(t) recipient := &omise.Recipient{} + metadata := map[string]interface{}{ + "Hello": "World", + } + bankAccount := &omise.BankAccountRequest{ + Brand: "bbl", + Number: "1234567890", + Name: "Somchai Prasert", + Type: omise.Current, + } + + client.MustDo(recipient, &CreateRecipient{ + Name: "Tony Doe", + Email: "john.doe@example.com", + Description: "Default recipient", + Type: omise.Individual, + TaxID: "tax_123", + BankAccount: bankAccount, + Metadata: metadata, + }) + r.Equal(t, "john.doe@example.com", recipient.Email) + r.Equal(t, omise.Individual, recipient.Type) + client.MustDo(recipient, &RetrieveRecipient{RecipientID}) r.Equal(t, RecipientID, recipient.ID) r.NotNil(t, recipient.BankAccount) @@ -35,6 +57,7 @@ func TestRecipient(t *testing.T) { client.MustDo(recipient, &UpdateRecipient{ RecipientID: RecipientID, Email: "john@doe.com", + BankAccount: bankAccount, }) r.Equal(t, "john@doe.com", recipient.Email) @@ -49,17 +72,23 @@ func TestRecipient_Network(t *testing.T) { // create a recipient // sample from: https://www.omise.co/bank-account-api - jun, bankAccount := &omise.Recipient{}, &omise.BankAccount{ + jun, bankAccount := &omise.Recipient{}, &omise.BankAccountRequest{ Brand: "bbl", Number: "1234567890", Name: "Somchai Prasert", + Type: omise.Current, + } + metadata := map[string]interface{}{ + "Hello": "World", } client.MustDo(jun, &CreateRecipient{ Name: "Jun Hasegawa", Email: "jun@omise.co", Description: "Owns Omise", Type: omise.Individual, + TaxID: "tax_123", BankAccount: bankAccount, + Metadata: metadata, }) t.Log("created recipient:", jun.ID) @@ -67,6 +96,8 @@ func TestRecipient_Network(t *testing.T) { r.NotNil(t, jun.Description) r.Equal(t, "Owns Omise", *jun.Description) r.Equal(t, jun.BankAccount.Name, bankAccount.Name) + r.Equal(t, metadata, jun.Metadata) + r.Equal(t, bankAccount.Number, jun.BankAccount.AccountNumber) // list created customers recipients := &omise.RecipientList{} diff --git a/operations/schedule.go b/operations/schedule.go index 992741a0..ce8250cc 100644 --- a/operations/schedule.go +++ b/operations/schedule.go @@ -13,25 +13,24 @@ import ( // // 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) +// 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) type CreateChargeSchedule struct { Every int Period schedule.Period @@ -132,25 +131,24 @@ func (req *CreateChargeSchedule) Describe() *internal.Description { // // 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) +// 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) type CreateTransferSchedule struct { Every int Period schedule.Period @@ -245,19 +243,18 @@ func (req *CreateTransferSchedule) Describe() *internal.Description { // // 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)) +// 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)) type ListSchedules struct { List } @@ -275,20 +272,19 @@ func (req *ListSchedules) Describe() *internal.Description { // // 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)) +// 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)) type ListScheduleOccurrences struct { ScheduleID string List @@ -307,19 +303,18 @@ func (req *ListScheduleOccurrences) Describe() *internal.Description { // // 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)) +// 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)) type ListChargeSchedules struct { List } @@ -337,19 +332,18 @@ func (req *ListChargeSchedules) Describe() *internal.Description { // // 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)) +// 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)) type ListTransferSchedules struct { List } @@ -373,7 +367,6 @@ func (req *ListTransferSchedules) Describe() *internal.Description { // } // // fmt.Printf("schedule #schd_57z9hj228pusa652nk1: %#v\n", schd) -// type RetrieveSchedule struct { ScheduleID string `json:"-"` } @@ -390,13 +383,13 @@ func (req *RetrieveSchedule) Describe() *internal.Description { // 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) +// var deletedSchd omise.Schedule +// if e := client.Do(&deletedSchd, &DestroySchedule{ScheduleID: "schd_57z9hj228pusa652nk1"}); e != nil { +// panic(e) +// } // +// fmt.Println("destroyed schedule:", deletedSchd.ID) type DestroySchedule struct { ScheduleID string `json:"-"` } diff --git a/operations/source.go b/operations/source.go index b1f0e8b8..e40491b3 100644 --- a/operations/source.go +++ b/operations/source.go @@ -1,6 +1,7 @@ package operations import ( + "github.com/omise/omise-go" "github.com/omise/omise-go/internal" ) @@ -17,21 +18,25 @@ import ( // // fmt.Println("created source:", source.ID) 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"` - PlatformType string `json:"platform_type,omitempty"` - Ip string `json:"ip,omitempty"` + 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"` + MobileNumber string `json:"mobile_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"` + PlatformType string `json:"platform_type,omitempty"` + Ip string `json:"ip,omitempty"` + Billing omise.BillingShipping `json:"billing,omitempty"` + Shipping omise.BillingShipping `json:"shipping,omitempty"` + PromotionCode string `json:"promotion_code,omitempty"` + Items []omise.Items `json:"-"` } func (req *CreateSource) Describe() *internal.Description { diff --git a/operations/token.go b/operations/token.go index beb97b07..610f7184 100644 --- a/operations/token.go +++ b/operations/token.go @@ -24,16 +24,21 @@ import ( // } // // fmt.Println("created token:", token.ID) -// type CreateToken struct { Name string `json:"name"` Number string `json:"number"` ExpirationMonth time.Month `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` + Email string `json:"email,omitempty"` + PhoneNumber string `json:"phone_number,omitempty"` SecurityCode string `json:"security_code"` + Country string `json:"country,omitempty"` + State string `json:"state,omitempty"` City string `json:"city,omitempty"` PostalCode string `json:"postal_code,omitempty"` + Street1 string `json:"street1,omitempty"` + Street2 string `json:"street2,omitempty"` } func (req *CreateToken) MarshalJSON() ([]byte, error) { @@ -63,7 +68,6 @@ func (req *CreateToken) Describe() *internal.Description { // } // // fmt.Printf("token: %#v\n", token) -// type RetrieveToken struct { ID string `json:"-"` } diff --git a/operations/transfer.go b/operations/transfer.go index 90503a4c..f0820061 100644 --- a/operations/transfer.go +++ b/operations/transfer.go @@ -17,7 +17,6 @@ import ( // } // // fmt.Println("# of transfers in the last hour:", len(transfers.Data)) -// type ListTransfers struct { List } @@ -41,12 +40,13 @@ func (req *ListTransfers) Describe() *internal.Description { // } // // fmt.Println("transferred to default recipient with:", transfer.ID) -// 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"` + Amount int64 `json:"amount,omitempty"` + Recipient string `json:"recipient,omitempty"` + FailFast bool `json:"fail_fast,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + SplitTransfer bool `json:"split_transfer,omitempty"` + IdempKey string `json:"idemp_key,omitempty"` } func (req *CreateTransfer) Describe() *internal.Description { @@ -66,7 +66,6 @@ func (req *CreateTransfer) Describe() *internal.Description { // } // // fmt.Printf("transfer #123: %#v\n", transfer) -// type RetrieveTransfer struct { TransferID string `json:"-"` } @@ -80,33 +79,6 @@ func (req *RetrieveTransfer) Describe() *internal.Description { } } -// 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) -// -type UpdateTransfer struct { - TransferID string `json:"-"` - Amount int64 `json:"amount,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -func (req *UpdateTransfer) Describe() *internal.Description { - return &internal.Description{ - Endpoint: internal.API, - Method: "PATCH", - Path: "/transfers/" + req.TransferID, - ContentType: "application/json", - } -} - // Example: // // del, destroy := &omise.Deletion{}, &DestroyTransfer{"trsf_777"} @@ -115,7 +87,6 @@ func (req *UpdateTransfer) Describe() *internal.Description { // } // // fmt.Println("not transferring anymore:", del.ID) -// type DestroyTransfer struct { TransferID string `json:"-"` } diff --git a/operations/transfer_test.go b/operations/transfer_test.go index a43c2a2e..4004018d 100644 --- a/operations/transfer_test.go +++ b/operations/transfer_test.go @@ -31,14 +31,6 @@ func TestTransfer(t *testing.T) { r.NotNil(t, transfer.BankAccount) r.Equal(t, "6789", transfer.BankAccount.LastDigits) - transfer = &omise.Transfer{} - client.MustDo(transfer, &UpdateTransfer{ - TransferID: TransferID, - Amount: 192189, - }) - r.Equal(t, TransferID, transfer.ID) - r.Equal(t, int64(192189), transfer.Amount) - del := &omise.Deletion{} client.MustDo(del, &DestroyTransfer{TransferID}) r.Equal(t, TransferID, del.ID) @@ -74,16 +66,6 @@ func TestTransfer_Network(t *testing.T) { r.Equal(t, transfer.ID, transfer2.ID) r.Equal(t, transfer.Amount, transfer2.Amount) - // update transfer - transfer2 = &omise.Transfer{} - client.MustDo(transfer2, &UpdateTransfer{ - TransferID: transfer.ID, - Amount: 12300, - }) - - r.Equal(t, transfer.ID, transfer2.ID) - r.Equal(t, int64(12300), transfer2.Amount) - // destroy transfer del, destroy := &omise.Deletion{}, &DestroyTransfer{TransferID: transfer.ID} client.MustDo(del, destroy) @@ -120,32 +102,3 @@ func TestCreateTransferMarshal_WithoutMetadata(t *testing.T) { r.Nil(t, err, "err should be nothing") r.Equal(t, expected, string(b)) } - -func TestUpdateTransferMarshal_WithMetadata(t *testing.T) { - req := &UpdateTransfer{ - TransferID: "trsf_test_4yqacz8t3cbipcj766u", - Amount: 192188, - Metadata: map[string]interface{}{ - "color": "red", - }, - } - - expected := `{"amount":192188,"metadata":{"color":"red"}}` - - b, err := json.Marshal(req) - r.Nil(t, err, "err should be nothing") - r.Equal(t, expected, string(b)) -} - -func TestUpdateTransferMarshal_WithoutMetadata(t *testing.T) { - req := &UpdateTransfer{ - TransferID: "trsf_test_4yqacz8t3cbipcj766u", - Amount: 192188, - } - - expected := `{"amount":192188}` - - b, err := json.Marshal(req) - r.Nil(t, err, "err should be nothing") - r.Equal(t, expected, string(b)) -} diff --git a/recipient.go b/recipient.go index b9b2ef44..fcd9bd58 100644 --- a/recipient.go +++ b/recipient.go @@ -4,13 +4,14 @@ package omise // See https://www.omise.co/recipients-api for more information. 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"` + 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"` + Metadata map[string]interface{} `json:"metadata"` } diff --git a/sonar-project.properties b/sonar-project.properties index 74d802d3..084b23b5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,4 +2,4 @@ sonar.projectKey=omise_omise-go sonar.organization=omise sonar.go.coverage.reportPaths=cover.out sonar.exclusions=internal/testutil/** -sonar.coverage.exclusions=**/*_test.go, /vendor/**, /testdata/** +sonar.coverage.exclusions=**/*_test.go, /vendor/**, /testdata/**, /examples/** diff --git a/source.go b/source.go index 235ae905..01137bc3 100644 --- a/source.go +++ b/source.go @@ -14,3 +14,23 @@ type Source struct { PlatformType string `json:"platform_type"` Ip string `json:"ip"` } + +type BillingShipping struct { + Country string `json:"country"` + City string `json:"city"` + PostalCode string `json:"postal_code"` + State string `json:"state"` + Street1 string `json:"street1"` + Street2 string `json:"street2,omitempty"` +} + +type Items struct { + Amount int64 `json:"amount"` + Sku string `json:"sku,omitempty"` + Name string `json:"name,omitempty"` + Quantity int16 `json:"quantity,omitempty"` + Category string `json:"category,omitempty"` + Brand string `json:"brand,omitempty"` + ItemUri string `json:"item_uri,omitempty"` + ImageUri string `json:"image_uri,omitempty"` +} diff --git a/testdata/fixtures/api.omise.co/account-get.json b/testdata/fixtures/api.omise.co/account-get.json index 3e0135ce..e9510db2 100644 --- a/testdata/fixtures/api.omise.co/account-get.json +++ b/testdata/fixtures/api.omise.co/account-get.json @@ -3,5 +3,5 @@ "id": "acct_4yq6tcsyoged5c0ocxd", "location": "/account", "email": "chakrit@omise.co", - "created": "2015-12-16T05:55:29Z" + "created_at": "2015-12-16T05:55:29Z" } diff --git a/testdata/fixtures/api.omise.co/charges-get.json b/testdata/fixtures/api.omise.co/charges-get.json index 3931117b..361569f0 100644 --- a/testdata/fixtures/api.omise.co/charges-get.json +++ b/testdata/fixtures/api.omise.co/charges-get.json @@ -51,11 +51,11 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" }, "customer": "cust_test_4yq6txdpfadhbaqnwp3", "ip": null, - "created": "2015-01-15T05:00:29Z", + "created_at": "2015-01-15T05:00:29Z", "dispute": null } ] diff --git a/testdata/fixtures/api.omise.co/charges-post.json b/testdata/fixtures/api.omise.co/charges-post.json index 263e2c9d..5c8d3a8b 100644 --- a/testdata/fixtures/api.omise.co/charges-post.json +++ b/testdata/fixtures/api.omise.co/charges-post.json @@ -44,10 +44,10 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" }, "customer": "cust_test_4yq6txdpfadhbaqnwp3", "ip": null, - "created": "2015-01-15T05:00:29Z", + "created_at": "2015-01-15T05:00:29Z", "dispute": null } diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-get.json b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-get.json index 00225762..ad25a659 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-get.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-get.json @@ -27,7 +27,7 @@ "currency": "thb", "charge": "chrg_test_4yq7duw15p9hdrjp8oq", "transaction": "trxn_test_4yqmv79fzpy0gmz5mmq", - "created": "2015-01-16T07:23:45Z" + "created_at": "2015-01-16T07:23:45Z" } ], "location": "/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds" @@ -50,9 +50,9 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" }, "customer": "cust_test_4yq6txdpfadhbaqnwp3", "ip": null, - "created": "2015-01-15T05:00:29Z" + "created_at": "2015-01-15T05:00:29Z" } diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-patch.json b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-patch.json index 488004dd..b67a6434 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-patch.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq-patch.json @@ -27,7 +27,7 @@ "currency": "thb", "charge": "chrg_test_4yq7duw15p9hdrjp8oq", "transaction": "trxn_test_4yqmv79fzpy0gmz5mmq", - "created": "2015-01-16T07:23:45Z" + "created_at": "2015-01-16T07:23:45Z" } ], "location": "/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds" @@ -50,9 +50,9 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" }, "customer": "cust_test_4yq6txdpfadhbaqnwp3", "ip": null, - "created": "2015-01-15T05:00:29Z" + "created_at": "2015-01-15T05:00:29Z" } diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-get.json b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-get.json index 076f872b..113a1c47 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-get.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-get.json @@ -14,7 +14,7 @@ "currency": "thb", "charge": "chrg_test_4yq7duw15p9hdrjp8oq", "transaction": "trxn_test_4yqmv79fzpy0gmz5mmq", - "created": "2015-01-16T07:23:45Z" + "created_at": "2015-01-16T07:23:45Z" } ], "location": "/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds" diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-post.json b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-post.json index 558df35a..165b7ad4 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-post.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-post.json @@ -6,5 +6,5 @@ "currency": "thb", "charge": "chrg_test_4yq7duw15p9hdrjp8oq", "transaction": "trxn_test_4yqmv79fzpy0gmz5mmq", - "created": "2015-01-16T07:23:45Z" + "created_at": "2015-01-16T07:23:45Z" } diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/rfnd_test_4yqmv79ahghsiz23y3c-get.json b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/rfnd_test_4yqmv79ahghsiz23y3c-get.json index 32a464c7..de3f4792 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/rfnd_test_4yqmv79ahghsiz23y3c-get.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/rfnd_test_4yqmv79ahghsiz23y3c-get.json @@ -6,7 +6,7 @@ "currency": "thb", "charge": "chrg_test_4yq7duw15p9hdrjp8oq", "transaction": "trxn_test_4yqmv79fzpy0gmz5mmq", - "created": "2015-01-16T07:23:45Z", + "created_at": "2015-01-16T07:23:45Z", "funding_currency": "THB", "funding_amount": 10000, "status": "closed" diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_5kdpo8ie121323la8ew-get.json b/testdata/fixtures/api.omise.co/charges/chrg_test_5kdpo8ie121323la8ew-get.json index bb4da50d..52ef1011 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_5kdpo8ie121323la8ew-get.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_5kdpo8ie121323la8ew-get.json @@ -51,7 +51,7 @@ "location": "/sources/src_test_5kdpo82pj2137vmg6j3", "amount": 400000, "barcode": null, - "created_at": "2020-06-30T03:52:59Z", + "created_at_at": "2020-06-30T03:52:59Z", "currency": "THB", "email": null, "flow": "offline", @@ -88,7 +88,7 @@ "status": "pending", "authorize_uri": null, "return_uri": null, - "created_at": "2020-06-30T03:53:01Z", + "created_at_at": "2020-06-30T03:53:01Z", "paid_at": null, "expires_at": "2020-07-01T03:53:01Z", "expired_at": null, diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_5nvdpnapyle90ejudk8-get.json b/testdata/fixtures/api.omise.co/charges/chrg_test_5nvdpnapyle90ejudk8-get.json index 3e1cf617..c9d3fa40 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_5nvdpnapyle90ejudk8-get.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_5nvdpnapyle90ejudk8-get.json @@ -52,7 +52,7 @@ "amount": 400000, "barcode": null, "bank": null, - "created_at": "2021-05-17T10:53:57Z", + "created_at_at": "2021-05-17T10:53:57Z", "currency": "SGD", "email": null, "flow": "offline", @@ -71,7 +71,7 @@ "filename": "qrcode.png", "location": "/charges/chrg_test_5nvdpnapyle90ejudk8/documents/docu_test_5nvdpnc12jbp0hwy031", "download_uri": "https://api.omise.co/charges/chrg_test_5nvdpnapyle90ejudk8/documents/docu_test_5nvdpnc12jbp0hwy031/downloads/542F307C03299822", - "created_at": "2021-05-17T10:53:59Z" + "created_at_at": "2021-05-17T10:53:59Z" } }, "references": null, @@ -93,7 +93,7 @@ "status": "pending", "authorize_uri": null, "return_uri": null, - "created_at": "2021-05-17T10:53:59Z", + "created_at_at": "2021-05-17T10:53:59Z", "paid_at": null, "expires_at": "2021-05-24T10:53:59Z", "expired_at": null, diff --git a/testdata/fixtures/api.omise.co/charges/chrg_test_5x1753iuub61dfe41q4-get.json b/testdata/fixtures/api.omise.co/charges/chrg_test_5x1753iuub61dfe41q4-get.json index 079a4f5b..c7090d93 100644 --- a/testdata/fixtures/api.omise.co/charges/chrg_test_5x1753iuub61dfe41q4-get.json +++ b/testdata/fixtures/api.omise.co/charges/chrg_test_5x1753iuub61dfe41q4-get.json @@ -64,7 +64,7 @@ "expiration_year": 2024, "security_code_check": true, "tokenization_method": null, - "created_at": "2023-09-07T16:36:42Z" + "created_at_at": "2023-09-07T16:36:42Z" }, "source": null, "schedule": null, @@ -76,7 +76,7 @@ "status": "successful", "authorize_uri": null, "return_uri": null, - "created_at": "2023-09-07T16:36:43Z", + "created_at_at": "2023-09-07T16:36:43Z", "paid_at": "2023-09-07T16:36:43Z", "expires_at": "2023-09-14T16:36:43Z", "expired_at": "2023-09-14T16:36:43Z", diff --git a/testdata/fixtures/api.omise.co/charges/schedules-get.json b/testdata/fixtures/api.omise.co/charges/schedules-get.json index 51b3335d..d50d9cd7 100644 --- a/testdata/fixtures/api.omise.co/charges/schedules-get.json +++ b/testdata/fixtures/api.omise.co/charges/schedules-get.json @@ -76,7 +76,7 @@ "2018-03-10", "2018-03-26" ], - "created": "2017-05-16T07:23:11Z" + "created_at": "2017-05-16T07:23:11Z" } ] } diff --git a/testdata/fixtures/api.omise.co/customers-get.json b/testdata/fixtures/api.omise.co/customers-get.json index 91917911..6b0d90d3 100644 --- a/testdata/fixtures/api.omise.co/customers-get.json +++ b/testdata/fixtures/api.omise.co/customers-get.json @@ -16,7 +16,7 @@ "default_card": "card_test_4yq6tuucl9h4erukfl0", "email": "john.doe@example.com", "description": "John Doe (id: 30)", - "created": "2015-01-15T04:03:52Z", + "created_at": "2015-01-15T04:03:52Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -44,7 +44,7 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" } ] } diff --git a/testdata/fixtures/api.omise.co/customers-post.json b/testdata/fixtures/api.omise.co/customers-post.json index 37026da1..e51528a0 100644 --- a/testdata/fixtures/api.omise.co/customers-post.json +++ b/testdata/fixtures/api.omise.co/customers-post.json @@ -6,7 +6,7 @@ "default_card": "card_test_4yq6tuucl9h4erukfl0", "email": "john.doe@example.com", "description": "John Doe (id: 30)", - "created": "2015-01-15T04:03:52Z", + "created_at": "2015-01-15T04:03:52Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -34,7 +34,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2016-01-28T07:44:35Z" + "created_at": "2016-01-28T07:44:35Z" } ] } diff --git a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-get.json b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-get.json index 336b1026..6ce326fc 100644 --- a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-get.json +++ b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-get.json @@ -6,7 +6,7 @@ "default_card": "card_test_4yq6tuucl9h4erukfl0", "email": "john.doe@example.com", "description": "John Doe (id: 30)", - "created": "2015-01-15T04:03:52Z", + "created_at": "2015-01-15T04:03:52Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -31,7 +31,7 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" } ], "location": "/customers/cust_test_4yq6txdpfadhbaqnwp3/cards" diff --git a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-patch.json b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-patch.json index 0b2b8288..3cc1f1e9 100644 --- a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-patch.json +++ b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-patch.json @@ -6,7 +6,7 @@ "default_card": "card_test_4yq6tuucl9h4erukfl0", "email": "john.doe.the.second@example.com", "description": "John Doe (id: 30)", - "created": "2015-01-15T04:03:52Z", + "created_at": "2015-01-15T04:03:52Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -31,7 +31,7 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" } ], "location": "/customers/cust_test_4yq6txdpfadhbaqnwp3/cards" diff --git a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-get.json b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-get.json index cc2f560a..688d62e9 100644 --- a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-get.json +++ b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-get.json @@ -14,5 +14,5 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" } diff --git a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-patch.json b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-patch.json index 96886b64..466bc4a4 100644 --- a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-patch.json +++ b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-patch.json @@ -14,5 +14,5 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN W. DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" } diff --git a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/schedules-get.json b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/schedules-get.json index 51b3335d..d50d9cd7 100644 --- a/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/schedules-get.json +++ b/testdata/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/schedules-get.json @@ -76,7 +76,7 @@ "2018-03-10", "2018-03-26" ], - "created": "2017-05-16T07:23:11Z" + "created_at": "2017-05-16T07:23:11Z" } ] } diff --git a/testdata/fixtures/api.omise.co/disputes-get.json b/testdata/fixtures/api.omise.co/disputes-get.json index 9b2c06cc..a96f6988 100644 --- a/testdata/fixtures/api.omise.co/disputes-get.json +++ b/testdata/fixtures/api.omise.co/disputes-get.json @@ -18,7 +18,7 @@ "status": "open", "message": null, "charge": "chrg_test_5089odjlzg9j7tw4i1q", - "created": "2015-06-02T10:22:32Z" + "created_at": "2015-06-02T10:22:32Z" } ] } diff --git a/testdata/fixtures/api.omise.co/disputes/closed-get.json b/testdata/fixtures/api.omise.co/disputes/closed-get.json index 6a3517fa..ef46ee81 100644 --- a/testdata/fixtures/api.omise.co/disputes/closed-get.json +++ b/testdata/fixtures/api.omise.co/disputes/closed-get.json @@ -16,7 +16,7 @@ "status": "won", "message": "This customer has send us his authorization to withdraw the fund from his card ....", "charge": "chrg_test_5089odjlzg9j7tw4i1q", - "created": "2015-06-02T10:22:32Z" + "created_at": "2015-06-02T10:22:32Z" } ] } diff --git a/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-get.json b/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-get.json index dd71293c..a4716de5 100644 --- a/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-get.json +++ b/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-get.json @@ -8,5 +8,5 @@ "status": "open", "message": null, "charge": "chrg_test_5089odjlzg9j7tw4i1q", - "created": "2015-06-02T10:22:32Z" + "created_at": "2015-06-02T10:22:32Z" } diff --git a/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-patch.json b/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-patch.json index 35314501..8fbbf660 100644 --- a/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-patch.json +++ b/testdata/fixtures/api.omise.co/disputes/dspt_test_5089off452g5m5te7xs-patch.json @@ -8,5 +8,5 @@ "status": "open", "message": "Your dispute message", "charge": "chrg_test_4yq7duw15p9hdrjp8oq", - "created": "2015-06-02T10:22:32Z" + "created_at": "2015-06-02T10:22:32Z" } diff --git a/testdata/fixtures/api.omise.co/disputes/open-get.json b/testdata/fixtures/api.omise.co/disputes/open-get.json index 3e1e16c0..23b3d1eb 100644 --- a/testdata/fixtures/api.omise.co/disputes/open-get.json +++ b/testdata/fixtures/api.omise.co/disputes/open-get.json @@ -16,7 +16,7 @@ "status": "open", "message": null, "charge": "chrg_test_5089odjlzg9j7tw4i1q", - "created": "2015-06-02T10:22:32Z" + "created_at": "2015-06-02T10:22:32Z" } ] } diff --git a/testdata/fixtures/api.omise.co/disputes/pending-get.json b/testdata/fixtures/api.omise.co/disputes/pending-get.json index aba63d06..d2ff5bdf 100644 --- a/testdata/fixtures/api.omise.co/disputes/pending-get.json +++ b/testdata/fixtures/api.omise.co/disputes/pending-get.json @@ -16,7 +16,7 @@ "status": "pending", "message": "This customer has send us his authorization to withdraw the fund from his card ....", "charge": "chrg_test_5089odjlzg9j7tw4i1q", - "created": "2015-06-02T10:22:32Z" + "created_at": "2015-06-02T10:22:32Z" } ] } diff --git a/testdata/fixtures/api.omise.co/events-get.json b/testdata/fixtures/api.omise.co/events-get.json index 9a2afbf5..51cbe4d6 100644 --- a/testdata/fixtures/api.omise.co/events-get.json +++ b/testdata/fixtures/api.omise.co/events-get.json @@ -13,7 +13,7 @@ "livemode": false, "location": "/events/evnt_test_5232t5tlhjwh7nbi14g", "key": "customer.create", - "created": "2015-11-20T05:48:41Z", + "created_at": "2015-11-20T05:48:41Z", "data": { "object": "customer", "id": "cust_test_5232t5thveg40ali15h", @@ -22,7 +22,7 @@ "default_card": null, "email": "chakrit@omise.co", "description": "Omise", - "created": "2015-11-20T05:48:41Z", + "created_at": "2015-11-20T05:48:41Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -44,7 +44,7 @@ "livemode": false, "location": "/events/evnt_test_5232t65g72920vkr9w1", "key": "customer.update", - "created": "2015-11-20T05:48:42Z", + "created_at": "2015-11-20T05:48:42Z", "data": { "object": "customer", "id": "cust_test_5232t5thveg40ali15h", @@ -53,7 +53,7 @@ "default_card": "card_test_5232t61x6yfv27f6dug", "email": "chakrit@omise.co", "description": "Omise", - "created": "2015-11-20T05:48:41Z", + "created_at": "2015-11-20T05:48:41Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -80,7 +80,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:42Z" + "created_at": "2015-11-20T05:48:42Z" } ], "location": "/customers/cust_test_5232t5thveg40ali15h/cards" @@ -93,7 +93,7 @@ "livemode": false, "location": "/events/evnt_test_5232t66trxjwf9tpr24", "key": "customer.update", - "created": "2015-11-20T05:48:42Z", + "created_at": "2015-11-20T05:48:42Z", "data": { "object": "customer", "id": "cust_test_5232t5thveg40ali15h", @@ -102,7 +102,7 @@ "default_card": "card_test_5232t61x6yfv27f6dug", "email": "chakrit@omise.co", "description": "Omise", - "created": "2015-11-20T05:48:41Z", + "created_at": "2015-11-20T05:48:41Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -129,7 +129,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:42Z" + "created_at": "2015-11-20T05:48:42Z" }, { "object": "card", @@ -148,7 +148,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:42Z" + "created_at": "2015-11-20T05:48:42Z" } ], "location": "/customers/cust_test_5232t5thveg40ali15h/cards" @@ -161,7 +161,7 @@ "livemode": false, "location": "/events/evnt_test_5232t694feig7wfr8o3", "key": "card.update", - "created": "2015-11-20T05:48:43Z", + "created_at": "2015-11-20T05:48:43Z", "data": { "object": "card", "id": "card_test_5232t61x6yfv27f6dug", @@ -179,7 +179,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Changed my name", "security_code_check": true, - "created": "2015-11-20T05:48:42Z" + "created_at": "2015-11-20T05:48:42Z" } }, { @@ -188,7 +188,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6b277w0eimrlmg", "key": "card.destroy", - "created": "2015-11-20T05:48:43Z", + "created_at": "2015-11-20T05:48:43Z", "data": { "object": "card", "id": "card_test_5232t61x6yfv27f6dug", @@ -202,7 +202,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6b6jzc3juf5l99", "key": "customer.update.card", - "created": "2015-11-20T05:48:43Z", + "created_at": "2015-11-20T05:48:43Z", "data": { "object": "customer", "id": "cust_test_5232t5thveg40ali15h", @@ -211,7 +211,7 @@ "default_card": "card_test_5232t63qvuqmcgijgn2", "email": "chakrit@omise.co", "description": "Omise", - "created": "2015-11-20T05:48:41Z", + "created_at": "2015-11-20T05:48:41Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -238,7 +238,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:42Z" + "created_at": "2015-11-20T05:48:42Z" } ], "location": "/customers/cust_test_5232t5thveg40ali15h/cards" @@ -251,7 +251,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6ciskyzz9ogoow", "key": "card.destroy", - "created": "2015-11-20T05:48:43Z", + "created_at": "2015-11-20T05:48:43Z", "data": { "object": "card", "id": "card_test_5232t63qvuqmcgijgn2", @@ -265,7 +265,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6cnogtffq475v7", "key": "customer.update.card", - "created": "2015-11-20T05:48:43Z", + "created_at": "2015-11-20T05:48:43Z", "data": { "object": "customer", "id": "cust_test_5232t5thveg40ali15h", @@ -274,7 +274,7 @@ "default_card": null, "email": "chakrit@omise.co", "description": "Omise", - "created": "2015-11-20T05:48:41Z", + "created_at": "2015-11-20T05:48:41Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -296,7 +296,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6ek3n1ubeoapul", "key": "customer.destroy", - "created": "2015-11-20T05:48:43Z", + "created_at": "2015-11-20T05:48:43Z", "data": { "object": "customer", "id": "cust_test_5232t5thveg40ali15h", @@ -310,7 +310,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6i96aa0lmqukmq", "key": "charge.create", - "created": "2015-11-20T05:48:44Z", + "created_at": "2015-11-20T05:48:44Z", "data": { "object": "charge", "id": "chrg_test_5232t6h7dzu8e5rmnqv", @@ -356,12 +356,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:44Z" + "created_at": "2015-11-20T05:48:44Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2015-11-20T05:48:44Z" + "created_at": "2015-11-20T05:48:44Z" } }, { @@ -370,7 +370,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6kwxnobb0raiu7", "key": "charge.update", - "created": "2015-11-20T05:48:44Z", + "created_at": "2015-11-20T05:48:44Z", "data": { "object": "charge", "id": "chrg_test_5232t6h7dzu8e5rmnqv", @@ -416,12 +416,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:44Z" + "created_at": "2015-11-20T05:48:44Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2015-11-20T05:48:44Z" + "created_at": "2015-11-20T05:48:44Z" } }, { @@ -430,7 +430,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6t67lrd31th8od", "key": "charge.create", - "created": "2015-11-20T05:48:45Z", + "created_at": "2015-11-20T05:48:45Z", "data": { "object": "charge", "id": "chrg_test_5232t6rvomzcnnmq2xy", @@ -476,12 +476,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:45Z" + "created_at": "2015-11-20T05:48:45Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2015-11-20T05:48:45Z" + "created_at": "2015-11-20T05:48:45Z" } }, { @@ -490,7 +490,7 @@ "livemode": false, "location": "/events/evnt_test_5232t6vbpnjl66ouvwc", "key": "charge.capture", - "created": "2015-11-20T05:48:46Z", + "created_at": "2015-11-20T05:48:46Z", "data": { "object": "charge", "id": "chrg_test_5232t6rvomzcnnmq2xy", @@ -536,12 +536,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:45Z" + "created_at": "2015-11-20T05:48:45Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2015-11-20T05:48:45Z" + "created_at": "2015-11-20T05:48:45Z" } }, { @@ -550,7 +550,7 @@ "livemode": false, "location": "/events/evnt_test_5232t73wqqstr89ic9a", "key": "customer.create", - "created": "2015-11-20T05:48:47Z", + "created_at": "2015-11-20T05:48:47Z", "data": { "object": "customer", "id": "cust_test_5232t73plql7mkh8nv0", @@ -559,7 +559,7 @@ "default_card": "card_test_5232t720jr2pyhioeso", "email": "chakrit@omise.co", "description": "I'm JACK", - "created": "2015-11-20T05:48:47Z", + "created_at": "2015-11-20T05:48:47Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -586,7 +586,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:47Z" + "created_at": "2015-11-20T05:48:47Z" } ], "location": "/customers/cust_test_5232t73plql7mkh8nv0/cards" @@ -599,7 +599,7 @@ "livemode": false, "location": "/events/evnt_test_5232t75p2y60vqc5ahs", "key": "customer.update", - "created": "2015-11-20T05:48:47Z", + "created_at": "2015-11-20T05:48:47Z", "data": { "object": "customer", "id": "cust_test_5232t73plql7mkh8nv0", @@ -608,7 +608,7 @@ "default_card": "card_test_5232t720jr2pyhioeso", "email": "chakrit@omise.co", "description": "I'm JOHN now.", - "created": "2015-11-20T05:48:47Z", + "created_at": "2015-11-20T05:48:47Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -635,7 +635,7 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:47Z" + "created_at": "2015-11-20T05:48:47Z" } ], "location": "/customers/cust_test_5232t73plql7mkh8nv0/cards" @@ -648,7 +648,7 @@ "livemode": false, "location": "/events/evnt_test_5232t785ibrca9biqf8", "key": "customer.destroy", - "created": "2015-11-20T05:48:47Z", + "created_at": "2015-11-20T05:48:47Z", "data": { "object": "customer", "id": "cust_test_5232t73plql7mkh8nv0", @@ -662,7 +662,7 @@ "livemode": false, "location": "/events/evnt_test_5232t79xjha5hkur2ae", "key": "recipient.create", - "created": "2015-11-20T05:48:48Z", + "created_at": "2015-11-20T05:48:48Z", "data": { "object": "recipient", "id": "recp_test_5232t79suym0nbt6x5w", @@ -680,10 +680,10 @@ "brand": "bbl", "last_digits": "7890", "name": "Somchai Prasert", - "created": "2015-11-20T05:48:48Z" + "created_at": "2015-11-20T05:48:48Z" }, "failure_code": null, - "created": "2015-11-20T05:48:48Z" + "created_at": "2015-11-20T05:48:48Z" } }, { @@ -692,7 +692,7 @@ "livemode": false, "location": "/events/evnt_test_5232t7ba9q3cx0ldypa", "key": "recipient.update", - "created": "2015-11-20T05:48:48Z", + "created_at": "2015-11-20T05:48:48Z", "data": { "object": "recipient", "id": "recp_test_5232t79suym0nbt6x5w", @@ -710,10 +710,10 @@ "brand": "bbl", "last_digits": "7890", "name": "Somchai Prasert", - "created": "2015-11-20T05:48:48Z" + "created_at": "2015-11-20T05:48:48Z" }, "failure_code": null, - "created": "2015-11-20T05:48:48Z" + "created_at": "2015-11-20T05:48:48Z" } }, { @@ -722,7 +722,7 @@ "livemode": false, "location": "/events/evnt_test_5232t7da0f1bnwgn198", "key": "recipient.destroy", - "created": "2015-11-20T05:48:48Z", + "created_at": "2015-11-20T05:48:48Z", "data": { "object": "recipient", "id": "recp_test_5232t79suym0nbt6x5w", @@ -736,7 +736,7 @@ "livemode": false, "location": "/events/evnt_test_5232t7hgjw6d6kzvbaa", "key": "charge.create", - "created": "2015-11-20T05:48:49Z", + "created_at": "2015-11-20T05:48:49Z", "data": { "object": "charge", "id": "chrg_test_5232t7frh0sz71fpx69", @@ -781,12 +781,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2015-11-20T05:48:48Z" + "created_at": "2015-11-20T05:48:48Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2015-11-20T05:48:48Z" + "created_at": "2015-11-20T05:48:48Z" } } ] diff --git a/testdata/fixtures/api.omise.co/events/evnt_test_526yctupnje5mbldskd-get.json b/testdata/fixtures/api.omise.co/events/evnt_test_526yctupnje5mbldskd-get.json index a84f03b4..a1810961 100644 --- a/testdata/fixtures/api.omise.co/events/evnt_test_526yctupnje5mbldskd-get.json +++ b/testdata/fixtures/api.omise.co/events/evnt_test_526yctupnje5mbldskd-get.json @@ -4,7 +4,7 @@ "livemode": false, "location": "/events/evnt_test_526yctupnje5mbldskd", "key": "transfer.destroy", - "created": "2015-11-30T03:39:42Z", + "created_at": "2015-11-30T03:39:42Z", "data": { "object": "transfer", "id": "trsf_test_526yctqob5djkckq88a", diff --git a/testdata/fixtures/api.omise.co/occurrences/occu_57z9hj228pusa652nk1-get.json b/testdata/fixtures/api.omise.co/occurrences/occu_57z9hj228pusa652nk1-get.json index 2212f984..bb6a53b5 100644 --- a/testdata/fixtures/api.omise.co/occurrences/occu_57z9hj228pusa652nk1-get.json +++ b/testdata/fixtures/api.omise.co/occurrences/occu_57z9hj228pusa652nk1-get.json @@ -10,5 +10,5 @@ "status": "failed", "message": null, "result": null, - "created": "2017-06-08T04:46:50Z" + "created_at": "2017-06-08T04:46:50Z" } \ No newline at end of file diff --git a/testdata/fixtures/api.omise.co/recipients-get.json b/testdata/fixtures/api.omise.co/recipients-get.json index 608bb5d5..9305062f 100644 --- a/testdata/fixtures/api.omise.co/recipients-get.json +++ b/testdata/fixtures/api.omise.co/recipients-get.json @@ -25,10 +25,10 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, "failure_code": null, - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" } ] } diff --git a/testdata/fixtures/api.omise.co/recipients-post.json b/testdata/fixtures/api.omise.co/recipients-post.json index edb81be2..8955b0ba 100644 --- a/testdata/fixtures/api.omise.co/recipients-post.json +++ b/testdata/fixtures/api.omise.co/recipients-post.json @@ -15,8 +15,8 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, "failure_code": null, - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" } diff --git a/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-get.json b/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-get.json index 4a776895..b7f6737d 100644 --- a/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-get.json +++ b/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-get.json @@ -15,8 +15,8 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, "failure_code": null, - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" } diff --git a/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-patch.json b/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-patch.json index cb70ba8e..37360e35 100644 --- a/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-patch.json +++ b/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc-patch.json @@ -15,8 +15,8 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, "failure_code": null, - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" } diff --git a/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc/schedules-get.json b/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc/schedules-get.json index 8e9fac7e..a5b1f065 100644 --- a/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc/schedules-get.json +++ b/testdata/fixtures/api.omise.co/recipients/recp_test_50894vc13y8z4v51iuc/schedules-get.json @@ -75,7 +75,7 @@ "2018-03-10", "2018-03-26" ], - "created": "2017-05-16T07:23:11Z" + "created_at": "2017-05-16T07:23:11Z" } ] } diff --git a/testdata/fixtures/api.omise.co/schedules-get.json b/testdata/fixtures/api.omise.co/schedules-get.json index cc25bcec..c6d9ca5e 100644 --- a/testdata/fixtures/api.omise.co/schedules-get.json +++ b/testdata/fixtures/api.omise.co/schedules-get.json @@ -76,7 +76,7 @@ "2018-03-10", "2018-03-26" ], - "created": "2017-05-16T07:23:11Z" + "created_at": "2017-05-16T07:23:11Z" }, { "object": "schedule", @@ -145,7 +145,7 @@ "2018-03-10", "2018-03-26" ], - "created": "2017-05-16T07:23:11Z" + "created_at": "2017-05-16T07:23:11Z" } ] } diff --git a/testdata/fixtures/api.omise.co/schedules-post.json b/testdata/fixtures/api.omise.co/schedules-post.json index b36d4771..71c655c7 100644 --- a/testdata/fixtures/api.omise.co/schedules-post.json +++ b/testdata/fixtures/api.omise.co/schedules-post.json @@ -60,5 +60,5 @@ "2017-08-07", "2017-08-10" ], - "created": "2017-05-15T17:35:01Z" + "created_at": "2017-05-15T17:35:01Z" } diff --git a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-delete.json b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-delete.json index ab372633..48f005ed 100644 --- a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-delete.json +++ b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-delete.json @@ -60,5 +60,5 @@ "2017-08-07", "2017-08-10" ], - "created": "2017-05-15T17:35:01Z" + "created_at": "2017-05-15T17:35:01Z" } diff --git a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-get.json b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-get.json index b36d4771..71c655c7 100644 --- a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-get.json +++ b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1-get.json @@ -60,5 +60,5 @@ "2017-08-07", "2017-08-10" ], - "created": "2017-05-15T17:35:01Z" + "created_at": "2017-05-15T17:35:01Z" } diff --git a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1/occurrences-get.json b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1/occurrences-get.json index 22243be1..640d1f83 100644 --- a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1/occurrences-get.json +++ b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk1/occurrences-get.json @@ -19,7 +19,7 @@ "status": "failed", "message": null, "result": null, - "created": "2017-06-08T04:46:50Z" + "created_at": "2017-06-08T04:46:50Z" }, { "object": "occurrence", @@ -33,7 +33,7 @@ "status": "failed", "message": null, "result": null, - "created": "2017-06-08T04:46:50Z" + "created_at": "2017-06-08T04:46:50Z" } ] } \ No newline at end of file diff --git a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-delete.json b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-delete.json index 574deb30..128caee4 100644 --- a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-delete.json +++ b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-delete.json @@ -60,5 +60,5 @@ "2017-08-07", "2017-08-10" ], - "created": "2017-05-15T17:35:01Z" + "created_at": "2017-05-15T17:35:01Z" } diff --git a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-get.json b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-get.json index 658e9e7b..7c5f7c5e 100644 --- a/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-get.json +++ b/testdata/fixtures/api.omise.co/schedules/schd_57z9hj228pusa652nk2-get.json @@ -60,5 +60,5 @@ "2017-08-07", "2017-08-10" ], - "created": "2017-05-15T17:35:01Z" + "created_at": "2017-05-15T17:35:01Z" } diff --git a/testdata/fixtures/api.omise.co/search-get.json b/testdata/fixtures/api.omise.co/search-get.json index 945e0376..f3008f32 100644 --- a/testdata/fixtures/api.omise.co/search-get.json +++ b/testdata/fixtures/api.omise.co/search-get.json @@ -43,7 +43,7 @@ "voided": false, "charge": "chrg_test_54i01932u4ts67cop81", "transaction": "trxn_test_54i0196r1t05o93abtt", - "created": "2016-06-29T11:25:50Z" + "created_at": "2016-06-29T11:25:50Z" }, { "object": "refund", @@ -54,7 +54,7 @@ "voided": false, "charge": "chrg_test_54i01932u4ts67cop81", "transaction": "trxn_test_54i0196uwqt4jzskx8j", - "created": "2016-06-29T11:25:50Z" + "created_at": "2016-06-29T11:25:50Z" }, { "object": "refund", @@ -65,7 +65,7 @@ "voided": false, "charge": "chrg_test_54i01932u4ts67cop81", "transaction": "trxn_test_54l3w4ct4d3wesh93a4", - "created": "2016-07-07T10:05:11Z" + "created_at": "2016-07-07T10:05:11Z" } ] }, @@ -87,12 +87,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T11:25:50Z" + "created_at": "2016-06-29T11:25:50Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T11:25:50Z" + "created_at": "2016-06-29T11:25:50Z" }, { "object": "charge", @@ -128,7 +128,7 @@ "voided": false, "charge": "chrg_test_54i0162jcs8mc14i5lc", "transaction": "trxn_test_54i0166wiovtgckka3r", - "created": "2016-06-29T11:25:36Z" + "created_at": "2016-06-29T11:25:36Z" }, { "object": "refund", @@ -139,7 +139,7 @@ "voided": false, "charge": "chrg_test_54i0162jcs8mc14i5lc", "transaction": "trxn_test_54i016761lriugvhy4j", - "created": "2016-06-29T11:25:36Z" + "created_at": "2016-06-29T11:25:36Z" } ] }, @@ -161,12 +161,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T11:25:35Z" + "created_at": "2016-06-29T11:25:35Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T11:25:35Z" + "created_at": "2016-06-29T11:25:35Z" }, { "object": "charge", @@ -202,7 +202,7 @@ "voided": false, "charge": "chrg_test_54i00wtwt23bain6fhd", "transaction": "trxn_test_54i00wxb3vwinin67ow", - "created": "2016-06-29T11:24:52Z" + "created_at": "2016-06-29T11:24:52Z" } ] }, @@ -224,12 +224,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T11:24:52Z" + "created_at": "2016-06-29T11:24:52Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T11:24:52Z" + "created_at": "2016-06-29T11:24:52Z" }, { "object": "charge", @@ -265,7 +265,7 @@ "voided": false, "charge": "chrg_test_54hzufn0cmq9b6tsn8w", "transaction": "trxn_test_54hzufrg7ixbjk61ryk", - "created": "2016-06-29T11:06:28Z" + "created_at": "2016-06-29T11:06:28Z" } ] }, @@ -287,12 +287,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T11:06:27Z" + "created_at": "2016-06-29T11:06:27Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T11:06:28Z" + "created_at": "2016-06-29T11:06:28Z" }, { "object": "charge", @@ -328,7 +328,7 @@ "voided": false, "charge": "chrg_test_54hzuds422yeavqtfe4", "transaction": "trxn_test_54hzudv5trdcyosvyff", - "created": "2016-06-29T11:06:19Z" + "created_at": "2016-06-29T11:06:19Z" }, { "object": "refund", @@ -339,7 +339,7 @@ "voided": false, "charge": "chrg_test_54hzuds422yeavqtfe4", "transaction": "trxn_test_54lgmc7o96045fuut82", - "created": "2016-07-08T07:46:52Z" + "created_at": "2016-07-08T07:46:52Z" } ] }, @@ -361,12 +361,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T11:06:19Z" + "created_at": "2016-06-29T11:06:19Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T11:06:19Z" + "created_at": "2016-06-29T11:06:19Z" }, { "object": "charge", @@ -402,7 +402,7 @@ "voided": false, "charge": "chrg_test_54hzprq7sgcd4o90x91", "transaction": "trxn_test_54hzpruxjx587lfxx52", - "created": "2016-06-29T10:53:13Z" + "created_at": "2016-06-29T10:53:13Z" } ] }, @@ -424,12 +424,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:53:12Z" + "created_at": "2016-06-29T10:53:12Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:53:13Z" + "created_at": "2016-06-29T10:53:13Z" }, { "object": "charge", @@ -465,7 +465,7 @@ "voided": false, "charge": "chrg_test_54hzpr6voq0k0unq87d", "transaction": "trxn_test_54hzprbtx2o5nuiqqip", - "created": "2016-06-29T10:53:11Z" + "created_at": "2016-06-29T10:53:11Z" } ] }, @@ -487,12 +487,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:53:10Z" + "created_at": "2016-06-29T10:53:10Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:53:10Z" + "created_at": "2016-06-29T10:53:10Z" }, { "object": "charge", @@ -528,7 +528,7 @@ "voided": false, "charge": "chrg_test_54hzpqosheflt6xi8cc", "transaction": "trxn_test_54hzpqshswp5e44dqwp", - "created": "2016-06-29T10:53:08Z" + "created_at": "2016-06-29T10:53:08Z" }, { "object": "refund", @@ -539,7 +539,7 @@ "voided": false, "charge": "chrg_test_54hzpqosheflt6xi8cc", "transaction": "trxn_test_54l3yqbpqmhfaoy3tb0", - "created": "2016-07-07T10:12:36Z" + "created_at": "2016-07-07T10:12:36Z" } ] }, @@ -561,12 +561,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:53:07Z" + "created_at": "2016-06-29T10:53:07Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:53:08Z" + "created_at": "2016-06-29T10:53:08Z" }, { "object": "charge", @@ -602,7 +602,7 @@ "voided": false, "charge": "chrg_test_54hzpk1mau2l2bsudsz", "transaction": "trxn_test_54hzpk5xtf9rulaxvwb", - "created": "2016-06-29T10:52:37Z" + "created_at": "2016-06-29T10:52:37Z" } ] }, @@ -624,12 +624,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:52:36Z" + "created_at": "2016-06-29T10:52:36Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:52:36Z" + "created_at": "2016-06-29T10:52:36Z" }, { "object": "charge", @@ -665,7 +665,7 @@ "voided": false, "charge": "chrg_test_54hzgh9zh5pgqa85qum", "transaction": "trxn_test_54hzghfh5abr0a56k3l", - "created": "2016-06-29T10:26:50Z" + "created_at": "2016-06-29T10:26:50Z" } ] }, @@ -687,12 +687,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:26:49Z" + "created_at": "2016-06-29T10:26:49Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:26:49Z" + "created_at": "2016-06-29T10:26:49Z" }, { "object": "charge", @@ -728,7 +728,7 @@ "voided": false, "charge": "chrg_test_54hzgeybwvow7y0wm45", "transaction": "trxn_test_54hzgf2heiqn4m3mgp9", - "created": "2016-06-29T10:26:39Z" + "created_at": "2016-06-29T10:26:39Z" } ] }, @@ -750,12 +750,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:26:38Z" + "created_at": "2016-06-29T10:26:38Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:26:38Z" + "created_at": "2016-06-29T10:26:38Z" }, { "object": "charge", @@ -803,12 +803,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:26:36Z" + "created_at": "2016-06-29T10:26:36Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:26:36Z" + "created_at": "2016-06-29T10:26:36Z" }, { "object": "charge", @@ -844,7 +844,7 @@ "voided": false, "charge": "chrg_test_54hzgcjusrgqn61l93c", "transaction": "trxn_test_54hzgco5r1ws3etd9k0", - "created": "2016-06-29T10:26:27Z" + "created_at": "2016-06-29T10:26:27Z" } ] }, @@ -866,12 +866,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:26:27Z" + "created_at": "2016-06-29T10:26:27Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:26:27Z" + "created_at": "2016-06-29T10:26:27Z" }, { "object": "charge", @@ -907,7 +907,7 @@ "voided": false, "charge": "chrg_test_54hzga7l0yflpnamhsq", "transaction": "trxn_test_54hzgabm5iznfbuwt7z", - "created": "2016-06-29T10:26:16Z" + "created_at": "2016-06-29T10:26:16Z" } ] }, @@ -929,12 +929,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:26:16Z" + "created_at": "2016-06-29T10:26:16Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:26:16Z" + "created_at": "2016-06-29T10:26:16Z" }, { "object": "charge", @@ -970,7 +970,7 @@ "voided": false, "charge": "chrg_test_54hzfssszeaco9iz0iq", "transaction": "trxn_test_54hzfswjvstdgu4nv63", - "created": "2016-06-29T10:24:54Z" + "created_at": "2016-06-29T10:24:54Z" } ] }, @@ -992,12 +992,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:24:53Z" + "created_at": "2016-06-29T10:24:53Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:24:53Z" + "created_at": "2016-06-29T10:24:53Z" }, { "object": "charge", @@ -1033,7 +1033,7 @@ "voided": false, "charge": "chrg_test_54hzfr15uqkvwar4hzt", "transaction": "trxn_test_54hzfr6rktkgec2qm6a", - "created": "2016-06-29T10:24:46Z" + "created_at": "2016-06-29T10:24:46Z" } ] }, @@ -1055,12 +1055,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:24:45Z" + "created_at": "2016-06-29T10:24:45Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:24:45Z" + "created_at": "2016-06-29T10:24:45Z" }, { "object": "charge", @@ -1096,7 +1096,7 @@ "voided": false, "charge": "chrg_test_54hzfqhy4jmjk44fmet", "transaction": "trxn_test_54hzfqlwzn3ia9i5paq", - "created": "2016-06-29T10:24:43Z" + "created_at": "2016-06-29T10:24:43Z" } ] }, @@ -1118,12 +1118,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:24:42Z" + "created_at": "2016-06-29T10:24:42Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:24:42Z" + "created_at": "2016-06-29T10:24:42Z" }, { "object": "charge", @@ -1159,7 +1159,7 @@ "voided": false, "charge": "chrg_test_54hzfohoku923w8yz11", "transaction": "trxn_test_54hzfoma81sdpuzfw62", - "created": "2016-06-29T10:24:33Z" + "created_at": "2016-06-29T10:24:33Z" } ] }, @@ -1181,12 +1181,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:24:33Z" + "created_at": "2016-06-29T10:24:33Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:24:33Z" + "created_at": "2016-06-29T10:24:33Z" }, { "object": "charge", @@ -1222,7 +1222,7 @@ "voided": false, "charge": "chrg_test_54hzfmhrwb1g2yhr9vu", "transaction": "trxn_test_54hzfmmgaqeszr09q9k", - "created": "2016-06-29T10:24:24Z" + "created_at": "2016-06-29T10:24:24Z" } ] }, @@ -1244,12 +1244,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:24:23Z" + "created_at": "2016-06-29T10:24:23Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:24:23Z" + "created_at": "2016-06-29T10:24:23Z" }, { "object": "charge", @@ -1297,12 +1297,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:24:13Z" + "created_at": "2016-06-29T10:24:13Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:24:13Z" + "created_at": "2016-06-29T10:24:13Z" }, { "object": "charge", @@ -1350,12 +1350,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:23:52Z" + "created_at": "2016-06-29T10:23:52Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:23:52Z" + "created_at": "2016-06-29T10:23:52Z" }, { "object": "charge", @@ -1403,12 +1403,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:22:55Z" + "created_at": "2016-06-29T10:22:55Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:22:55Z" + "created_at": "2016-06-29T10:22:55Z" }, { "object": "charge", @@ -1456,12 +1456,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Omise Appleseed", "security_code_check": true, - "created": "2016-06-29T10:22:37Z" + "created_at": "2016-06-29T10:22:37Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-29T10:22:37Z" + "created_at": "2016-06-29T10:22:37Z" }, { "object": "charge", @@ -1509,12 +1509,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2016-06-15T10:33:10Z" + "created_at": "2016-06-15T10:33:10Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-15T10:33:11Z" + "created_at": "2016-06-15T10:33:11Z" }, { "object": "charge", @@ -1562,12 +1562,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2016-06-15T07:38:23Z" + "created_at": "2016-06-15T07:38:23Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-15T07:38:24Z" + "created_at": "2016-06-15T07:38:24Z" }, { "object": "charge", @@ -1615,12 +1615,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2016-06-15T07:25:18Z" + "created_at": "2016-06-15T07:25:18Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-15T07:25:18Z" + "created_at": "2016-06-15T07:25:18Z" }, { "object": "charge", @@ -1668,12 +1668,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2016-06-15T07:25:12Z" + "created_at": "2016-06-15T07:25:12Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-15T07:25:12Z" + "created_at": "2016-06-15T07:25:12Z" }, { "object": "charge", @@ -1721,12 +1721,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Chakrit Wichian", "security_code_check": true, - "created": "2016-06-15T07:24:59Z" + "created_at": "2016-06-15T07:24:59Z" }, "customer": null, "ip": null, "dispute": null, - "created": "2016-06-15T07:25:01Z" + "created_at": "2016-06-15T07:25:01Z" }, { "object": "charge", @@ -1762,7 +1762,7 @@ "voided": true, "charge": "chrg_test_52ye6ksqi1dacbw8wkx", "transaction": "trxn_test_52yerwvjz9b4bpjmak9", - "created": "2016-02-08T08:22:34Z" + "created_at": "2016-02-08T08:22:34Z" } ] }, @@ -1785,12 +1785,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Somchai Prasert", "security_code_check": true, - "created": "2016-02-08T06:49:40Z" + "created_at": "2016-02-08T06:49:40Z" }, "customer": "cust_test_52ydv7e3ao0oqwjj97e", "ip": null, "dispute": null, - "created": "2016-02-08T07:21:58Z" + "created_at": "2016-02-08T07:21:58Z" }, { "object": "charge", @@ -1839,12 +1839,12 @@ "fingerprint": "mJnCcSbRLzwfV62Do9MAmjpXlzDBVJ/hvu8go4JYyqU=", "name": "Somchai Prasert", "security_code_check": true, - "created": "2016-02-08T06:49:40Z" + "created_at": "2016-02-08T06:49:40Z" }, "customer": "cust_test_52ydv7e3ao0oqwjj97e", "ip": null, "dispute": null, - "created": "2016-02-08T07:21:16Z" + "created_at": "2016-02-08T07:21:16Z" } ] } diff --git a/testdata/fixtures/api.omise.co/sources-post.json b/testdata/fixtures/api.omise.co/sources-post.json index 41f3986a..a47e2731 100644 --- a/testdata/fixtures/api.omise.co/sources-post.json +++ b/testdata/fixtures/api.omise.co/sources-post.json @@ -6,7 +6,7 @@ "amount": 2000, "barcode": null, "bank": "ocbc", - "created_at": "2021-02-22T07:30:12Z", + "created_at_at": "2021-02-22T07:30:12Z", "currency": "MYR", "email": "example@omise.co", "flow": "redirect", diff --git a/testdata/fixtures/api.omise.co/transactions-get.json b/testdata/fixtures/api.omise.co/transactions-get.json index 080a59ff..897880ac 100644 --- a/testdata/fixtures/api.omise.co/transactions-get.json +++ b/testdata/fixtures/api.omise.co/transactions-get.json @@ -15,7 +15,7 @@ "type": "credit", "amount": 96094, "currency": "THB", - "created": "2015-01-15T05:00:29Z", + "created_at": "2015-01-15T05:00:29Z", "transferable": "2016-01-28T05:58:28Z", "source": "chrg_test_52u2h7igf601x172g23" }, @@ -25,7 +25,7 @@ "type": "debit", "amount": 192188, "currency": "THB", - "created": "2015-01-15T10:12:25Z", + "created_at": "2015-01-15T10:12:25Z", "location": "/transactions/trxn_test_52u2h7rxsbg06m2nyqb", "transferable": "2016-01-28T05:58:30Z", "source": "chrg_test_52u2h7q6a1fz4msrqdk" diff --git a/testdata/fixtures/api.omise.co/transactions/trxn_test_4yq7duwb9jts1vxgqua-get.json b/testdata/fixtures/api.omise.co/transactions/trxn_test_4yq7duwb9jts1vxgqua-get.json index f8f62d7e..1721929d 100644 --- a/testdata/fixtures/api.omise.co/transactions/trxn_test_4yq7duwb9jts1vxgqua-get.json +++ b/testdata/fixtures/api.omise.co/transactions/trxn_test_4yq7duwb9jts1vxgqua-get.json @@ -4,5 +4,5 @@ "type": "credit", "amount": 96094, "currency": "THB", - "created": "2015-01-15T05:00:29Z" + "created_at": "2015-01-15T05:00:29Z" } diff --git a/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqafnvlztbf3908vs1-get.json b/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqafnvlztbf3908vs1-get.json index 72eb8bd6..ad25db8d 100644 --- a/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqafnvlztbf3908vs1-get.json +++ b/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqafnvlztbf3908vs1-get.json @@ -4,5 +4,5 @@ "type": "debit", "amount": 192188, "currency": "THB", - "created": "2015-01-15T10:12:25Z" + "created_at": "2015-01-15T10:12:25Z" } diff --git a/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqmv79fzpy0gmz5mmq-get.json b/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqmv79fzpy0gmz5mmq-get.json index 9c88a8a3..c381a6a3 100644 --- a/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqmv79fzpy0gmz5mmq-get.json +++ b/testdata/fixtures/api.omise.co/transactions/trxn_test_4yqmv79fzpy0gmz5mmq-get.json @@ -4,5 +4,5 @@ "type": "debit", "amount": 10000, "currency": "THB", - "created": "2015-01-16T07:23:45Z" + "created_at": "2015-01-16T07:23:45Z" } diff --git a/testdata/fixtures/api.omise.co/transfers-get.json b/testdata/fixtures/api.omise.co/transfers-get.json index 761fb1c9..1db61fca 100644 --- a/testdata/fixtures/api.omise.co/transfers-get.json +++ b/testdata/fixtures/api.omise.co/transfers-get.json @@ -21,7 +21,7 @@ "brand": "test", "last_digits": "6789", "name": "DEFAULT BANK ACCOUNT", - "created": "2015-12-16T05:55:29Z" + "created_at": "2015-12-16T05:55:29Z" }, "currency": "thb", "fee": 3000, @@ -29,7 +29,7 @@ "failure_message": null, "transaction": "trxn_test_4yqafnvlztbf3908vs1", "recipient": "recp_test_50894vc13y8z4v51iuc", - "created": "2016-01-28T06:56:10Z" + "created_at": "2016-01-28T06:56:10Z" }, { "object": "transfer", @@ -42,9 +42,9 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, - "created": "2015-01-15T10:04:47Z" + "created_at": "2015-01-15T10:04:47Z" "sent": false, "paid": false, "amount": 32100, diff --git a/testdata/fixtures/api.omise.co/transfers-post.json b/testdata/fixtures/api.omise.co/transfers-post.json index d8201542..7e80bbbc 100644 --- a/testdata/fixtures/api.omise.co/transfers-post.json +++ b/testdata/fixtures/api.omise.co/transfers-post.json @@ -16,7 +16,7 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, - "created": "2015-01-15T10:04:47Z" + "created_at": "2015-01-15T10:04:47Z" } diff --git a/testdata/fixtures/api.omise.co/transfers/schedules-get.json b/testdata/fixtures/api.omise.co/transfers/schedules-get.json index 8e9fac7e..a5b1f065 100644 --- a/testdata/fixtures/api.omise.co/transfers/schedules-get.json +++ b/testdata/fixtures/api.omise.co/transfers/schedules-get.json @@ -75,7 +75,7 @@ "2018-03-10", "2018-03-26" ], - "created": "2017-05-16T07:23:11Z" + "created_at": "2017-05-16T07:23:11Z" } ] } diff --git a/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-get.json b/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-get.json index d8201542..7e80bbbc 100644 --- a/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-get.json +++ b/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-get.json @@ -16,7 +16,7 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, - "created": "2015-01-15T10:04:47Z" + "created_at": "2015-01-15T10:04:47Z" } diff --git a/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-patch.json b/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-patch.json index b8829578..c04a69a2 100644 --- a/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-patch.json +++ b/testdata/fixtures/api.omise.co/transfers/trsf_test_4yqacz8t3cbipcj766u-patch.json @@ -16,7 +16,7 @@ "brand": "test", "last_digits": "6789", "name": "JOHN DOE", - "created": "2015-06-02T09:26:59Z" + "created_at": "2015-06-02T09:26:59Z" }, - "created": "2015-01-15T10:04:47Z" + "created_at": "2015-01-15T10:04:47Z" } diff --git a/testdata/fixtures/vault.omise.co/tokens-post.json b/testdata/fixtures/vault.omise.co/tokens-post.json index ae437fe8..2716c800 100644 --- a/testdata/fixtures/vault.omise.co/tokens-post.json +++ b/testdata/fixtures/vault.omise.co/tokens-post.json @@ -19,7 +19,7 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" }, - "created": "2015-01-15T07:03:56Z" + "created_at": "2015-01-15T07:03:56Z" } diff --git a/testdata/fixtures/vault.omise.co/tokens/tokn_test_4yq8lbecl0q6dsjzxr5-get.json b/testdata/fixtures/vault.omise.co/tokens/tokn_test_4yq8lbecl0q6dsjzxr5-get.json index ae437fe8..2716c800 100644 --- a/testdata/fixtures/vault.omise.co/tokens/tokn_test_4yq8lbecl0q6dsjzxr5-get.json +++ b/testdata/fixtures/vault.omise.co/tokens/tokn_test_4yq8lbecl0q6dsjzxr5-get.json @@ -19,7 +19,7 @@ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=", "name": "JOHN DOE", "security_code_check": true, - "created": "2015-01-15T04:03:40Z" + "created_at": "2015-01-15T04:03:40Z" }, - "created": "2015-01-15T07:03:56Z" + "created_at": "2015-01-15T07:03:56Z" } diff --git a/testdata/objects/account_object.json b/testdata/objects/account_object.json index b9e47977..0f79abf7 100644 --- a/testdata/objects/account_object.json +++ b/testdata/objects/account_object.json @@ -2,5 +2,5 @@ "object": "account", "id": "acct_4x7d2wtqnj2f4klrfsc", "email": "gedeon@gedeon.be", - "created": "2015-05-20T04:57:36Z" + "created_at": "2015-05-20T04:57:36Z" } diff --git a/testdata/objects/balance_object.json b/testdata/objects/balance_object.json index 3480dd5b..fa83b120 100644 --- a/testdata/objects/balance_object.json +++ b/testdata/objects/balance_object.json @@ -1,7 +1,7 @@ { "object": "balance", "livemode": false, - "available": 380470, + "transferable": 380470, "total": 380470, "currency": "thb" } diff --git a/testdata/objects/bank_account_object.json b/testdata/objects/bank_account_object.json index 64a0639c..72e0da77 100644 --- a/testdata/objects/bank_account_object.json +++ b/testdata/objects/bank_account_object.json @@ -1,7 +1,7 @@ { "object": "bank_account", "brand": "bbl", - "number": "1234567890", + "account_number": "1234567890", "name": "SOMCHAI PRASERT", - "created": "2015-02-26T09:56:15Z" + "created_at": "2015-02-26T09:56:15Z" } diff --git a/testdata/objects/card_object.json b/testdata/objects/card_object.json index d0aef7f2..d7835716 100644 --- a/testdata/objects/card_object.json +++ b/testdata/objects/card_object.json @@ -14,5 +14,5 @@ "fingerprint": "mKleiBfwp+PoJWB/ipngANuECUmRKjyxROwFW5IO7TM=", "name": "Somchai Prasert", "security_code_check": true, - "created": "2015-06-02T05:41:46Z" + "created_at": "2015-06-02T05:41:46Z" } diff --git a/testdata/objects/charge_object.json b/testdata/objects/charge_object.json index 609e46c8..bd046de0 100644 --- a/testdata/objects/charge_object.json +++ b/testdata/objects/charge_object.json @@ -10,7 +10,7 @@ "authorized": true, "paid": true, "transaction": "trxn_test_5086xltqqbv4qpmu0ri", - "refunded": 0, + "refunded_amount": 0, "refunds": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -41,10 +41,10 @@ "fingerprint": "mKleiBfwp+PoJWB/ipngANuECUmRKjyxROwFW5IO7TM=", "name": "Somchai Prasert", "security_code_check": true, - "created": "2015-06-02T05:41:46Z" + "created_at": "2015-06-02T05:41:46Z" }, "customer": "cust_test_5086xleuh9ft4bn0ac2", "ip": null, "dispute": null, - "created": "2015-06-02T05:41:49Z" + "created_at": "2015-06-02T05:41:49Z" } diff --git a/testdata/objects/customer_object.json b/testdata/objects/customer_object.json index bdc803d3..f18cbe00 100644 --- a/testdata/objects/customer_object.json +++ b/testdata/objects/customer_object.json @@ -6,7 +6,7 @@ "default_card": "card_test_5086xl7amxfysl0ac5l", "email": "john.doe@example.com", "description": "John Doe (id: 30)", - "created": "2015-06-02T05:41:47Z", + "created_at": "2015-06-02T05:41:47Z", "cards": { "object": "list", "from": "1970-01-01T00:00:00+00:00", @@ -31,7 +31,7 @@ "fingerprint": "mKleiBfwp+PoJWB/ipngANuECUmRKjyxROwFW5IO7TM=", "name": "Somchai Prasert", "security_code_check": true, - "created": "2015-06-02T05:41:46Z" + "created_at": "2015-06-02T05:41:46Z" } ], "location": "/customers/cust_test_5086xleuh9ft4bn0ac2/cards" diff --git a/testdata/objects/dispute_object.json b/testdata/objects/dispute_object.json index 4ee941e7..eb6e8485 100644 --- a/testdata/objects/dispute_object.json +++ b/testdata/objects/dispute_object.json @@ -8,5 +8,5 @@ "status": "pending", "message": "This is an unauthorized transaction", "charge": "chrg_test_4zgcsiv4s6ewsy8nrw3", - "created": "2015-03-23T05:24:39Z" + "created_at": "2015-03-23T05:24:39Z" } diff --git a/testdata/objects/event_object.json b/testdata/objects/event_object.json index a84f03b4..a1810961 100644 --- a/testdata/objects/event_object.json +++ b/testdata/objects/event_object.json @@ -4,7 +4,7 @@ "livemode": false, "location": "/events/evnt_test_526yctupnje5mbldskd", "key": "transfer.destroy", - "created": "2015-11-30T03:39:42Z", + "created_at": "2015-11-30T03:39:42Z", "data": { "object": "transfer", "id": "trsf_test_526yctqob5djkckq88a", diff --git a/testdata/objects/recipient_object.json b/testdata/objects/recipient_object.json index 55a94155..f9a51173 100644 --- a/testdata/objects/recipient_object.json +++ b/testdata/objects/recipient_object.json @@ -15,8 +15,8 @@ "brand": "bbl", "last_digits": "7890", "name": "SOMCHAI PRASERT", - "created": "2015-06-02T05:41:53Z" + "created_at": "2015-06-02T05:41:53Z" }, "failure_code": null, - "created": "2015-06-02T05:41:53Z" + "created_at": "2015-06-02T05:41:53Z" } diff --git a/testdata/objects/refund_object.json b/testdata/objects/refund_object.json index f0da3733..ccd7f91c 100644 --- a/testdata/objects/refund_object.json +++ b/testdata/objects/refund_object.json @@ -6,5 +6,5 @@ "currency": "thb", "charge": "chrg_test_5086xlsx4lghk9bpb75", "transaction": "trxn_test_5086xm1mbshmohdhk00", - "created": "2015-06-02T05:41:50Z" + "created_at": "2015-06-02T05:41:50Z" } diff --git a/testdata/objects/schedule_object.json b/testdata/objects/schedule_object.json index b36d4771..71c655c7 100644 --- a/testdata/objects/schedule_object.json +++ b/testdata/objects/schedule_object.json @@ -60,5 +60,5 @@ "2017-08-07", "2017-08-10" ], - "created": "2017-05-15T17:35:01Z" + "created_at": "2017-05-15T17:35:01Z" } diff --git a/testdata/objects/token_object.json b/testdata/objects/token_object.json index 907133a8..a4f6dd0e 100644 --- a/testdata/objects/token_object.json +++ b/testdata/objects/token_object.json @@ -19,7 +19,7 @@ "fingerprint": "mKleiBfwp+PoJWB/ipngANuECUmRKjyxROwFW5IO7TM=", "name": "Somchai Prasert", "security_code_check": true, - "created": "2015-06-02T05:41:46Z" + "created_at": "2015-06-02T05:41:46Z" }, - "created": "2015-06-02T05:41:46Z" + "created_at": "2015-06-02T05:41:46Z" } diff --git a/testdata/objects/transaction_object.json b/testdata/objects/transaction_object.json index 61c8aabb..61699cca 100644 --- a/testdata/objects/transaction_object.json +++ b/testdata/objects/transaction_object.json @@ -4,5 +4,5 @@ "type": "credit", "amount": 96094, "currency": "THB", - "created": "2015-06-02T05:34:54Z" + "created_at": "2015-06-02T05:34:54Z" } diff --git a/testdata/objects/transfer_object.json b/testdata/objects/transfer_object.json index 7e456738..f8fd2404 100644 --- a/testdata/objects/transfer_object.json +++ b/testdata/objects/transfer_object.json @@ -9,7 +9,7 @@ "brand": "test", "last_digits": "6789", "name": "DEFAULT BANK ACCOUNT", - "created": "2015-05-30T04:28:09Z" + "created_at": "2015-05-30T04:28:09Z" }, "sent": false, "paid": false, @@ -18,5 +18,5 @@ "failure_code": null, "failure_message": null, "transaction": null, - "created": "2015-06-02T05:34:13Z" + "created_at": "2015-06-02T05:34:13Z" }