diff --git a/account.go b/account.go index 4b0fd59c86..87bdc2eef8 100644 --- a/account.go +++ b/account.go @@ -343,32 +343,32 @@ func (ea *ExternalAccount) UnmarshalJSON(b []byte) error { // LegalEntity is the structure for properties related to an account's legal state. type LegalEntity struct { - AdditionalOwners []AdditionalOwner `json:"additional_owners"` - Address AccountAddress `json:"address"` - AddressKana AccountAddress `json:"address_kana"` - AddressKanji AccountAddress `json:"address_kanji"` - BusinessName string `json:"business_name"` - BusinessNameKana string `json:"business_name_kana"` - BusinessNameKanji string `json:"business_name_kanji"` - BusinessTaxIDProvided bool `json:"business_tax_id_provided"` - BusinessVATIDProvided bool `json:"business_vat_id_provided"` - DOB DOB `json:"dob"` - FirstName string `json:"first_name"` - FirstNameKana string `json:"first_name_kana"` - FirstNameKanji string `json:"first_name_kanji"` - Gender string `json:"gender"` - LastName string `json:"last_name"` - LastNameKana string `json:"last_name_kana"` - LastNameKanji string `json:"last_name_kanji"` - MaidenName string `json:"maiden_name"` - PersonalAddress AccountAddress `json:"personal_address"` - PersonalAddressKana AccountAddress `json:"personal_address_kana"` - PersonalAddressKanji AccountAddress `json:"personal_address_kanji"` - PersonalIDNumberProvided bool `json:"personal_id_number_provided"` - PhoneNumber string `json:"phone_number"` - SSNLast4Provided bool `json:"ssn_last_4_provided"` - Type LegalEntityType `json:"type"` - Verification IdentityVerification `json:"verification"` + AdditionalOwners []*AdditionalOwner `json:"additional_owners"` + Address *AccountAddress `json:"address"` + AddressKana *AccountAddress `json:"address_kana"` + AddressKanji *AccountAddress `json:"address_kanji"` + BusinessName string `json:"business_name"` + BusinessNameKana string `json:"business_name_kana"` + BusinessNameKanji string `json:"business_name_kanji"` + BusinessTaxIDProvided bool `json:"business_tax_id_provided"` + BusinessVATIDProvided bool `json:"business_vat_id_provided"` + DOB *DOB `json:"dob"` + FirstName string `json:"first_name"` + FirstNameKana string `json:"first_name_kana"` + FirstNameKanji string `json:"first_name_kanji"` + Gender string `json:"gender"` + LastName string `json:"last_name"` + LastNameKana string `json:"last_name_kana"` + LastNameKanji string `json:"last_name_kanji"` + MaidenName string `json:"maiden_name"` + PersonalAddress *AccountAddress `json:"personal_address"` + PersonalAddressKana *AccountAddress `json:"personal_address_kana"` + PersonalAddressKanji *AccountAddress `json:"personal_address_kanji"` + PersonalIDNumberProvided bool `json:"personal_id_number_provided"` + PhoneNumber string `json:"phone_number"` + SSNLast4Provided bool `json:"ssn_last_4_provided"` + Type LegalEntityType `json:"type"` + Verification *IdentityVerification `json:"verification"` } // Address is the structure for an account address. @@ -394,13 +394,13 @@ type DOB struct { // AdditionalOwner is the structure for an account owner. type AdditionalOwner struct { - Address AccountAddress `json:"address"` - DOB DOB `json:"dob"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - MaidenName string `json:"maiden_name"` - PersonalIDNumberProvided bool `json:"personal_id_number_provided"` - Verification string `json:"verification"` + Address *AccountAddress `json:"address"` + DOB DOB `json:"dob"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + MaidenName string `json:"maiden_name"` + PersonalIDNumberProvided bool `json:"personal_id_number_provided"` + Verification string `json:"verification"` } // IdentityVerification is the structure for an account's verification. diff --git a/balance.go b/balance.go index d0ab108fba..c1839a6696 100644 --- a/balance.go +++ b/balance.go @@ -92,9 +92,9 @@ type BalanceTransactionListParams struct { // Balance is the resource representing your Stripe balance. // For more details see https://stripe.com/docs/api/#balance. type Balance struct { - Available []Amount `json:"available"` - Livemode bool `json:"livemode"` - Pending []Amount `json:"pending"` + Available []*Amount `json:"available"` + Livemode bool `json:"livemode"` + Pending []*Amount `json:"pending"` } // BalanceTransaction is the resource representing the balance transaction. @@ -107,7 +107,7 @@ type BalanceTransaction struct { Description string `json:"description"` ID string `json:"id"` Fee int64 `json:"fee"` - FeeDetails []BalanceTransactionFee `json:"fee_details"` + FeeDetails []*BalanceTransactionFee `json:"fee_details"` Net int64 `json:"net"` Recipient string `json:"recipient"` Source string `json:"source"` diff --git a/charge.go b/charge.go index 3bb9818904..c21d97a20a 100644 --- a/charge.go +++ b/charge.go @@ -174,11 +174,11 @@ type ChargeOutcome struct { // ShippingDetails is the structure containing shipping information. type ShippingDetails struct { - Address Address `json:"address"` - Carrier string `json:"carrier"` - Name string `json:"name"` - Phone string `json:"phone"` - TrackingNumber string `json:"tracking_number"` + Address *Address `json:"address"` + Carrier string `json:"carrier"` + Name string `json:"name"` + Phone string `json:"phone"` + TrackingNumber string `json:"tracking_number"` } var depth int = -1 diff --git a/countryspec.go b/countryspec.go index e099cf6ad8..af048a4082 100644 --- a/countryspec.go +++ b/countryspec.go @@ -13,12 +13,12 @@ type VerificationFieldsList struct { // CountrySpec is the resource representing the rules required for a Stripe account. // For more details see https://stripe.com/docs/api/#country_specs. type CountrySpec struct { - DefaultCurrency Currency `json:"default_currency"` - ID string `json:"id"` - SupportedBankAccountCurrencies map[Currency][]Country `json:"supported_bank_account_currencies"` - SupportedPaymentCurrencies []Currency `json:"supported_payment_currencies"` - SupportedPaymentMethods []string `json:"supported_payment_methods"` - VerificationFields map[LegalEntityType]VerificationFieldsList `json:"verification_fields"` + DefaultCurrency Currency `json:"default_currency"` + ID string `json:"id"` + SupportedBankAccountCurrencies map[Currency][]Country `json:"supported_bank_account_currencies"` + SupportedPaymentCurrencies []Currency `json:"supported_payment_currencies"` + SupportedPaymentMethods []string `json:"supported_payment_methods"` + VerificationFields map[LegalEntityType]*VerificationFieldsList `json:"verification_fields"` } // CountrySpecList is a list of country specs as retrieved from a list endpoint. diff --git a/order.go b/order.go index 8886d46c4b..dfe0236e2e 100644 --- a/order.go +++ b/order.go @@ -70,11 +70,11 @@ type OrderReturnParams struct { } type Shipping struct { - Address Address `json:"address"` - Carrier string `json:"carrier"` - Name string `json:"name"` - Phone string `json:"phone"` - TrackingNumber string `json:"tracking_number"` + Address *Address `json:"address"` + Carrier string `json:"carrier"` + Name string `json:"name"` + Phone string `json:"phone"` + TrackingNumber string `json:"tracking_number"` } type ShippingMethod struct { @@ -99,19 +99,19 @@ type Order struct { AmountReturned int64 `json:"amount_returned"` Application string `json:"application"` ApplicationFee int64 `json:"application_fee"` - Charge Charge `json:"charge"` + Charge *Charge `json:"charge"` Created int64 `json:"created"` Currency Currency `json:"currency"` Customer Customer `json:"customer"` Email string `json:"email"` ID string `json:"id"` - Items []OrderItem `json:"items"` + Items []*OrderItem `json:"items"` Livemode bool `json:"livemode"` Metadata map[string]string `json:"metadata"` Returns *OrderReturnList `json:"returns"` SelectedShippingMethod *string `json:"selected_shipping_method"` - Shipping Shipping `json:"shipping"` - ShippingMethods []ShippingMethod `json:"shipping_methods"` + Shipping *Shipping `json:"shipping"` + ShippingMethods []*ShippingMethod `json:"shipping_methods"` Status string `json:"status"` StatusTransitions StatusTransitions `json:"status_transitions"` Updated int64 `json:"updated"` diff --git a/order_test.go b/order_test.go index f24d8438e8..cd8d1b565b 100644 --- a/order_test.go +++ b/order_test.go @@ -33,7 +33,7 @@ func TestShipping_MarshalJSON(t *testing.T) { Phone: "phone", Carrier: "USPS", TrackingNumber: "tracking.123", - Address: Address{ + Address: &Address{ Line1: "123 Market Street", City: "San Francisco", State: "CA", diff --git a/orderreturn.go b/orderreturn.go index 686651126f..27c3668cfb 100644 --- a/orderreturn.go +++ b/orderreturn.go @@ -3,14 +3,14 @@ package stripe import "encoding/json" type OrderReturn struct { - Amount int64 `json:"amount"` - Created int64 `json:"created"` - Currency Currency `json:"currency"` - ID string `json:"id"` - Items []OrderItem `json:"items"` - Livemode bool `json:"livemode"` - Order Order `json:"order"` - Refund *Refund `json:"refund"` + Amount int64 `json:"amount"` + Created int64 `json:"created"` + Currency Currency `json:"currency"` + ID string `json:"id"` + Items []*OrderItem `json:"items"` + Livemode bool `json:"livemode"` + Order *Order `json:"order"` + Refund *Refund `json:"refund"` } // OrderReturnList is a list of returns as retrieved from a list endpoint. diff --git a/sku.go b/sku.go index b2d1f62018..cfc8abec5c 100644 --- a/sku.go +++ b/sku.go @@ -54,12 +54,12 @@ type SKU struct { Description string `json:"description"` ID string `json:"id"` Image string `json:"image"` - Inventory Inventory `json:"inventory"` + Inventory *Inventory `json:"inventory"` Livemode bool `json:"livemode"` Metadata map[string]string `json:"metadata"` PackageDimensions *PackageDimensions `json:"package_dimensions"` Price int64 `json:"price"` - Product Product `json:"product"` + Product *Product `json:"product"` Updated int64 `json:"updated"` } diff --git a/source.go b/source.go index 8ab2206edb..abd5efb090 100644 --- a/source.go +++ b/source.go @@ -165,10 +165,10 @@ type SourceMandateAcceptance struct { } type SourceMandate struct { - Acceptance SourceMandateAcceptance `json:"acceptance"` - NotificationMethod string `json:"notification_method"` - Reference string `json:"reference"` - URL string `json:"url"` + Acceptance *SourceMandateAcceptance `json:"acceptance"` + NotificationMethod string `json:"notification_method"` + Reference string `json:"reference"` + URL string `json:"url"` } type Source struct { @@ -180,9 +180,9 @@ type Source struct { Flow SourceFlow `json:"flow"` ID string `json:"id"` Livemode bool `json:"livemode"` - Mandate SourceMandate `json:"mandate"` + Mandate *SourceMandate `json:"mandate"` Metadata map[string]string `json:"metadata"` - Owner SourceOwner `json:"owner"` + Owner *SourceOwner `json:"owner"` Receiver *ReceiverFlow `json:"receiver,omitempty"` Redirect *RedirectFlow `json:"redirect,omitempty"` StatementDescriptor string `json:"statement_descriptor"` diff --git a/transfer.go b/transfer.go index 81c6e35891..101d1c3784 100644 --- a/transfer.go +++ b/transfer.go @@ -50,7 +50,7 @@ type Transfer struct { BalanceTransaction *BalanceTransaction `json:"balance_transaction"` Created int64 `json:"created"` Currency Currency `json:"currency"` - Destination TransferDestination `json:"destination"` + Destination *TransferDestination `json:"destination"` DestinationPayment *Charge `json:"destination_payment"` ID string `json:"id"` Livemode bool `json:"livemode"`