diff --git a/VERSION b/VERSION index 8de87d233e..8959649997 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -72.67.0-omni +72.67.0-omni.1 diff --git a/bitcoinreceiver.go b/bitcoinreceiver.go deleted file mode 100644 index 142189b96d..0000000000 --- a/bitcoinreceiver.go +++ /dev/null @@ -1,63 +0,0 @@ -package stripe - -import ( - "encoding/json" -) - -// BitcoinReceiverListParams is the set of parameters that can be used when listing BitcoinReceivers. -// For more details see https://stripe.com/docs/api/#list_bitcoin_receivers. -type BitcoinReceiverListParams struct { - ListParams `form:"*" json:"*" json:"*" json:"*"` - Active *bool `form:"active" json:"active" json:"active" json:"active"` - Filled *bool `form:"filled" json:"filled" json:"filled" json:"filled"` - UncapturedFunds *bool `form:"uncaptured_funds" json:"uncaptured_funds" json:"uncaptured_funds" json:"uncaptured_funds"` -} - -// BitcoinReceiver is the resource representing a Stripe bitcoin receiver. -// For more details see https://stripe.com/docs/api/#bitcoin_receivers -type BitcoinReceiver struct { - Active bool `json:"active"` - Amount int64 `json:"amount"` - AmountReceived int64 `json:"amount_received"` - BitcoinAmount int64 `json:"bitcoin_amount"` - BitcoinAmountReceived int64 `json:"bitcoin_amount_received"` - BitcoinURI string `json:"bitcoin_uri"` - Created int64 `json:"created"` - Currency Currency `json:"currency"` - Customer string `json:"customer"` - Description string `json:"description"` - Email string `json:"email"` - Filled bool `json:"filled"` - ID string `json:"id"` - InboundAddress string `json:"inbound_address"` - Metadata map[string]string `json:"metadata"` - Payment string `json:"payment"` - RefundAddress string `json:"refund_address"` - RejectTransactions bool `json:"reject_transactions"` - Transactions *BitcoinTransactionList `json:"transactions"` -} - -// BitcoinReceiverList is a list of bitcoin receivers as retrieved from a list endpoint. -type BitcoinReceiverList struct { - ListMeta - Data []*BitcoinReceiver `json:"data"` -} - -// UnmarshalJSON handles deserialization of a BitcoinReceiver. -// This custom unmarshaling is needed because the resulting -// property may be an id or the full struct if it was expanded. -func (r *BitcoinReceiver) UnmarshalJSON(data []byte) error { - if id, ok := ParseID(data); ok { - r.ID = id - return nil - } - - type bitcoinReceiver BitcoinReceiver - var v bitcoinReceiver - if err := json.Unmarshal(data, &v); err != nil { - return err - } - - *r = BitcoinReceiver(v) - return nil -} diff --git a/bitcointransaction.go b/bitcointransaction.go deleted file mode 100644 index dadcdf5eb4..0000000000 --- a/bitcointransaction.go +++ /dev/null @@ -1,49 +0,0 @@ -package stripe - -import "encoding/json" - -// BitcoinTransactionListParams is the set of parameters that can be used when listing BitcoinTransactions. -type BitcoinTransactionListParams struct { - ListParams `form:"*" json:"*" json:"*" json:"*"` - Customer *string `form:"customer" json:"customer" json:"customer" json:"customer"` - Receiver *string `form:"-" json:"-" json:"-" json:"-"` // Sent in with the URL -} - -// BitcoinTransactionList is a list object for BitcoinTransactions. -// It is a child object of BitcoinReceivers -// For more details see https://stripe.com/docs/api/#retrieve_bitcoin_receiver -type BitcoinTransactionList struct { - ListMeta - Data []*BitcoinTransaction `json:"data"` -} - -// BitcoinTransaction is the resource representing a Stripe bitcoin transaction. -// For more details see https://stripe.com/docs/api/#bitcoin_receivers -type BitcoinTransaction struct { - Amount int64 `json:"amount"` - BitcoinAmount int64 `json:"bitcoin_amount"` - Created int64 `json:"created"` - Currency Currency `json:"currency"` - Customer string `json:"customer"` - ID string `json:"id"` - Receiver string `json:"receiver"` -} - -// UnmarshalJSON handles deserialization of a BitcoinTransaction. -// This custom unmarshaling is needed because the resulting -// property may be an id or the full struct if it was expanded. -func (bt *BitcoinTransaction) UnmarshalJSON(data []byte) error { - if id, ok := ParseID(data); ok { - bt.ID = id - return nil - } - - type bitcoinTransaction BitcoinTransaction - var v bitcoinTransaction - if err := json.Unmarshal(data, &v); err != nil { - return err - } - - *bt = BitcoinTransaction(v) - return nil -} diff --git a/exchangerate.go b/exchangerate.go deleted file mode 100644 index eceb7cbac6..0000000000 --- a/exchangerate.go +++ /dev/null @@ -1,25 +0,0 @@ -package stripe - -// ExchangeRate is the resource representing the currency exchange rates at -// a given time. -type ExchangeRate struct { - ID string `json:"id"` - Rates map[Currency]float64 `json:"rates"` -} - -// ExchangeRateParams is the set of parameters that can be used when retrieving -// exchange rates. -type ExchangeRateParams struct { - Params `form:"*" json:"*" json:"*" json:"*"` -} - -// ExchangeRateList is a list of exchange rates as retrieved from a list endpoint. -type ExchangeRateList struct { - ListMeta - Data []*ExchangeRate `json:"data"` -} - -// ExchangeRateListParams are the parameters allowed during ExchangeRate listing. -type ExchangeRateListParams struct { - ListParams `form:"*" json:"*" json:"*" json:"*"` -} diff --git a/recipient.go b/recipient.go deleted file mode 100644 index eeb2bad900..0000000000 --- a/recipient.go +++ /dev/null @@ -1,95 +0,0 @@ -package stripe - -import ( - "encoding/json" - - "github.com/stripe/stripe-go/form" -) - -// RecipientType is the list of allowed values for the recipient's type. -type RecipientType string - -// List of values that RecipientType can take. -const ( - RecipientTypeIndividual RecipientType = "individual" - RecipientTypeCorporation RecipientType = "corporation" -) - -// RecipientParams is the set of parameters that can be used when creating or updating recipients. -// For more details see https://stripe.com/docs/api#create_recipient and https://stripe.com/docs/api#update_recipient. -type RecipientParams struct { - Params `form:"*" json:"*" json:"*" json:"*"` - - BankAccount *BankAccountParams `form:"-" json:"-" json:"-" json:"-"` // Kind of an abberation because a bank account's token will be replace the rest of its data. Keep this in a custom AppendTo for now. - Card *CardParams `form:"card" json:"card" json:"card" json:"card"` - DefaultCard *string `form:"default_card" json:"default_card" json:"default_card" json:"default_card"` - Description *string `form:"description" json:"description" json:"description" json:"description"` - Email *string `form:"email" json:"email" json:"email" json:"email"` - Name *string `form:"name" json:"name" json:"name" json:"name"` - TaxID *string `form:"tax_id" json:"tax_id" json:"tax_id" json:"tax_id"` - Token *string `form:"card" json:"card" json:"card" json:"card"` - Type *string `form:"-" json:"-" json:"-" json:"-"` // Doesn't seem to be used anywhere -} - -// AppendTo implements some custom behavior around a recipient's bank account. -// This was probably the wrong way to go about this, but grandfather the -// behavior for the time being. -func (p *RecipientParams) AppendTo(body *form.Values, keyParts []string) { - if p.BankAccount != nil { - if p.BankAccount.Token != nil { - body.Add("bank_account", StringValue(p.BankAccount.Token)) - } else { - form.AppendToPrefixed(body, p.BankAccount, append(keyParts, "bank_account")) - } - } -} - -// RecipientListParams is the set of parameters that can be used when listing recipients. -// For more details see https://stripe.com/docs/api#list_recipients. -type RecipientListParams struct { - ListParams `form:"*" json:"*" json:"*" json:"*"` - Verified *bool `form:"verified" json:"verified" json:"verified" json:"verified"` -} - -// Recipient is the resource representing a Stripe recipient. -// For more details see https://stripe.com/docs/api#recipients. -type Recipient struct { - ActiveAccount *BankAccount `json:"active_account"` - Cards *CardList `json:"cards"` - Created int64 `json:"created"` - DefaultCard *Card `json:"default_card"` - Deleted bool `json:"deleted"` - Description string `json:"description"` - Email string `json:"email"` - ID string `json:"id"` - Livemode bool `json:"livemode"` - Metadata map[string]string `json:"metadata"` - MigratedTo *Account `json:"migrated_to"` - Name string `json:"name"` - Type RecipientType `json:"type"` -} - -// RecipientList is a list of recipients as retrieved from a list endpoint. -type RecipientList struct { - ListMeta - Data []*Recipient `json:"data"` -} - -// UnmarshalJSON handles deserialization of a Recipient. -// This custom unmarshaling is needed because the resulting -// property may be an id or the full struct if it was expanded. -func (r *Recipient) UnmarshalJSON(data []byte) error { - if id, ok := ParseID(data); ok { - r.ID = id - return nil - } - - type recipient Recipient - var v recipient - if err := json.Unmarshal(data, &v); err != nil { - return err - } - - *r = Recipient(v) - return nil -} diff --git a/recipienttransfer.go b/recipienttransfer.go deleted file mode 100644 index 854beec81c..0000000000 --- a/recipienttransfer.go +++ /dev/null @@ -1,155 +0,0 @@ -package stripe - -import "encoding/json" - -// RecipientTransferDestinationType consts represent valid recipient_transfer destinations. -type RecipientTransferDestinationType string - -// List of values that RecipientTransferDestinationType can take. -const ( - RecipientTransferDestinationBankAccount RecipientTransferDestinationType = "bank_account" - RecipientTransferDestinationCard RecipientTransferDestinationType = "card" -) - -// RecipientTransferFailureCode is the list of allowed values for the recipient_transfer's failure code. -type RecipientTransferFailureCode string - -// List of values that RecipientTransferFailureCode can take. -const ( - RecipientTransferFailureCodeAccountClosed RecipientTransferFailureCode = "account_closed" - RecipientTransferFailureCodeAccountFrozen RecipientTransferFailureCode = "account_frozen" - RecipientTransferFailureCodeBankAccountRestricted RecipientTransferFailureCode = "bank_account_restricted" - RecipientTransferFailureCodeBankOwnershipChanged RecipientTransferFailureCode = "bank_ownership_changed" - RecipientTransferFailureCodeDebitNotAuthorized RecipientTransferFailureCode = "debit_not_authorized" - RecipientTransferFailureCodeCouldNotProcess RecipientTransferFailureCode = "could_not_process" - RecipientTransferFailureCodeInsufficientFunds RecipientTransferFailureCode = "insufficient_funds" - RecipientTransferFailureCodeInvalidAccountNumber RecipientTransferFailureCode = "invalid_account_number" - RecipientTransferFailureCodeInvalidCurrency RecipientTransferFailureCode = "invalid_currency" - RecipientTransferFailureCodeNoAccount RecipientTransferFailureCode = "no_account" -) - -// RecipientTransferSourceType is the list of allowed values for the recipient_transfer's source_type field. -type RecipientTransferSourceType string - -// List of values that RecipientTransferSourceType can take. -const ( - RecipientTransferSourceTypeAlipayAccount RecipientTransferSourceType = "alipay_account" - RecipientTransferSourceTypeBankAccount RecipientTransferSourceType = "bank_account" - RecipientTransferSourceTypeBitcoinReceiver RecipientTransferSourceType = "bitcoin_receiver" - RecipientTransferSourceTypeCard RecipientTransferSourceType = "card" -) - -// RecipientTransferStatus is the list of allowed values for the recipient_transfer's status. -type RecipientTransferStatus string - -// List of values that RecipientTransferStatus can take. -const ( - RecipientTransferStatusFailed RecipientTransferStatus = "failed" - RecipientTransferStatusInTransit RecipientTransferStatus = "in_transit" - RecipientTransferStatusPaid RecipientTransferStatus = "paid" - RecipientTransferStatusPending RecipientTransferStatus = "pending" -) - -// RecipientTransferType is the list of allowed values for the recipient_transfer's type. -type RecipientTransferType string - -// List of values that RecipientTransferType can take. -const ( - RecipientTransferTypeBankAccount RecipientTransferType = "bank_account" - RecipientTransferTypeCard RecipientTransferType = "card" -) - -// RecipientTransferMethodType represents the type of recipient_transfer -type RecipientTransferMethodType string - -// List of values that RecipientTransferMethodType can take. -const ( - RecipientTransferMethodInstant RecipientTransferMethodType = "instant" - RecipientTransferMethodStandard RecipientTransferMethodType = "standard" -) - -// RecipientTransferDestination describes the destination of a RecipientTransfer. -// The Type should indicate which object is fleshed out -// For more details see https://stripe.com/docs/api/go#recipient_transfer_object -type RecipientTransferDestination struct { - BankAccount *BankAccount `json:"-"` - Card *Card `json:"-"` - ID string `json:"id"` - Type RecipientTransferDestinationType `json:"object"` -} - -// RecipientTransfer is the resource representing a Stripe recipient_transfer. -// For more details see https://stripe.com/docs/api#recipient_transfers. -type RecipientTransfer struct { - Amount int64 `json:"amount"` - AmountReversed int64 `json:"amount_reversed"` - BalanceTransaction *BalanceTransaction `json:"balance_transaction"` - BankAccount *BankAccount `json:"bank_account"` - Card *Card `json:"card"` - Created int64 `json:"created"` - Currency Currency `json:"currency"` - Date int64 `json:"date"` - Description string `json:"description"` - Destination string `json:"destination"` - FailureCode RecipientTransferFailureCode `json:"failure_code"` - FailureMessage string `json:"failure_message"` - ID string `json:"id"` - Livemode bool `json:"livemode"` - Metadata map[string]string `json:"metadata"` - Method RecipientTransferMethodType `json:"method"` - Recipient *Recipient `json:"recipient"` - Reversals *ReversalList `json:"reversals"` - Reversed bool `json:"reversed"` - SourceTransaction *BalanceTransactionSource `json:"source_transaction"` - SourceType RecipientTransferSourceType `json:"source_type"` - StatementDescriptor string `json:"statement_descriptor"` - Status RecipientTransferStatus `json:"status"` - Type RecipientTransferType `json:"type"` -} - -// UnmarshalJSON handles deserialization of a RecipientTransfer. -// This custom unmarshaling is needed because the resulting -// property may be an id or the full struct if it was expanded. -func (t *RecipientTransfer) UnmarshalJSON(data []byte) error { - if id, ok := ParseID(data); ok { - t.ID = id - return nil - } - - type recipientTransfer RecipientTransfer - var v recipientTransfer - if err := json.Unmarshal(data, &v); err != nil { - return err - } - - *t = RecipientTransfer(v) - return nil -} - -// UnmarshalJSON handles deserialization of a RecipientTransferDestination. -// This custom unmarshaling is needed because the specific -// type of destination it refers to is specified in the JSON -func (d *RecipientTransferDestination) UnmarshalJSON(data []byte) error { - if id, ok := ParseID(data); ok { - d.ID = id - return nil - } - - type recipientTransferDestination RecipientTransferDestination - var v recipientTransferDestination - if err := json.Unmarshal(data, &v); err != nil { - return err - } - - var err error - *d = RecipientTransferDestination(v) - - switch d.Type { - case RecipientTransferDestinationBankAccount: - err = json.Unmarshal(data, &d.BankAccount) - case RecipientTransferDestinationCard: - err = json.Unmarshal(data, &d.Card) - } - - return err -} diff --git a/threedsecure.go b/threedsecure.go deleted file mode 100644 index 684fa414b4..0000000000 --- a/threedsecure.go +++ /dev/null @@ -1,29 +0,0 @@ -package stripe - -// ThreeDSecureStatus represents the possible statuses of a ThreeDSecure object. -type ThreeDSecureStatus string - -// ThreeDSecureParams is the set of parameters that can be used when creating a 3DS object. -type ThreeDSecureParams struct { - Params `form:"*" json:"*" json:"*" json:"*"` - Amount *int64 `form:"amount" json:"amount" json:"amount" json:"amount"` - Card *string `form:"card" json:"card" json:"card" json:"card"` - Currency *string `form:"currency" json:"currency" json:"currency" json:"currency"` - Customer *string `form:"customer" json:"customer" json:"customer" json:"customer"` - ReturnURL *string `form:"return_url" json:"return_url" json:"return_url" json:"return_url"` -} - -// ThreeDSecure is the resource representing a Stripe 3DS object -// For more details see https://stripe.com/docs/api#three_d_secure. -type ThreeDSecure struct { - Amount int64 `json:"amount"` - Authenticated bool `json:"authenticated"` - Card *Card `json:"card"` - Created int64 `json:"created"` - Currency Currency `json:"currency"` - ID string `json:"id"` - Livemode bool `json:"livemode"` - RedirectURL string `json:"redirect_url"` - Status ThreeDSecureStatus `json:"status"` - Supported string `json:"supported"` -}