From f67b434a68a93d390390b599fef9aacc371bd402 Mon Sep 17 00:00:00 2001 From: Chris Pruitt Date: Wed, 29 Sep 2021 11:59:14 -0700 Subject: [PATCH] - Update fork to match v72 of stripe - Add json field tags for all files --- VERSION | 2 +- account.go | 306 +++++++++++++++--------------- accountlink.go | 12 +- address.go | 22 +-- applepaydomain.go | 8 +- balance.go | 2 +- balancetransaction.go | 20 +- bankaccount.go | 36 ++-- billingportal_configuration.go | 68 +++---- billingportal_session.go | 12 +- bitcoinreceiver.go | 8 +- bitcointransaction.go | 6 +- capability.go | 10 +- card.go | 44 ++--- charge.go | 106 +++++------ checkout_session.go | 246 ++++++++++++------------ countryspec.go | 4 +- coupon.go | 30 +-- creditnote.go | 88 ++++----- customer.go | 76 ++++---- customerbalancetransaction.go | 14 +- discount.go | 2 +- dispute.go | 70 +++---- ephemeralkey.go | 8 +- event.go | 14 +- exchangerate.go | 4 +- fee.go | 10 +- feerefund.go | 10 +- file.go | 16 +- filelink.go | 18 +- form/form_test.go | 104 +++++----- identity_verificationreport.go | 12 +- identity_verificationsession.go | 30 +-- invoice.go | 220 ++++++++++----------- invoiceitem.go | 62 +++--- issuing/cardholder/client_test.go | 14 +- issuing_authorization.go | 20 +- issuing_card.go | 60 +++--- issuing_cardholder.go | 72 +++---- issuing_dispute.go | 106 +++++------ issuing_transaction.go | 14 +- loginlink.go | 6 +- mandate.go | 2 +- oauth.go | 96 +++++----- order.go | 88 ++++----- orderreturn.go | 14 +- params.go | 42 ++-- params_test.go | 16 +- paymentintent.go | 220 ++++++++++----------- paymentmethod.go | 110 +++++------ paymentsource.go | 22 +-- payout.go | 32 ++-- person.go | 102 +++++----- plan.go | 78 ++++---- price.go | 94 ++++----- product.go | 56 +++--- promotioncode.go | 36 ++-- quote.go | 110 +++++------ radar_earlyfraudwarning.go | 8 +- radar_valuelist.go | 18 +- radar_valuelistitem.go | 16 +- recipient.go | 24 +-- refund.go | 24 +-- reporting_reportrun.go | 28 +-- reporting_reporttype.go | 4 +- reversal.go | 14 +- review.go | 10 +- setupattempt.go | 8 +- setupintent.go | 90 ++++----- sigma_scheduledqueryrun.go | 4 +- sku.go | 40 ++-- source.go | 96 +++++----- sourcetransaction.go | 4 +- sub.go | 168 ++++++++-------- subitem.go | 52 ++--- subschedule.go | 150 +++++++-------- taxcode.go | 4 +- taxid.go | 12 +- taxrate.go | 30 +-- terminal_connectiontoken.go | 4 +- terminal_location.go | 8 +- terminal_reader.go | 18 +- threedsecure.go | 12 +- token.go | 32 ++-- topup.go | 26 +-- transfer.go | 26 +-- usagerecord.go | 10 +- usagerecordsummary.go | 4 +- v32_migration_guide.md | 8 +- webhookendpoint.go | 20 +- 90 files changed, 2041 insertions(+), 2041 deletions(-) diff --git a/VERSION b/VERSION index 8e8339caec..8de87d233e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -72.67.0 +72.67.0-omni diff --git a/account.go b/account.go index abd690633c..675cec4213 100644 --- a/account.go +++ b/account.go @@ -171,313 +171,313 @@ const ( // AccountBusinessProfileParams are the parameters allowed for an account's business information type AccountBusinessProfileParams struct { - MCC *string `form:"mcc"` - Name *string `form:"name"` - ProductDescription *string `form:"product_description"` - SupportAddress *AddressParams `form:"support_address"` - SupportEmail *string `form:"support_email"` - SupportPhone *string `form:"support_phone"` - SupportURL *string `form:"support_url"` - URL *string `form:"url"` + MCC *string `form:"mcc" json:"mcc"` + Name *string `form:"name" json:"name"` + ProductDescription *string `form:"product_description" json:"product_description"` + SupportAddress *AddressParams `form:"support_address" json:"support_address"` + SupportEmail *string `form:"support_email" json:"support_email"` + SupportPhone *string `form:"support_phone" json:"support_phone"` + SupportURL *string `form:"support_url" json:"support_url"` + URL *string `form:"url" json:"url"` } // AccountCapabilitiesACSSDebitPaymentsParams represent allowed parameters to configure the ACSS Debit capability on an account. type AccountCapabilitiesACSSDebitPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesAUBECSDebitPaymentsParams represent allowed parameters to configure the AU BECS Debit capability on an account. type AccountCapabilitiesAUBECSDebitPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesBACSDebitPaymentsParams represent allowed parameters to configure the BACS Debit capability on an account. type AccountCapabilitiesBACSDebitPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesBancontactPaymentsParams represent allowed parameters to configure the bancontact payments capability on an account. type AccountCapabilitiesBancontactPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesBoletoPaymentsParams represent allowed parameters to configure the boleto payments capability on an account. type AccountCapabilitiesBoletoPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesCardIssuingParams represent allowed parameters to configure the Issuing capability on an account. type AccountCapabilitiesCardIssuingParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesCardPaymentsParams represent allowed parameters to configure the card payments capability on an account. type AccountCapabilitiesCardPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesCartesBancairesPaymentsParams represent allowed parameters to configure the Cartes Bancaires payments capability on an account. type AccountCapabilitiesCartesBancairesPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesEPSPaymentsParams represent allowed parameters to configure the EPS payments capability on an account. type AccountCapabilitiesEPSPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesFPXPaymentsParams represent allowed parameters to configure the FPX payments capability on an account. type AccountCapabilitiesFPXPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesGiropayPaymentsParams represent allowed parameters to configure the giropay payments capability on an account. type AccountCapabilitiesGiropayPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesGrabpayPaymentsParams represent allowed parameters to configure the grabpay payments capability on an account. type AccountCapabilitiesGrabpayPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesIdealPaymentsParams represent allowed parameters to configure the ideal payments capability on an account. type AccountCapabilitiesIdealPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesJCBPaymentsParams represent allowed parameters to configure the JCB payments capability on an account. type AccountCapabilitiesJCBPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesKlarnaPaymentsParams represent allowed parameters to configure the klarna payments capability on an account. type AccountCapabilitiesKlarnaPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesLegacyPaymentsParams represent allowed parameters to configure the legacy payments capability on an account. type AccountCapabilitiesLegacyPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesOXXOPaymentsParams represent allowed parameters to configure the OXXO capability on an account. type AccountCapabilitiesOXXOPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesP24PaymentsParams represent allowed parameters to configure the P24 payments capability on an account. type AccountCapabilitiesP24PaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesSEPADebitPaymentsParams represent allowed parameters to configure the SEPA Debit payments capability on an account. type AccountCapabilitiesSEPADebitPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesSofortPaymentsParams represent allowed parameters to configure the sofort payments capability on an account. type AccountCapabilitiesSofortPaymentsParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesTaxReportingUS1099KParams represent allowed parameters to configure the 1099-K capability on an account. type AccountCapabilitiesTaxReportingUS1099KParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesTaxReportingUS1099MISCParams represent allowed parameters to configure the 1099-Misc capability on an account. type AccountCapabilitiesTaxReportingUS1099MISCParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesTransfersParams represent allowed parameters to configure the transfers capability on an account. type AccountCapabilitiesTransfersParams struct { - Requested *bool `form:"requested"` + Requested *bool `form:"requested" json:"requested"` } // AccountCapabilitiesParams represent allowed parameters to configure capabilities on an account. type AccountCapabilitiesParams struct { - ACSSDebitPayments *AccountCapabilitiesACSSDebitPaymentsParams `form:"acss_debit_payments"` - AUBECSDebitPayments *AccountCapabilitiesAUBECSDebitPaymentsParams `form:"au_becs_debit_payments"` - BACSDebitPayments *AccountCapabilitiesBACSDebitPaymentsParams `form:"bacs_debit_payments"` - BancontactPayments *AccountCapabilitiesBancontactPaymentsParams `form:"bancontact_payments"` - BoletoPayments *AccountCapabilitiesBoletoPaymentsParams `form:"boleto_payments"` - CardIssuing *AccountCapabilitiesCardIssuingParams `form:"card_issuing"` - CardPayments *AccountCapabilitiesCardPaymentsParams `form:"card_payments"` - CartesBancairesPayments *AccountCapabilitiesCartesBancairesPaymentsParams `form:"cartes_bancaires_payments"` - EPSPayments *AccountCapabilitiesEPSPaymentsParams `form:"eps_payments"` - FPXPayments *AccountCapabilitiesFPXPaymentsParams `form:"fpx_payments"` - GiropayPayments *AccountCapabilitiesGiropayPaymentsParams `form:"giropay_payments"` - GrabpayPayments *AccountCapabilitiesGrabpayPaymentsParams `form:"grabpay_payments"` - IdealPayments *AccountCapabilitiesIdealPaymentsParams `form:"ideal_payments"` - JCBPayments *AccountCapabilitiesJCBPaymentsParams `form:"jcb_payments"` - KlarnaPayments *AccountCapabilitiesKlarnaPaymentsParams `form:"klarna_payments"` - LegacyPayments *AccountCapabilitiesLegacyPaymentsParams `form:"legacy_payments"` - OXXOPayments *AccountCapabilitiesOXXOPaymentsParams `form:"oxxo_payments"` - P24Payments *AccountCapabilitiesP24PaymentsParams `form:"p24_payments"` - SEPADebitPayments *AccountCapabilitiesSEPADebitPaymentsParams `form:"sepa_debit_payments"` - SofortPayments *AccountCapabilitiesSofortPaymentsParams `form:"sofort_payments"` - TaxReportingUS1099K *AccountCapabilitiesTaxReportingUS1099KParams `form:"tax_reporting_us_1099_k"` - TaxReportingUS1099MISC *AccountCapabilitiesTaxReportingUS1099MISCParams `form:"tax_reporting_us_1099_misc"` - Transfers *AccountCapabilitiesTransfersParams `form:"transfers"` + ACSSDebitPayments *AccountCapabilitiesACSSDebitPaymentsParams `form:"acss_debit_payments" json:"acss_debit_payments"` + AUBECSDebitPayments *AccountCapabilitiesAUBECSDebitPaymentsParams `form:"au_becs_debit_payments" json:"au_becs_debit_payments"` + BACSDebitPayments *AccountCapabilitiesBACSDebitPaymentsParams `form:"bacs_debit_payments" json:"bacs_debit_payments"` + BancontactPayments *AccountCapabilitiesBancontactPaymentsParams `form:"bancontact_payments" json:"bancontact_payments"` + BoletoPayments *AccountCapabilitiesBoletoPaymentsParams `form:"boleto_payments" json:"boleto_payments"` + CardIssuing *AccountCapabilitiesCardIssuingParams `form:"card_issuing" json:"card_issuing"` + CardPayments *AccountCapabilitiesCardPaymentsParams `form:"card_payments" json:"card_payments"` + CartesBancairesPayments *AccountCapabilitiesCartesBancairesPaymentsParams `form:"cartes_bancaires_payments" json:"cartes_bancaires_payments"` + EPSPayments *AccountCapabilitiesEPSPaymentsParams `form:"eps_payments" json:"eps_payments"` + FPXPayments *AccountCapabilitiesFPXPaymentsParams `form:"fpx_payments" json:"fpx_payments"` + GiropayPayments *AccountCapabilitiesGiropayPaymentsParams `form:"giropay_payments" json:"giropay_payments"` + GrabpayPayments *AccountCapabilitiesGrabpayPaymentsParams `form:"grabpay_payments" json:"grabpay_payments"` + IdealPayments *AccountCapabilitiesIdealPaymentsParams `form:"ideal_payments" json:"ideal_payments"` + JCBPayments *AccountCapabilitiesJCBPaymentsParams `form:"jcb_payments" json:"jcb_payments"` + KlarnaPayments *AccountCapabilitiesKlarnaPaymentsParams `form:"klarna_payments" json:"klarna_payments"` + LegacyPayments *AccountCapabilitiesLegacyPaymentsParams `form:"legacy_payments" json:"legacy_payments"` + OXXOPayments *AccountCapabilitiesOXXOPaymentsParams `form:"oxxo_payments" json:"oxxo_payments"` + P24Payments *AccountCapabilitiesP24PaymentsParams `form:"p24_payments" json:"p24_payments"` + SEPADebitPayments *AccountCapabilitiesSEPADebitPaymentsParams `form:"sepa_debit_payments" json:"sepa_debit_payments"` + SofortPayments *AccountCapabilitiesSofortPaymentsParams `form:"sofort_payments" json:"sofort_payments"` + TaxReportingUS1099K *AccountCapabilitiesTaxReportingUS1099KParams `form:"tax_reporting_us_1099_k" json:"tax_reporting_us_1099_k"` + TaxReportingUS1099MISC *AccountCapabilitiesTaxReportingUS1099MISCParams `form:"tax_reporting_us_1099_misc" json:"tax_reporting_us_1099_misc"` + Transfers *AccountCapabilitiesTransfersParams `form:"transfers" json:"transfers"` } // AccountCompanyVerificationDocumentParams are the parameters allowed to pass for a document // verifying a company. type AccountCompanyVerificationDocumentParams struct { - Back *string `form:"back"` - Front *string `form:"front"` + Back *string `form:"back" json:"back"` + Front *string `form:"front" json:"front"` } // AccountCompanyVerificationParams are the parameters allowed to verify a company. type AccountCompanyVerificationParams struct { - Document *AccountCompanyVerificationDocumentParams `form:"document"` + Document *AccountCompanyVerificationDocumentParams `form:"document" json:"document"` } // AccountCompanyParams are the parameters describing the company associated with the account. type AccountCompanyParams struct { - Address *AccountAddressParams `form:"address"` - AddressKana *AccountAddressParams `form:"address_kana"` - AddressKanji *AccountAddressParams `form:"address_kanji"` - DirectorsProvided *bool `form:"directors_provided"` - ExecutivesProvided *bool `form:"executives_provided"` - Name *string `form:"name"` - NameKana *string `form:"name_kana"` - NameKanji *string `form:"name_kanji"` - OwnersProvided *bool `form:"owners_provided"` - RegistrationNumber *string `form:"registration_number"` - Structure *string `form:"structure"` - Phone *string `form:"phone"` - TaxID *string `form:"tax_id"` - TaxIDRegistrar *string `form:"tax_id_registrar"` - VATID *string `form:"vat_id"` - Verification *AccountCompanyVerificationParams `form:"verification"` + Address *AccountAddressParams `form:"address" json:"address"` + AddressKana *AccountAddressParams `form:"address_kana" json:"address_kana"` + AddressKanji *AccountAddressParams `form:"address_kanji" json:"address_kanji"` + DirectorsProvided *bool `form:"directors_provided" json:"directors_provided"` + ExecutivesProvided *bool `form:"executives_provided" json:"executives_provided"` + Name *string `form:"name" json:"name"` + NameKana *string `form:"name_kana" json:"name_kana"` + NameKanji *string `form:"name_kanji" json:"name_kanji"` + OwnersProvided *bool `form:"owners_provided" json:"owners_provided"` + RegistrationNumber *string `form:"registration_number" json:"registration_number"` + Structure *string `form:"structure" json:"structure"` + Phone *string `form:"phone" json:"phone"` + TaxID *string `form:"tax_id" json:"tax_id"` + TaxIDRegistrar *string `form:"tax_id_registrar" json:"tax_id_registrar"` + VATID *string `form:"vat_id" json:"vat_id"` + Verification *AccountCompanyVerificationParams `form:"verification" json:"verification"` } // AccountDeclineSettingsParams represents the parameters allowed for configuring // card declines on connected accounts. type AccountDeclineSettingsParams struct { - AVSFailure *bool `form:"avs_failure"` - CVCFailure *bool `form:"cvc_failure"` + AVSFailure *bool `form:"avs_failure" json:"avs_failure"` + CVCFailure *bool `form:"cvc_failure" json:"cvc_failure"` } // AccountDocumentsBankAccountOwnershipVerificationParams represents the // parameters allowed for passing bank account ownership verification documents // on an account. type AccountDocumentsBankAccountOwnershipVerificationParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } // AccountDocumentsCompanyLicenseParams represents the parameters allowed for // passing company license verification documents on an account. type AccountDocumentsCompanyLicenseParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } // AccountDocumentsCompanyMemorandumOfAssociationParams represents the // parameters allowed for passing company memorandum of association documents // on an account. type AccountDocumentsCompanyMemorandumOfAssociationParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } // AccountDocumentsCompanyMinisterialDecreeParams represents the parameters // allowed for passing company ministerial decree documents on an account. type AccountDocumentsCompanyMinisterialDecreeParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } // AccountDocumentsCompanyRegistrationVerificationParams represents the // parameters allowed for passing company registration verification documents. type AccountDocumentsCompanyRegistrationVerificationParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } // AccountDocumentsCompanyTaxIDVerificationParams represents the parameters // allowed for passing company tax id verification documents on an account. type AccountDocumentsCompanyTaxIDVerificationParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } // AccountDocumentsParams represents the parameters allowed for passing additional documents on an account. type AccountDocumentsParams struct { - BankAccountOwnershipVerification *AccountDocumentsBankAccountOwnershipVerificationParams `form:"bank_account_ownership_verification"` - CompanyLicense *AccountDocumentsCompanyLicenseParams `form:"company_license"` - CompanyMemorandumOfAssocation *AccountDocumentsCompanyMemorandumOfAssociationParams `form:"company_memorandum_of_association"` - CompanyMinisterialDecree *AccountDocumentsCompanyMinisterialDecreeParams `form:"company_ministerial_decree"` - CompanyRegistrationVerification *AccountDocumentsCompanyRegistrationVerificationParams `form:"company_registration_verification"` - CompanyTaxIDVerification *AccountDocumentsCompanyTaxIDVerificationParams `form:"company_tax_id_verification"` + BankAccountOwnershipVerification *AccountDocumentsBankAccountOwnershipVerificationParams `form:"bank_account_ownership_verification" json:"bank_account_ownership_verification"` + CompanyLicense *AccountDocumentsCompanyLicenseParams `form:"company_license" json:"company_license"` + CompanyMemorandumOfAssocation *AccountDocumentsCompanyMemorandumOfAssociationParams `form:"company_memorandum_of_association" json:"company_memorandum_of_association"` + CompanyMinisterialDecree *AccountDocumentsCompanyMinisterialDecreeParams `form:"company_ministerial_decree" json:"company_ministerial_decree"` + CompanyRegistrationVerification *AccountDocumentsCompanyRegistrationVerificationParams `form:"company_registration_verification" json:"company_registration_verification"` + CompanyTaxIDVerification *AccountDocumentsCompanyTaxIDVerificationParams `form:"company_tax_id_verification" json:"company_tax_id_verification"` } // AccountSettingsBrandingParams represent allowed parameters to configure settings specific to the // account’s branding. type AccountSettingsBrandingParams struct { - Icon *string `form:"icon"` - Logo *string `form:"logo"` - PrimaryColor *string `form:"primary_color"` - SecondaryColor *string `form:"secondary_color"` + Icon *string `form:"icon" json:"icon"` + Logo *string `form:"logo" json:"logo"` + PrimaryColor *string `form:"primary_color" json:"primary_color"` + SecondaryColor *string `form:"secondary_color" json:"secondary_color"` } // AccountSettingsCardIssuingParams represent allowed parameters relating to the acceptance of the terms of service agreement. type AccountSettingsCardIssuingParams struct { - TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance"` + TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance" json:"tos_acceptance"` } // AccountSettingsBACSDebitPaymentsParams represent allowed parameters to configure settings specific to // BACS Debit charging on the account. type AccountSettingsBACSDebitPaymentsParams struct { - DisplayName *string `form:"display_name"` + DisplayName *string `form:"display_name" json:"display_name"` } // AccountSettingsCardPaymentsParams represent allowed parameters to configure settings specific to // card charging on the account. type AccountSettingsCardPaymentsParams struct { - DeclineOn *AccountDeclineSettingsParams `form:"decline_on"` - StatementDescriptorPrefix *string `form:"statement_descriptor_prefix"` + DeclineOn *AccountDeclineSettingsParams `form:"decline_on" json:"decline_on"` + StatementDescriptorPrefix *string `form:"statement_descriptor_prefix" json:"statement_descriptor_prefix"` } // AccountSettingsDashboardParams represent allowed parameters to configure settings for the // account's Dashboard. type AccountSettingsDashboardParams struct { - DisplayName *string `form:"display_name"` - Timezone *string `form:"timezone"` + DisplayName *string `form:"display_name" json:"display_name"` + Timezone *string `form:"timezone" json:"timezone"` } // AccountSettingsPaymentsParams represent allowed parameters to configure settings across payment // methods for charging on the account. type AccountSettingsPaymentsParams struct { - StatementDescriptor *string `form:"statement_descriptor"` - StatementDescriptorKana *string `form:"statement_descriptor_kana"` - StatementDescriptorKanji *string `form:"statement_descriptor_kanji"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + StatementDescriptorKana *string `form:"statement_descriptor_kana" json:"statement_descriptor_kana"` + StatementDescriptorKanji *string `form:"statement_descriptor_kanji" json:"statement_descriptor_kanji"` } // AccountSettingsPayoutsParams represent allowed parameters to configure settings specific to the // account’s payouts. type AccountSettingsPayoutsParams struct { - DebitNegativeBalances *bool `form:"debit_negative_balances"` - Schedule *PayoutScheduleParams `form:"schedule"` - StatementDescriptor *string `form:"statement_descriptor"` + DebitNegativeBalances *bool `form:"debit_negative_balances" json:"debit_negative_balances"` + Schedule *PayoutScheduleParams `form:"schedule" json:"schedule"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` } // AccountSettingsParams are the parameters allowed for the account's settings. type AccountSettingsParams struct { - BACSDebitPayments *AccountSettingsBACSDebitPaymentsParams `form:"bacs_debit_payments"` - Branding *AccountSettingsBrandingParams `form:"branding"` - CardIssuing *AccountSettingsCardIssuingParams `form:"card_issuing"` - CardPayments *AccountSettingsCardPaymentsParams `form:"card_payments"` - Dashboard *AccountSettingsDashboardParams `form:"dashboard"` - Payments *AccountSettingsPaymentsParams `form:"payments"` - Payouts *AccountSettingsPayoutsParams `form:"payouts"` + BACSDebitPayments *AccountSettingsBACSDebitPaymentsParams `form:"bacs_debit_payments" json:"bacs_debit_payments"` + Branding *AccountSettingsBrandingParams `form:"branding" json:"branding"` + CardIssuing *AccountSettingsCardIssuingParams `form:"card_issuing" json:"card_issuing"` + CardPayments *AccountSettingsCardPaymentsParams `form:"card_payments" json:"card_payments"` + Dashboard *AccountSettingsDashboardParams `form:"dashboard" json:"dashboard"` + Payments *AccountSettingsPaymentsParams `form:"payments" json:"payments"` + Payouts *AccountSettingsPayoutsParams `form:"payouts" json:"payouts"` } // PayoutScheduleParams are the parameters allowed for payout schedules. type PayoutScheduleParams struct { - DelayDays *int64 `form:"delay_days"` - DelayDaysMinimum *bool `form:"-"` // See custom AppendTo - Interval *string `form:"interval"` - MonthlyAnchor *int64 `form:"monthly_anchor"` - WeeklyAnchor *string `form:"weekly_anchor"` + DelayDays *int64 `form:"delay_days" json:"delay_days"` + DelayDaysMinimum *bool `form:"-" json:"-"` // See custom AppendTo + Interval *string `form:"interval" json:"interval"` + MonthlyAnchor *int64 `form:"monthly_anchor" json:"monthly_anchor"` + WeeklyAnchor *string `form:"weekly_anchor" json:"weekly_anchor"` } // AppendTo implements custom encoding logic for PayoutScheduleParams @@ -490,71 +490,71 @@ func (p *PayoutScheduleParams) AppendTo(body *form.Values, keyParts []string) { // AccountParams are the parameters allowed during account creation/updates. type AccountParams struct { - Params `form:"*"` - AccountToken *string `form:"account_token"` - BusinessProfile *AccountBusinessProfileParams `form:"business_profile"` - BusinessType *string `form:"business_type"` - Capabilities *AccountCapabilitiesParams `form:"capabilities"` - Company *AccountCompanyParams `form:"company"` - Country *string `form:"country"` - DefaultCurrency *string `form:"default_currency"` - Documents *AccountDocumentsParams `form:"documents"` - Email *string `form:"email"` - ExternalAccount *AccountExternalAccountParams `form:"external_account"` - Individual *PersonParams `form:"individual"` - Settings *AccountSettingsParams `form:"settings"` - TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance"` - Type *string `form:"type"` + Params `form:"*" json:"*"` + AccountToken *string `form:"account_token" json:"account_token"` + BusinessProfile *AccountBusinessProfileParams `form:"business_profile" json:"business_profile"` + BusinessType *string `form:"business_type" json:"business_type"` + Capabilities *AccountCapabilitiesParams `form:"capabilities" json:"capabilities"` + Company *AccountCompanyParams `form:"company" json:"company"` + Country *string `form:"country" json:"country"` + DefaultCurrency *string `form:"default_currency" json:"default_currency"` + Documents *AccountDocumentsParams `form:"documents" json:"documents"` + Email *string `form:"email" json:"email"` + ExternalAccount *AccountExternalAccountParams `form:"external_account" json:"external_account"` + Individual *PersonParams `form:"individual" json:"individual"` + Settings *AccountSettingsParams `form:"settings" json:"settings"` + TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance" json:"tos_acceptance"` + Type *string `form:"type" json:"type"` // This parameter is deprecated. Prefer using Capabilities instead. - RequestedCapabilities []*string `form:"requested_capabilities"` + RequestedCapabilities []*string `form:"requested_capabilities" json:"requested_capabilities"` } // AccountAddressParams represents an address during account creation/updates. type AccountAddressParams struct { - City *string `form:"city"` - Country *string `form:"country"` - Line1 *string `form:"line1"` - Line2 *string `form:"line2"` - PostalCode *string `form:"postal_code"` - State *string `form:"state"` + City *string `form:"city" json:"city"` + Country *string `form:"country" json:"country"` + Line1 *string `form:"line1" json:"line1"` + Line2 *string `form:"line2" json:"line2"` + PostalCode *string `form:"postal_code" json:"postal_code"` + State *string `form:"state" json:"state"` // Town/cho-me. Note that this is only used for Kana/Kanji representations // of an address. - Town *string `form:"town"` + Town *string `form:"town" json:"town"` } // AccountTOSAcceptanceParams represents tos_acceptance during account creation/updates. type AccountTOSAcceptanceParams struct { - Date *int64 `form:"date"` - IP *string `form:"ip"` - UserAgent *string `form:"user_agent"` - ServiceAgreement *string `form:"service_agreement"` + Date *int64 `form:"date" json:"date"` + IP *string `form:"ip" json:"ip"` + UserAgent *string `form:"user_agent" json:"user_agent"` + ServiceAgreement *string `form:"service_agreement" json:"service_agreement"` } // AccountListParams are the parameters allowed during account listing. type AccountListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` } // AccountRejectParams is the structure for the Reject function. type AccountRejectParams struct { - Params `form:"*"` - Reason *string `form:"reason"` + Params `form:"*" json:"*"` + Reason *string `form:"reason" json:"reason"` } // AccountExternalAccountParams are the parameters allowed to reference an // external account when creating an account. It should either have Token set // or everything else. type AccountExternalAccountParams struct { - Params `form:"*"` - AccountNumber *string `form:"account_number"` - AccountHolderName *string `form:"account_holder_name"` - AccountHolderType *string `form:"account_holder_type"` - Country *string `form:"country"` - Currency *string `form:"currency"` - RoutingNumber *string `form:"routing_number"` - Token *string `form:"token"` + Params `form:"*" json:"*"` + AccountNumber *string `form:"account_number" json:"account_number"` + AccountHolderName *string `form:"account_holder_name" json:"account_holder_name"` + AccountHolderType *string `form:"account_holder_type" json:"account_holder_type"` + Country *string `form:"country" json:"country"` + Currency *string `form:"currency" json:"currency"` + RoutingNumber *string `form:"routing_number" json:"routing_number"` + Token *string `form:"token" json:"token"` } // AppendTo implements custom encoding logic for AccountExternalAccountParams diff --git a/accountlink.go b/accountlink.go index 5bf7812db2..c6c2ec0c22 100644 --- a/accountlink.go +++ b/accountlink.go @@ -26,12 +26,12 @@ const ( // AccountLinkParams are the parameters allowed during an account link creation. type AccountLinkParams struct { - Params `form:"*"` - Account *string `form:"account"` - Collect *string `form:"collect"` - RefreshURL *string `form:"refresh_url"` - ReturnURL *string `form:"return_url"` - Type *string `form:"type"` + Params `form:"*" json:"*"` + Account *string `form:"account" json:"account"` + Collect *string `form:"collect" json:"collect"` + RefreshURL *string `form:"refresh_url" json:"refresh_url"` + ReturnURL *string `form:"return_url" json:"return_url"` + Type *string `form:"type" json:"type"` } // AccountLink is the resource representing an account link. diff --git a/address.go b/address.go index bf28c7b8a8..3918770125 100644 --- a/address.go +++ b/address.go @@ -2,12 +2,12 @@ package stripe // AddressParams describes the common parameters for an Address. type AddressParams struct { - City *string `form:"city" json:"city"` - Country *string `form:"country" json:"country"` - Line1 *string `form:"line1" json:"line1"` - Line2 *string `form:"line2" json:"line2"` - PostalCode *string `form:"postal_code" json:"postal_code"` - State *string `form:"state" json:"state"` + City *string `form:"city" json:"city" json:"city" json:"city"` + Country *string `form:"country" json:"country" json:"country" json:"country"` + Line1 *string `form:"line1" json:"line1" json:"line1" json:"line1"` + Line2 *string `form:"line2" json:"line2" json:"line2" json:"line2"` + PostalCode *string `form:"postal_code" json:"postal_code" json:"postal_code" json:"postal_code"` + State *string `form:"state" json:"state" json:"state" json:"state"` } // Address describes common properties for an Address hash. @@ -22,11 +22,11 @@ type Address struct { // ShippingDetailsParams is the structure containing shipping information as parameters type ShippingDetailsParams struct { - Address *AddressParams `form:"address"` - Carrier *string `form:"carrier"` - Name *string `form:"name"` - Phone *string `form:"phone"` - TrackingNumber *string `form:"tracking_number"` + Address *AddressParams `form:"address" json:"address"` + Carrier *string `form:"carrier" json:"carrier"` + Name *string `form:"name" json:"name"` + Phone *string `form:"phone" json:"phone"` + TrackingNumber *string `form:"tracking_number" json:"tracking_number"` } // ShippingDetails is the structure containing shipping information. diff --git a/applepaydomain.go b/applepaydomain.go index 19e6036f80..bc79838cfa 100644 --- a/applepaydomain.go +++ b/applepaydomain.go @@ -8,14 +8,14 @@ package stripe // ApplePayDomainParams is the set of parameters that can be used when creating an ApplePayDomain object. type ApplePayDomainParams struct { - Params `form:"*"` - DomainName *string `form:"domain_name"` + Params `form:"*" json:"*"` + DomainName *string `form:"domain_name" json:"domain_name"` } // ApplePayDomainListParams are the parameters allowed during ApplePayDomain listing. type ApplePayDomainListParams struct { - ListParams `form:"*"` - DomainName *string `form:"domain_name"` + ListParams `form:"*" json:"*"` + DomainName *string `form:"domain_name" json:"domain_name"` } // ApplePayDomain is the resource representing a Stripe ApplePayDomain object diff --git a/balance.go b/balance.go index ed8c1fda00..1ed348233c 100644 --- a/balance.go +++ b/balance.go @@ -16,7 +16,7 @@ type BalanceTransactionStatus string // BalanceParams is the set of parameters that can be used when retrieving a balance. // For more details see https://stripe.com/docs/api#balance. type BalanceParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // Amount is a structure wrapping an amount value and its currency. diff --git a/balancetransaction.go b/balancetransaction.go index f9ed1d8901..82a27605cb 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -108,21 +108,21 @@ const ( // BalanceTransactionParams is the set of parameters that can be used when retrieving a transaction. // For more details see https://stripe.com/docs/api#retrieve_balance_transaction. type BalanceTransactionParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // BalanceTransactionListParams is the set of parameters that can be used when listing balance transactions. // For more details see https://stripe.com/docs/api/#balance_history. type BalanceTransactionListParams struct { - ListParams `form:"*"` - AvailableOn *int64 `form:"available_on"` - AvailableOnRange *RangeQueryParams `form:"available_on"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Currency *string `form:"currency"` - Payout *string `form:"payout"` - Source *string `form:"source"` - Type *string `form:"type"` + ListParams `form:"*" json:"*"` + AvailableOn *int64 `form:"available_on" json:"available_on"` + AvailableOnRange *RangeQueryParams `form:"available_on" json:"available_on"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Currency *string `form:"currency" json:"currency"` + Payout *string `form:"payout" json:"payout"` + Source *string `form:"source" json:"source"` + Type *string `form:"type" json:"type"` } // BalanceTransactionSource describes the source of a balance Transaction. diff --git a/bankaccount.go b/bankaccount.go index 3fcb48d69a..1ef9a58e3e 100644 --- a/bankaccount.go +++ b/bankaccount.go @@ -44,28 +44,28 @@ const ( // some unusual logic on creates that necessitates manual handling of all // parameters. See AppendToAsSourceOrExternalAccount. type BankAccountParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` // Account is the identifier of the parent account under which bank // accounts are nested. - Account *string `form:"-"` - - AccountHolderName *string `form:"account_holder_name"` - AccountHolderType *string `form:"account_holder_type"` - AccountType *string `form:"account_type"` - AccountNumber *string `form:"account_number"` - Country *string `form:"country"` - Currency *string `form:"currency"` - Customer *string `form:"-"` - DefaultForCurrency *bool `form:"default_for_currency"` - RoutingNumber *string `form:"routing_number"` + Account *string `form:"-" json:"-"` + + AccountHolderName *string `form:"account_holder_name" json:"account_holder_name"` + AccountHolderType *string `form:"account_holder_type" json:"account_holder_type"` + AccountType *string `form:"account_type" json:"account_type"` + AccountNumber *string `form:"account_number" json:"account_number"` + Country *string `form:"country" json:"country"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"-" json:"-"` + DefaultForCurrency *bool `form:"default_for_currency" json:"default_for_currency"` + RoutingNumber *string `form:"routing_number" json:"routing_number"` // Token is a token referencing an external account like one returned from // Stripe.js. - Token *string `form:"-"` + Token *string `form:"-" json:"-"` // ID is used when tokenizing a bank account for shared customers - ID *string `form:"*"` + ID *string `form:"*" json:"*"` } // AppendToAsSourceOrExternalAccount appends the given BankAccountParams as @@ -131,15 +131,15 @@ func (a *BankAccountParams) AppendToAsSourceOrExternalAccount(body *form.Values) // BankAccountListParams is the set of parameters that can be used when listing bank accounts. type BankAccountListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` // The identifier of the parent account under which the bank accounts are // nested. Either Account or Customer should be populated. - Account *string `form:"-"` + Account *string `form:"-" json:"-"` // The identifier of the parent customer under which the bank accounts are // nested. Either Account or Customer should be populated. - Customer *string `form:"-"` + Customer *string `form:"-" json:"-"` } // AppendTo implements custom encoding logic for BankAccountListParams @@ -155,7 +155,7 @@ type BankAccount struct { Account *Account `json:"account"` AccountHolderName string `json:"account_holder_name"` AccountHolderType BankAccountAccountHolderType `json:"account_holder_type"` - AccountType *string `form:"account_type"` + AccountType *string `form:"account_type" json:"account_type"` AvailablePayoutMethods []BankAccountAvailablePayoutMethod `json:"available_payout_methods"` BankName string `json:"bank_name"` Country string `json:"country"` diff --git a/billingportal_configuration.go b/billingportal_configuration.go index 455f9efc9d..a369819089 100644 --- a/billingportal_configuration.go +++ b/billingportal_configuration.go @@ -82,94 +82,94 @@ const ( // BillingPortalConfigurationListParams is the set of parameters that can be // used when listing portal configurations. type BillingPortalConfigurationListParams struct { - ListParams `form:"*"` - Active *bool `form:"active"` - IsDefault *bool `form:"is_default"` + ListParams `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + IsDefault *bool `form:"is_default" json:"is_default"` } // BillingPortalConfigurationBusinessProfileParams lets you pass the business // profile details associated with a portal configuration. type BillingPortalConfigurationBusinessProfileParams struct { - Headline *string `form:"headline"` - PrivacyPolicyURL *string `form:"privacy_policy_url"` - TermsOfServiceURL *string `form:"terms_of_service_url"` + Headline *string `form:"headline" json:"headline"` + PrivacyPolicyURL *string `form:"privacy_policy_url" json:"privacy_policy_url"` + TermsOfServiceURL *string `form:"terms_of_service_url" json:"terms_of_service_url"` } // BillingPortalConfigurationFeaturesCustomerUpdateParams lets you pass the // customer update details on a portal configuration. type BillingPortalConfigurationFeaturesCustomerUpdateParams struct { - AllowedUpdates []*string `form:"allowed_updates"` - Enabled *bool `form:"enabled"` + AllowedUpdates []*string `form:"allowed_updates" json:"allowed_updates"` + Enabled *bool `form:"enabled" json:"enabled"` } // BillingPortalConfigurationFeaturesInvoiceHistoryParams lets you pass the // invoice history details on a portal configuration. type BillingPortalConfigurationFeaturesInvoiceHistoryParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // BillingPortalConfigurationFeaturesPaymentMethodUpdateParams lets you pass // the payment method update details on a portal configuration. type BillingPortalConfigurationFeaturesPaymentMethodUpdateParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer type BillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonParams struct { - Enabled *bool `form:"enabled"` - Options []*string `form:"options"` + Enabled *bool `form:"enabled" json:"enabled"` + Options []*string `form:"options" json:"options"` } // BillingPortalConfigurationFeaturesSubscriptionCancelParams lets you pass the // subscription cancel deetails on a portal configuration. type BillingPortalConfigurationFeaturesSubscriptionCancelParams struct { - CancellationReason *BillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonParams `form:"cancellation_reason"` - Enabled *bool `form:"enabled"` - Mode *string `form:"mode"` - ProrationBehavior *string `form:"proration_behavior"` + CancellationReason *BillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonParams `form:"cancellation_reason" json:"cancellation_reason"` + Enabled *bool `form:"enabled" json:"enabled"` + Mode *string `form:"mode" json:"mode"` + ProrationBehavior *string `form:"proration_behavior" json:"proration_behavior"` } // BillingPortalConfigurationFeaturesSubscriptionPauseParams lets you pass details on the // subscription pause on a portal configuration. type BillingPortalConfigurationFeaturesSubscriptionPauseParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // BillingPortalConfigurationFeaturesSubscriptionUpdateProductParams lets you // pass product details on the subscription update on a portal configuration. type BillingPortalConfigurationFeaturesSubscriptionUpdateProductParams struct { - Prices []*string `form:"prices"` - Product *string `form:"product"` + Prices []*string `form:"prices" json:"prices"` + Product *string `form:"product" json:"product"` } // BillingPortalConfigurationFeaturesSubscriptionUpdateParams lets you pass // subscription update details on a portal configuration. type BillingPortalConfigurationFeaturesSubscriptionUpdateParams struct { - DefaultAllowedUpdates []*string `form:"default_allowed_updates"` - Enabled *bool `form:"enabled"` - Products []*BillingPortalConfigurationFeaturesSubscriptionUpdateProductParams `form:"products"` - ProrationBehavior *string `form:"proration_behavior"` + DefaultAllowedUpdates []*string `form:"default_allowed_updates" json:"default_allowed_updates"` + Enabled *bool `form:"enabled" json:"enabled"` + Products []*BillingPortalConfigurationFeaturesSubscriptionUpdateProductParams `form:"products" json:"products"` + ProrationBehavior *string `form:"proration_behavior" json:"proration_behavior"` } // BillingPortalConfigurationFeaturesParams lets you pass details about the // features available in the portal. type BillingPortalConfigurationFeaturesParams struct { - CustomerUpdate *BillingPortalConfigurationFeaturesCustomerUpdateParams `form:"customer_update"` - InvoiceHistory *BillingPortalConfigurationFeaturesInvoiceHistoryParams `form:"invoice_history"` - PaymentMethodUpdate *BillingPortalConfigurationFeaturesPaymentMethodUpdateParams `form:"payment_method_update"` - SubscriptionCancel *BillingPortalConfigurationFeaturesSubscriptionCancelParams `form:"subscription_cancel"` - SubscriptionPause *BillingPortalConfigurationFeaturesSubscriptionPauseParams `form:"subscription_pause"` - SubscriptionUpdate *BillingPortalConfigurationFeaturesSubscriptionUpdateParams `form:"subscription_update"` + CustomerUpdate *BillingPortalConfigurationFeaturesCustomerUpdateParams `form:"customer_update" json:"customer_update"` + InvoiceHistory *BillingPortalConfigurationFeaturesInvoiceHistoryParams `form:"invoice_history" json:"invoice_history"` + PaymentMethodUpdate *BillingPortalConfigurationFeaturesPaymentMethodUpdateParams `form:"payment_method_update" json:"payment_method_update"` + SubscriptionCancel *BillingPortalConfigurationFeaturesSubscriptionCancelParams `form:"subscription_cancel" json:"subscription_cancel"` + SubscriptionPause *BillingPortalConfigurationFeaturesSubscriptionPauseParams `form:"subscription_pause" json:"subscription_pause"` + SubscriptionUpdate *BillingPortalConfigurationFeaturesSubscriptionUpdateParams `form:"subscription_update" json:"subscription_update"` } // BillingPortalConfigurationParams is the set of parameters that can be passed // when creating or updating a portal configuration. type BillingPortalConfigurationParams struct { - Params `form:"*"` - Active *bool `form:"active"` - BusinessProfile *BillingPortalConfigurationBusinessProfileParams `form:"business_profile"` - DefaultReturnURL *string `form:"default_return_url"` - Features *BillingPortalConfigurationFeaturesParams `form:"features"` + Params `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + BusinessProfile *BillingPortalConfigurationBusinessProfileParams `form:"business_profile" json:"business_profile"` + DefaultReturnURL *string `form:"default_return_url" json:"default_return_url"` + Features *BillingPortalConfigurationFeaturesParams `form:"features" json:"features"` } // BillingPortalConfiguration is a configuration that describes the diff --git a/billingportal_session.go b/billingportal_session.go index 892a876c2d..3ace635bc3 100644 --- a/billingportal_session.go +++ b/billingportal_session.go @@ -10,12 +10,12 @@ import "encoding/json" // BillingPortalSessionParams is the set of parameters that can be used when creating a billing portal session. type BillingPortalSessionParams struct { - Params `form:"*"` - Configuration *string `form:"configuration"` - Customer *string `form:"customer"` - Locale *string `form:"locale"` - OnBehalfOf *string `form:"on_behalf_of"` - ReturnURL *string `form:"return_url"` + Params `form:"*" json:"*"` + Configuration *string `form:"configuration" json:"configuration"` + Customer *string `form:"customer" json:"customer"` + Locale *string `form:"locale" json:"locale"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + ReturnURL *string `form:"return_url" json:"return_url"` } // BillingPortalSession is the resource representing a billing portal session. diff --git a/bitcoinreceiver.go b/bitcoinreceiver.go index 0c6afdd02b..142189b96d 100644 --- a/bitcoinreceiver.go +++ b/bitcoinreceiver.go @@ -7,10 +7,10 @@ import ( // 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:"*"` - Active *bool `form:"active" json:"active"` - Filled *bool `form:"filled" json:"filled"` - UncapturedFunds *bool `form:"uncaptured_funds" json:"uncaptured_funds"` + 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. diff --git a/bitcointransaction.go b/bitcointransaction.go index 7e88e5795d..dadcdf5eb4 100644 --- a/bitcointransaction.go +++ b/bitcointransaction.go @@ -4,9 +4,9 @@ import "encoding/json" // BitcoinTransactionListParams is the set of parameters that can be used when listing BitcoinTransactions. type BitcoinTransactionListParams struct { - ListParams `form:"*" json:"*"` - Customer *string `form:"customer" json:"customer"` - Receiver *string `form:"-" json:"-"` // Sent in with the URL + 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. diff --git a/capability.go b/capability.go index 6b1be3a3d5..8be0430cf7 100644 --- a/capability.go +++ b/capability.go @@ -29,16 +29,16 @@ const ( // CapabilityParams is the set of parameters that can be used when updating a capability. // For more details see https://stripe.com/docs/api/capabilities/update type CapabilityParams struct { - Params `form:"*" json:"*"` - Account *string `form:"-" json:"-"` // Included in URL - Requested *bool `form:"requested" json:"requested"` + Params `form:"*" json:"*" json:"*" json:"*"` + Account *string `form:"-" json:"-" json:"-" json:"-"` // Included in URL + Requested *bool `form:"requested" json:"requested" json:"requested" json:"requested"` } // CapabilityListParams is the set of parameters that can be used when listing capabilities. // For more detail see https://stripe.com/docs/api/capabilities/list type CapabilityListParams struct { - ListParams `form:"*" json:"*"` - Account *string `form:"-" json:"-"` // Included in URL + ListParams `form:"*" json:"*" json:"*" json:"*"` + Account *string `form:"-" json:"-" json:"-" json:"-"` // Included in URL } // Fields that are due and can be satisfied by providing the corresponding alternative fields instead. diff --git a/card.go b/card.go index 7c044a528b..272f1b2e0d 100644 --- a/card.go +++ b/card.go @@ -73,27 +73,27 @@ const cardSource = "source" // cards have some unusual logic on creates that necessitates manual handling // of all parameters. See AppendToAsCardSourceOrExternalAccount. type CardParams struct { - Params `form:"*"` - Account *string `form:"-"` - AccountType *string `form:"account_type"` - AddressCity *string `form:"address_city"` - AddressCountry *string `form:"address_country"` - AddressLine1 *string `form:"address_line1"` - AddressLine2 *string `form:"address_line2"` - AddressState *string `form:"address_state"` - AddressZip *string `form:"address_zip"` - CVC *string `form:"cvc"` - Currency *string `form:"currency"` - Customer *string `form:"-"` - DefaultForCurrency *bool `form:"default_for_currency"` - ExpMonth *string `form:"exp_month"` - ExpYear *string `form:"exp_year"` - Name *string `form:"name"` - Number *string `form:"number"` - Token *string `form:"-"` + Params `form:"*" json:"*"` + Account *string `form:"-" json:"-"` + AccountType *string `form:"account_type" json:"account_type"` + AddressCity *string `form:"address_city" json:"address_city"` + AddressCountry *string `form:"address_country" json:"address_country"` + AddressLine1 *string `form:"address_line1" json:"address_line1"` + AddressLine2 *string `form:"address_line2" json:"address_line2"` + AddressState *string `form:"address_state" json:"address_state"` + AddressZip *string `form:"address_zip" json:"address_zip"` + CVC *string `form:"cvc" json:"cvc"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"-" json:"-"` + DefaultForCurrency *bool `form:"default_for_currency" json:"default_for_currency"` + ExpMonth *string `form:"exp_month" json:"exp_month"` + ExpYear *string `form:"exp_year" json:"exp_year"` + Name *string `form:"name" json:"name"` + Number *string `form:"number" json:"number"` + Token *string `form:"-" json:"-"` // ID is used when tokenizing a card for shared customers - ID string `form:"*"` + ID string `form:"*" json:"*"` } // AppendToAsCardSourceOrExternalAccount appends the given CardParams as either a @@ -179,9 +179,9 @@ func (c *CardParams) AppendToAsCardSourceOrExternalAccount(body *form.Values, ke // CardListParams is the set of parameters that can be used when listing cards. // For more details see https://stripe.com/docs/api#list_cards. type CardListParams struct { - ListParams `form:"*"` - Account *string `form:"-"` - Customer *string `form:"-"` + ListParams `form:"*" json:"*"` + Account *string `form:"-" json:"-"` + Customer *string `form:"-" json:"-"` } // AppendTo implements custom encoding logic for CardListParams diff --git a/charge.go b/charge.go index bd97abc991..f81c778ebe 100644 --- a/charge.go +++ b/charge.go @@ -105,53 +105,53 @@ const ( // ChargeLevel3LineItemsParams is the set of parameters that represent a line item on level III data. type ChargeLevel3LineItemsParams struct { - DiscountAmount *int64 `form:"discount_amount"` - ProductCode *string `form:"product_code"` - ProductDescription *string `form:"product_description"` - Quantity *int64 `form:"quantity"` - TaxAmount *int64 `form:"tax_amount"` - UnitCost *int64 `form:"unit_cost"` + DiscountAmount *int64 `form:"discount_amount" json:"discount_amount"` + ProductCode *string `form:"product_code" json:"product_code"` + ProductDescription *string `form:"product_description" json:"product_description"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxAmount *int64 `form:"tax_amount" json:"tax_amount"` + UnitCost *int64 `form:"unit_cost" json:"unit_cost"` } // ChargeLevel3Params is the set of parameters that can be used for the Level III data. type ChargeLevel3Params struct { - CustomerReference *string `form:"customer_reference"` - LineItems []*ChargeLevel3LineItemsParams `form:"line_items"` - MerchantReference *string `form:"merchant_reference"` - ShippingAddressZip *string `form:"shipping_address_zip"` - ShippingAmount *int64 `form:"shipping_amount"` - ShippingFromZip *string `form:"shipping_from_zip"` + CustomerReference *string `form:"customer_reference" json:"customer_reference"` + LineItems []*ChargeLevel3LineItemsParams `form:"line_items" json:"line_items"` + MerchantReference *string `form:"merchant_reference" json:"merchant_reference"` + ShippingAddressZip *string `form:"shipping_address_zip" json:"shipping_address_zip"` + ShippingAmount *int64 `form:"shipping_amount" json:"shipping_amount"` + ShippingFromZip *string `form:"shipping_from_zip" json:"shipping_from_zip"` } // ChargeTransferDataParams is the set of parameters allowed for the transfer_data hash. type ChargeTransferDataParams struct { - Amount *int64 `form:"amount"` + Amount *int64 `form:"amount" json:"amount"` // This parameter can only be used on Charge creation. - Destination *string `form:"destination"` + Destination *string `form:"destination" json:"destination"` } // ChargeParams is the set of parameters that can be used when creating or updating a charge. type ChargeParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - ApplicationFee *int64 `form:"application_fee"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - Capture *bool `form:"capture"` - Currency *string `form:"currency"` - Customer *string `form:"customer"` - Description *string `form:"description"` - Destination *DestinationParams `form:"destination"` - ExchangeRate *float64 `form:"exchange_rate"` - FraudDetails *FraudDetailsParams `form:"fraud_details"` - Level3 *ChargeLevel3Params `form:"level3"` - OnBehalfOf *string `form:"on_behalf_of"` - ReceiptEmail *string `form:"receipt_email"` - Shipping *ShippingDetailsParams `form:"shipping"` - Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" - StatementDescriptor *string `form:"statement_descriptor"` - StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` - TransferData *ChargeTransferDataParams `form:"transfer_data"` - TransferGroup *string `form:"transfer_group"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + ApplicationFee *int64 `form:"application_fee" json:"application_fee"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + Capture *bool `form:"capture" json:"capture"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"customer" json:"customer"` + Description *string `form:"description" json:"description"` + Destination *DestinationParams `form:"destination" json:"destination"` + ExchangeRate *float64 `form:"exchange_rate" json:"exchange_rate"` + FraudDetails *FraudDetailsParams `form:"fraud_details" json:"fraud_details"` + Level3 *ChargeLevel3Params `form:"level3" json:"level3"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + ReceiptEmail *string `form:"receipt_email" json:"receipt_email"` + Shipping *ShippingDetailsParams `form:"shipping" json:"shipping"` + Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + StatementDescriptorSuffix *string `form:"statement_descriptor_suffix" json:"statement_descriptor_suffix"` + TransferData *ChargeTransferDataParams `form:"transfer_data" json:"transfer_data"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // SetSource adds valid sources to a ChargeParams object, @@ -164,37 +164,37 @@ func (p *ChargeParams) SetSource(sp interface{}) error { // DestinationParams describes the parameters available for the destination hash when creating a charge. type DestinationParams struct { - Account *string `form:"account"` - Amount *int64 `form:"amount"` + Account *string `form:"account" json:"account"` + Amount *int64 `form:"amount" json:"amount"` } // FraudDetailsParams provides information on the fraud details for a charge. type FraudDetailsParams struct { - UserReport *string `form:"user_report"` + UserReport *string `form:"user_report" json:"user_report"` } // ChargeListParams is the set of parameters that can be used when listing charges. type ChargeListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` - PaymentIntent *string `form:"payment_intent"` - TransferGroup *string `form:"transfer_group"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer *string `form:"customer" json:"customer"` + PaymentIntent *string `form:"payment_intent" json:"payment_intent"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // CaptureParams is the set of parameters that can be used when capturing a charge. type CaptureParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - ApplicationFee *int64 `form:"application_fee"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - ExchangeRate *float64 `form:"exchange_rate"` - ReceiptEmail *string `form:"receipt_email"` - StatementDescriptor *string `form:"statement_descriptor"` - StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` - TransferData *ChargeTransferDataParams `form:"transfer_data"` - TransferGroup *string `form:"transfer_group"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + ApplicationFee *int64 `form:"application_fee" json:"application_fee"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + ExchangeRate *float64 `form:"exchange_rate" json:"exchange_rate"` + ReceiptEmail *string `form:"receipt_email" json:"receipt_email"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + StatementDescriptorSuffix *string `form:"statement_descriptor_suffix" json:"statement_descriptor_suffix"` + TransferData *ChargeTransferDataParams `form:"transfer_data" json:"transfer_data"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // ChargeLevel3LineItem represents a line item on level III data. diff --git a/checkout_session.go b/checkout_session.go index 9e122a841d..7b5ff89bf6 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -177,254 +177,254 @@ const ( // CheckoutSessionLineItemAdjustableQuantityParams represents the parameters for // an adjustable quantity on a checkout session's line items. type CheckoutSessionLineItemAdjustableQuantityParams struct { - Enabled *bool `form:"enabled"` - Maximum *int64 `form:"maximum"` - Minimum *int64 `form:"minimum"` + Enabled *bool `form:"enabled" json:"enabled"` + Maximum *int64 `form:"maximum" json:"maximum"` + Minimum *int64 `form:"minimum" json:"minimum"` } // CheckoutSessionLineItemPriceDataProductDataParams is the set of parameters that can be used when // creating a product created inline for a line item. type CheckoutSessionLineItemPriceDataProductDataParams struct { - Description *string `form:"description"` - Images []*string `form:"images"` - Metadata map[string]string `form:"metadata"` - Name *string `form:"name"` - TaxCode *string `form:"tax_code"` + Description *string `form:"description" json:"description"` + Images []*string `form:"images" json:"images"` + Metadata map[string]string `form:"metadata" json:"metadata"` + Name *string `form:"name" json:"name"` + TaxCode *string `form:"tax_code" json:"tax_code"` } // CheckoutSessionLineItemPriceDataRecurringParams is the set of parameters for the recurring // components of a price created inline for a line item. type CheckoutSessionLineItemPriceDataRecurringParams struct { - AggregateUsage *string `form:"aggregate_usage"` - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` - TrialPeriodDays *int64 `form:"trial_period_days"` - UsageType *string `form:"usage_type"` + AggregateUsage *string `form:"aggregate_usage" json:"aggregate_usage"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` + UsageType *string `form:"usage_type" json:"usage_type"` } // CheckoutSessionLineItemPriceDataParams is a structure representing the parameters to create // an inline price for a line item. type CheckoutSessionLineItemPriceDataParams struct { - Currency *string `form:"currency"` - Product *string `form:"product"` - ProductData *CheckoutSessionLineItemPriceDataProductDataParams `form:"product_data"` - Recurring *CheckoutSessionLineItemPriceDataRecurringParams `form:"recurring"` - TaxBehavior *string `form:"tax_behavior"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Currency *string `form:"currency" json:"currency"` + Product *string `form:"product" json:"product"` + ProductData *CheckoutSessionLineItemPriceDataProductDataParams `form:"product_data" json:"product_data"` + Recurring *CheckoutSessionLineItemPriceDataRecurringParams `form:"recurring" json:"recurring"` + TaxBehavior *string `form:"tax_behavior" json:"tax_behavior"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // Configure a Checkout Session that can be used to recover an expired session. type CheckoutSessionAfterExpirationRecoveryParams struct { - AllowPromotionCodes *bool `form:"allow_promotion_codes"` - Enabled *bool `form:"enabled"` + AllowPromotionCodes *bool `form:"allow_promotion_codes" json:"allow_promotion_codes"` + Enabled *bool `form:"enabled" json:"enabled"` } // Configure actions after a Checkout Session has expired. type CheckoutSessionAfterExpirationParams struct { - Recovery *CheckoutSessionAfterExpirationRecoveryParams `form:"recovery"` + Recovery *CheckoutSessionAfterExpirationRecoveryParams `form:"recovery" json:"recovery"` } // Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. type CheckoutSessionAutomaticTaxParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // Configure fields for the Checkout Session to gather active consent from customers. type CheckoutSessionConsentCollectionParams struct { - Promotions *string `form:"promotions"` + Promotions *string `form:"promotions" json:"promotions"` } // Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. type CheckoutSessionCustomerUpdateParams struct { - Address *string `form:"address"` - Name *string `form:"name"` - Shipping *string `form:"shipping"` + Address *string `form:"address" json:"address"` + Name *string `form:"name" json:"name"` + Shipping *string `form:"shipping" json:"shipping"` } // CheckoutSessionDiscountParams is the set of parameters allowed for discounts on // a checkout session. type CheckoutSessionDiscountParams struct { - Coupon *string `form:"coupon"` - PromotionCode *string `form:"promotion_code"` + Coupon *string `form:"coupon" json:"coupon"` + PromotionCode *string `form:"promotion_code" json:"promotion_code"` } // CheckoutSessionLineItemParams is the set of parameters allowed for a line item // on a checkout session. type CheckoutSessionLineItemParams struct { - AdjustableQuantity *CheckoutSessionLineItemAdjustableQuantityParams `form:"adjustable_quantity"` - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - DynamicTaxRates []*string `form:"dynamic_tax_rates"` - Images []*string `form:"images"` - Name *string `form:"name"` - Price *string `form:"price"` - PriceData *CheckoutSessionLineItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + AdjustableQuantity *CheckoutSessionLineItemAdjustableQuantityParams `form:"adjustable_quantity" json:"adjustable_quantity"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + DynamicTaxRates []*string `form:"dynamic_tax_rates" json:"dynamic_tax_rates"` + Images []*string `form:"images" json:"images"` + Name *string `form:"name" json:"name"` + Price *string `form:"price" json:"price"` + PriceData *CheckoutSessionLineItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } // CheckoutSessionPaymentIntentDataTransferDataParams is the set of parameters allowed for the // transfer_data hash. type CheckoutSessionPaymentIntentDataTransferDataParams struct { - Amount *int64 `form:"amount"` - Destination *string `form:"destination"` + Amount *int64 `form:"amount" json:"amount"` + Destination *string `form:"destination" json:"destination"` } // CheckoutSessionPaymentIntentDataParams is the set of parameters allowed for the // payment intent creation on a checkout session. type CheckoutSessionPaymentIntentDataParams struct { - Params `form:"*"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - CaptureMethod *string `form:"capture_method"` - Description *string `form:"description"` - Metadata map[string]string `form:"metadata"` - OnBehalfOf *string `form:"on_behalf_of"` - ReceiptEmail *string `form:"receipt_email"` - SetupFutureUsage *string `form:"setup_future_usage"` - Shipping *ShippingDetailsParams `form:"shipping"` - StatementDescriptor *string `form:"statement_descriptor"` - StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` - TransferData *CheckoutSessionPaymentIntentDataTransferDataParams `form:"transfer_data"` - TransferGroup *string `form:"transfer_group"` + Params `form:"*" json:"*"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + CaptureMethod *string `form:"capture_method" json:"capture_method"` + Description *string `form:"description" json:"description"` + Metadata map[string]string `form:"metadata" json:"metadata"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + ReceiptEmail *string `form:"receipt_email" json:"receipt_email"` + SetupFutureUsage *string `form:"setup_future_usage" json:"setup_future_usage"` + Shipping *ShippingDetailsParams `form:"shipping" json:"shipping"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + StatementDescriptorSuffix *string `form:"statement_descriptor_suffix" json:"statement_descriptor_suffix"` + TransferData *CheckoutSessionPaymentIntentDataTransferDataParams `form:"transfer_data" json:"transfer_data"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // CheckoutSessionPaymentMethodOptionsACSSDebitMandateOptionsParams is the set of parameters allowed for mandate_options for acss debit. type CheckoutSessionPaymentMethodOptionsACSSDebitMandateOptionsParams struct { - CustomMandateURL *string `form:"custom_mandate_url"` - DefaultFor []*string `form:"default_for"` - IntervalDescription *string `form:"interval_description"` - PaymentSchedule *string `form:"payment_schedule"` - TransactionType *string `form:"transaction_type"` + CustomMandateURL *string `form:"custom_mandate_url" json:"custom_mandate_url"` + DefaultFor []*string `form:"default_for" json:"default_for"` + IntervalDescription *string `form:"interval_description" json:"interval_description"` + PaymentSchedule *string `form:"payment_schedule" json:"payment_schedule"` + TransactionType *string `form:"transaction_type" json:"transaction_type"` } // CheckoutSessionPaymentMethodOptionsACSSDebitParams is the set of parameters allowed for acss_debit on payment_method_options. type CheckoutSessionPaymentMethodOptionsACSSDebitParams struct { - Currency *string `form:"currency"` - MandateOptions *CheckoutSessionPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"` - VerificationMethod *string `form:"verification_method"` + Currency *string `form:"currency" json:"currency"` + MandateOptions *CheckoutSessionPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options" json:"mandate_options"` + VerificationMethod *string `form:"verification_method" json:"verification_method"` } // CheckoutSessionPaymentMethodOptionsBoletoParams is the set of parameters allowed for boleto on payment_method_options. type CheckoutSessionPaymentMethodOptionsBoletoParams struct { - ExpiresAfterDays *int64 `form:"expires_after_days"` + ExpiresAfterDays *int64 `form:"expires_after_days" json:"expires_after_days"` } // CheckoutSessionPaymentMethodOptionsOXXOParams is the set of parameters allowed for oxxo on payment_method_options. type CheckoutSessionPaymentMethodOptionsOXXOParams struct { - ExpiresAfterDays *int64 `form:"expires_after_days"` + ExpiresAfterDays *int64 `form:"expires_after_days" json:"expires_after_days"` } // CheckoutSessionPaymentMethodOptionsWechatPayParams is the set of parameters allowed for wechat_pay on payment_method_options. type CheckoutSessionPaymentMethodOptionsWechatPayParams struct { - AppID *string `form:"app_id"` - Client *string `form:"client"` + AppID *string `form:"app_id" json:"app_id"` + Client *string `form:"client" json:"client"` } // CheckoutSessionPaymentMethodOptionsParams is the set of allowed parameters for payment_method_options on a checkout session. type CheckoutSessionPaymentMethodOptionsParams struct { - ACSSDebit *CheckoutSessionPaymentMethodOptionsACSSDebitParams `form:"acss_debit"` - Boleto *CheckoutSessionPaymentMethodOptionsBoletoParams `form:"boleto"` - OXXO *CheckoutSessionPaymentMethodOptionsOXXOParams `form:"oxxo"` - WechatPay *CheckoutSessionPaymentMethodOptionsWechatPayParams `form:"wechat_pay"` + ACSSDebit *CheckoutSessionPaymentMethodOptionsACSSDebitParams `form:"acss_debit" json:"acss_debit"` + Boleto *CheckoutSessionPaymentMethodOptionsBoletoParams `form:"boleto" json:"boleto"` + OXXO *CheckoutSessionPaymentMethodOptionsOXXOParams `form:"oxxo" json:"oxxo"` + WechatPay *CheckoutSessionPaymentMethodOptionsWechatPayParams `form:"wechat_pay" json:"wechat_pay"` } // CheckoutSessionSetupIntentDataParams is the set of parameters allowed for the setup intent // creation on a checkout session. type CheckoutSessionSetupIntentDataParams struct { - Params `form:"*"` - Description *string `form:"description"` - OnBehalfOf *string `form:"on_behalf_of"` + Params `form:"*" json:"*"` + Description *string `form:"description" json:"description"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` } // CheckoutSessionShippingAddressCollectionParams is the set of parameters allowed for the // shipping address collection. type CheckoutSessionShippingAddressCollectionParams struct { - AllowedCountries []*string `form:"allowed_countries"` + AllowedCountries []*string `form:"allowed_countries" json:"allowed_countries"` } // CheckoutSessionSubscriptionDataItemsParams is the set of parameters allowed for one item on a // checkout session associated with a subscription. type CheckoutSessionSubscriptionDataItemsParams struct { - Plan *string `form:"plan"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + Plan *string `form:"plan" json:"plan"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } // CheckoutSessionSubscriptionDataTransferDataParams is the set of parameters allowed // for the transfer_data hash. type CheckoutSessionSubscriptionDataTransferDataParams struct { - AmountPercent *float64 `form:"amount_percent"` - Destination *string `form:"destination"` + AmountPercent *float64 `form:"amount_percent" json:"amount_percent"` + Destination *string `form:"destination" json:"destination"` } // CheckoutSessionSubscriptionDataParams is the set of parameters allowed for the subscription // creation on a checkout session. type CheckoutSessionSubscriptionDataParams struct { - Params `form:"*"` - ApplicationFeePercent *float64 `form:"application_fee_percent"` - Coupon *string `form:"coupon"` - DefaultTaxRates []*string `form:"default_tax_rates"` - Items []*CheckoutSessionSubscriptionDataItemsParams `form:"items"` - Metadata map[string]string `form:"metadata"` - TransferData *CheckoutSessionSubscriptionDataTransferDataParams `form:"transfer_data"` - TrialEnd *int64 `form:"trial_end"` - TrialFromPlan *bool `form:"trial_from_plan"` - TrialPeriodDays *int64 `form:"trial_period_days"` + Params `form:"*" json:"*"` + ApplicationFeePercent *float64 `form:"application_fee_percent" json:"application_fee_percent"` + Coupon *string `form:"coupon" json:"coupon"` + DefaultTaxRates []*string `form:"default_tax_rates" json:"default_tax_rates"` + Items []*CheckoutSessionSubscriptionDataItemsParams `form:"items" json:"items"` + Metadata map[string]string `form:"metadata" json:"metadata"` + TransferData *CheckoutSessionSubscriptionDataTransferDataParams `form:"transfer_data" json:"transfer_data"` + TrialEnd *int64 `form:"trial_end" json:"trial_end"` + TrialFromPlan *bool `form:"trial_from_plan" json:"trial_from_plan"` + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` } // Controls tax ID collection settings for the session. type CheckoutSessionTaxIDCollectionParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // CheckoutSessionParams is the set of parameters that can be used when creating // a checkout session. // For more details see https://stripe.com/docs/api/checkout/sessions/create type CheckoutSessionParams struct { - Params `form:"*"` - AfterExpiration *CheckoutSessionAfterExpirationParams `form:"after_expiration"` - AllowPromotionCodes *bool `form:"allow_promotion_codes"` - AutomaticTax *CheckoutSessionAutomaticTaxParams `form:"automatic_tax"` - BillingAddressCollection *string `form:"billing_address_collection"` - CancelURL *string `form:"cancel_url"` - ClientReferenceID *string `form:"client_reference_id"` - ConsentCollection *CheckoutSessionConsentCollectionParams `form:"consent_collection"` - Customer *string `form:"customer"` - CustomerEmail *string `form:"customer_email"` - CustomerUpdate *CheckoutSessionCustomerUpdateParams `form:"customer_update"` - Discounts []*CheckoutSessionDiscountParams `form:"discounts"` - ExpiresAt *int64 `form:"expires_at"` - LineItems []*CheckoutSessionLineItemParams `form:"line_items"` - Locale *string `form:"locale"` - Mode *string `form:"mode"` - PaymentIntentData *CheckoutSessionPaymentIntentDataParams `form:"payment_intent_data"` - PaymentMethodOptions *CheckoutSessionPaymentMethodOptionsParams `form:"payment_method_options"` - PaymentMethodTypes []*string `form:"payment_method_types"` - SetupIntentData *CheckoutSessionSetupIntentDataParams `form:"setup_intent_data"` - ShippingAddressCollection *CheckoutSessionShippingAddressCollectionParams `form:"shipping_address_collection"` - ShippingRates []*string `form:"shipping_rates"` - SubmitType *string `form:"submit_type"` - SubscriptionData *CheckoutSessionSubscriptionDataParams `form:"subscription_data"` - SuccessURL *string `form:"success_url"` - TaxIDCollection *CheckoutSessionTaxIDCollectionParams `form:"tax_id_collection"` + Params `form:"*" json:"*"` + AfterExpiration *CheckoutSessionAfterExpirationParams `form:"after_expiration" json:"after_expiration"` + AllowPromotionCodes *bool `form:"allow_promotion_codes" json:"allow_promotion_codes"` + AutomaticTax *CheckoutSessionAutomaticTaxParams `form:"automatic_tax" json:"automatic_tax"` + BillingAddressCollection *string `form:"billing_address_collection" json:"billing_address_collection"` + CancelURL *string `form:"cancel_url" json:"cancel_url"` + ClientReferenceID *string `form:"client_reference_id" json:"client_reference_id"` + ConsentCollection *CheckoutSessionConsentCollectionParams `form:"consent_collection" json:"consent_collection"` + Customer *string `form:"customer" json:"customer"` + CustomerEmail *string `form:"customer_email" json:"customer_email"` + CustomerUpdate *CheckoutSessionCustomerUpdateParams `form:"customer_update" json:"customer_update"` + Discounts []*CheckoutSessionDiscountParams `form:"discounts" json:"discounts"` + ExpiresAt *int64 `form:"expires_at" json:"expires_at"` + LineItems []*CheckoutSessionLineItemParams `form:"line_items" json:"line_items"` + Locale *string `form:"locale" json:"locale"` + Mode *string `form:"mode" json:"mode"` + PaymentIntentData *CheckoutSessionPaymentIntentDataParams `form:"payment_intent_data" json:"payment_intent_data"` + PaymentMethodOptions *CheckoutSessionPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + PaymentMethodTypes []*string `form:"payment_method_types" json:"payment_method_types"` + SetupIntentData *CheckoutSessionSetupIntentDataParams `form:"setup_intent_data" json:"setup_intent_data"` + ShippingAddressCollection *CheckoutSessionShippingAddressCollectionParams `form:"shipping_address_collection" json:"shipping_address_collection"` + ShippingRates []*string `form:"shipping_rates" json:"shipping_rates"` + SubmitType *string `form:"submit_type" json:"submit_type"` + SubscriptionData *CheckoutSessionSubscriptionDataParams `form:"subscription_data" json:"subscription_data"` + SuccessURL *string `form:"success_url" json:"success_url"` + TaxIDCollection *CheckoutSessionTaxIDCollectionParams `form:"tax_id_collection" json:"tax_id_collection"` } // CheckoutSessionListLineItemsParams is the set of parameters that can be // used when listing line items on a session. type CheckoutSessionListLineItemsParams struct { - ListParams `form:"*"` - Session *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + Session *string `form:"-" json:"-"` // Included in URL } // CheckoutSessionListParams is the set of parameters that can be // used when listing sessions. // For more details see: https://stripe.com/docs/api/checkout/sessions/list type CheckoutSessionListParams struct { - ListParams `form:"*"` - PaymentIntent *string `form:"payment_intent"` - Subscription *string `form:"subscription"` + ListParams `form:"*" json:"*"` + PaymentIntent *string `form:"payment_intent" json:"payment_intent"` + Subscription *string `form:"subscription" json:"subscription"` } // When set, configuration used to recover the Checkout Session on expiry. diff --git a/countryspec.go b/countryspec.go index 9ce69a845e..55ae9080e9 100644 --- a/countryspec.go +++ b/countryspec.go @@ -11,12 +11,12 @@ type Country string // CountrySpecParams are the parameters allowed during CountrySpec retrieval. type CountrySpecParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // CountrySpecListParams are the parameters allowed during CountrySpec listing. type CountrySpecListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` } // VerificationFieldsList lists the fields needed for an account verification. diff --git a/coupon.go b/coupon.go index 36a67e92b6..a6116f5e0b 100644 --- a/coupon.go +++ b/coupon.go @@ -20,31 +20,31 @@ const ( // CouponAppliesToParams controls the products that a coupon applies to. type CouponAppliesToParams struct { - Products []*string `form:"products"` + Products []*string `form:"products" json:"products"` } // CouponParams is the set of parameters that can be used when creating a coupon. // For more details see https://stripe.com/docs/api#create_coupon. type CouponParams struct { - Params `form:"*"` - AmountOff *int64 `form:"amount_off"` - AppliesTo *CouponAppliesToParams `form:"applies_to"` - Currency *string `form:"currency"` - Duration *string `form:"duration"` - DurationInMonths *int64 `form:"duration_in_months"` - ID *string `form:"id"` - MaxRedemptions *int64 `form:"max_redemptions"` - Name *string `form:"name"` - PercentOff *float64 `form:"percent_off"` - RedeemBy *int64 `form:"redeem_by"` + Params `form:"*" json:"*"` + AmountOff *int64 `form:"amount_off" json:"amount_off"` + AppliesTo *CouponAppliesToParams `form:"applies_to" json:"applies_to"` + Currency *string `form:"currency" json:"currency"` + Duration *string `form:"duration" json:"duration"` + DurationInMonths *int64 `form:"duration_in_months" json:"duration_in_months"` + ID *string `form:"id" json:"id"` + MaxRedemptions *int64 `form:"max_redemptions" json:"max_redemptions"` + Name *string `form:"name" json:"name"` + PercentOff *float64 `form:"percent_off" json:"percent_off"` + RedeemBy *int64 `form:"redeem_by" json:"redeem_by"` } // CouponListParams is the set of parameters that can be used when listing coupons. // For more detail see https://stripe.com/docs/api#list_coupons. type CouponListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` } // CouponAppliesTo represents the products a coupon applies to. diff --git a/creditnote.go b/creditnote.go index 463f405992..99ac8c22c8 100644 --- a/creditnote.go +++ b/creditnote.go @@ -43,79 +43,79 @@ const ( // CreditNoteParams is the set of parameters that can be used when creating or updating a credit note. // For more details see https://stripe.com/docs/api/credit_notes/create, https://stripe.com/docs/api/credit_notes/update. type CreditNoteParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - CreditAmount *int64 `form:"credit_amount"` - Invoice *string `form:"invoice"` - Lines []*CreditNoteLineParams `form:"lines"` - Memo *string `form:"memo"` - OutOfBandAmount *int64 `form:"out_of_band_amount"` - Reason *string `form:"reason"` - Refund *string `form:"refund"` - RefundAmount *int64 `form:"refund_amount"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + CreditAmount *int64 `form:"credit_amount" json:"credit_amount"` + Invoice *string `form:"invoice" json:"invoice"` + Lines []*CreditNoteLineParams `form:"lines" json:"lines"` + Memo *string `form:"memo" json:"memo"` + OutOfBandAmount *int64 `form:"out_of_band_amount" json:"out_of_band_amount"` + Reason *string `form:"reason" json:"reason"` + Refund *string `form:"refund" json:"refund"` + RefundAmount *int64 `form:"refund_amount" json:"refund_amount"` } // CreditNoteListParams is the set of parameters that can be used when listing credit notes. // For more details see https://stripe.com/docs/api/credit_notes/list. type CreditNoteListParams struct { - ListParams `form:"*"` - Customer *string `form:"customer"` - Invoice *string `form:"invoice"` + ListParams `form:"*" json:"*"` + Customer *string `form:"customer" json:"customer"` + Invoice *string `form:"invoice" json:"invoice"` } // CreditNoteLineItemListParams is the set of parameters that can be used when listing credit note line items. type CreditNoteLineItemListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` // ID is the credit note ID to list line items for. - ID *string `form:"-"` // Goes in the URL + ID *string `form:"-" json:"-"` // Goes in the URL } // CreditNoteLineItemListPreviewParams is the set of parameters that can be used when previewing a credit note's line items type CreditNoteLineItemListPreviewParams struct { - ListParams `form:"*"` - Amount *int64 `form:"amount"` - CreditAmount *int64 `form:"credit_amount"` - Invoice *string `form:"invoice"` - Lines []*CreditNoteLineParams `form:"lines"` - Memo *string `form:"memo"` - OutOfBandAmount *int64 `form:"out_of_band_amount"` - Reason *string `form:"reason"` - Refund *string `form:"refund"` - RefundAmount *int64 `form:"refund_amount"` + ListParams `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + CreditAmount *int64 `form:"credit_amount" json:"credit_amount"` + Invoice *string `form:"invoice" json:"invoice"` + Lines []*CreditNoteLineParams `form:"lines" json:"lines"` + Memo *string `form:"memo" json:"memo"` + OutOfBandAmount *int64 `form:"out_of_band_amount" json:"out_of_band_amount"` + Reason *string `form:"reason" json:"reason"` + Refund *string `form:"refund" json:"refund"` + RefundAmount *int64 `form:"refund_amount" json:"refund_amount"` } // CreditNoteLineParams is the set of parameters that can be used for a line item when creating // or previewing a credit note. type CreditNoteLineParams struct { - Amount *int64 `form:"amount"` - Description *string `form:"description"` - InvoiceLineItem *string `form:"invoice_line_item"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` - Type *string `form:"type"` + Amount *int64 `form:"amount" json:"amount"` + Description *string `form:"description" json:"description"` + InvoiceLineItem *string `form:"invoice_line_item" json:"invoice_line_item"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` + Type *string `form:"type" json:"type"` } // CreditNotePreviewParams is the set of parameters that can be used when previewing a credit note. // For more details see https://stripe.com/docs/api/credit_notes/preview. type CreditNotePreviewParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - CreditAmount *int64 `form:"credit_amount"` - Invoice *string `form:"invoice"` - Lines []*CreditNoteLineParams `form:"lines"` - Memo *string `form:"memo"` - OutOfBandAmount *int64 `form:"out_of_band_amount"` - Reason *string `form:"reason"` - Refund *string `form:"refund"` - RefundAmount *int64 `form:"refund_amount"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + CreditAmount *int64 `form:"credit_amount" json:"credit_amount"` + Invoice *string `form:"invoice" json:"invoice"` + Lines []*CreditNoteLineParams `form:"lines" json:"lines"` + Memo *string `form:"memo" json:"memo"` + OutOfBandAmount *int64 `form:"out_of_band_amount" json:"out_of_band_amount"` + Reason *string `form:"reason" json:"reason"` + Refund *string `form:"refund" json:"refund"` + RefundAmount *int64 `form:"refund_amount" json:"refund_amount"` } // CreditNoteVoidParams is the set of parameters that can be used when voiding invoices. type CreditNoteVoidParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // CreditNoteDiscountAmount represents the aggregate amounts calculated per discount for all line items. diff --git a/customer.go b/customer.go index 7ab9f9dc1b..f9ba0782f7 100644 --- a/customer.go +++ b/customer.go @@ -41,60 +41,60 @@ const ( // CustomerParams is the set of parameters that can be used when creating or updating a customer. // For more details see https://stripe.com/docs/api#create_customer and https://stripe.com/docs/api#update_customer. type CustomerParams struct { - Params `form:"*"` - Address *AddressParams `form:"address"` - Balance *int64 `form:"balance"` - Coupon *string `form:"coupon"` - DefaultSource *string `form:"default_source"` - Description *string `form:"description"` - Email *string `form:"email"` - InvoicePrefix *string `form:"invoice_prefix"` - InvoiceSettings *CustomerInvoiceSettingsParams `form:"invoice_settings"` - Name *string `form:"name"` - NextInvoiceSequence *int64 `form:"next_invoice_sequence"` - PaymentMethod *string `form:"payment_method"` - Phone *string `form:"phone"` - PreferredLocales []*string `form:"preferred_locales"` - PromotionCode *string `form:"promotion_code"` - Shipping *CustomerShippingDetailsParams `form:"shipping"` - Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" - Tax *CustomerTaxParams `form:"tax"` - TaxExempt *string `form:"tax_exempt"` - TaxIDData []*CustomerTaxIDDataParams `form:"tax_id_data"` - Token *string `form:"-"` // This doesn't seem to be used? + Params `form:"*" json:"*"` + Address *AddressParams `form:"address" json:"address"` + Balance *int64 `form:"balance" json:"balance"` + Coupon *string `form:"coupon" json:"coupon"` + DefaultSource *string `form:"default_source" json:"default_source"` + Description *string `form:"description" json:"description"` + Email *string `form:"email" json:"email"` + InvoicePrefix *string `form:"invoice_prefix" json:"invoice_prefix"` + InvoiceSettings *CustomerInvoiceSettingsParams `form:"invoice_settings" json:"invoice_settings"` + Name *string `form:"name" json:"name"` + NextInvoiceSequence *int64 `form:"next_invoice_sequence" json:"next_invoice_sequence"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` + Phone *string `form:"phone" json:"phone"` + PreferredLocales []*string `form:"preferred_locales" json:"preferred_locales"` + PromotionCode *string `form:"promotion_code" json:"promotion_code"` + Shipping *CustomerShippingDetailsParams `form:"shipping" json:"shipping"` + Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" + Tax *CustomerTaxParams `form:"tax" json:"tax"` + TaxExempt *string `form:"tax_exempt" json:"tax_exempt"` + TaxIDData []*CustomerTaxIDDataParams `form:"tax_id_data" json:"tax_id_data"` + Token *string `form:"-" json:"-"` // This doesn't seem to be used? } // CustomerInvoiceCustomFieldParams represents the parameters associated with one custom field on // the customer's invoices. type CustomerInvoiceCustomFieldParams struct { - Name *string `form:"name"` - Value *string `form:"value"` + Name *string `form:"name" json:"name"` + Value *string `form:"value" json:"value"` } // CustomerInvoiceSettingsParams is the structure containing the default settings for invoices // associated with this customer. type CustomerInvoiceSettingsParams struct { - CustomFields []*CustomerInvoiceCustomFieldParams `form:"custom_fields"` - DefaultPaymentMethod *string `form:"default_payment_method"` - Footer *string `form:"footer"` + CustomFields []*CustomerInvoiceCustomFieldParams `form:"custom_fields" json:"custom_fields"` + DefaultPaymentMethod *string `form:"default_payment_method" json:"default_payment_method"` + Footer *string `form:"footer" json:"footer"` } // CustomerShippingDetailsParams is the structure containing shipping information. type CustomerShippingDetailsParams struct { - Address *AddressParams `form:"address"` - Name *string `form:"name"` - Phone *string `form:"phone"` + Address *AddressParams `form:"address" json:"address"` + Name *string `form:"name" json:"name"` + Phone *string `form:"phone" json:"phone"` } // Tax details about the customer. type CustomerTaxParams struct { - IPAddress *string `form:"ip_address"` + IPAddress *string `form:"ip_address" json:"ip_address"` } // CustomerTaxIDDataParams lets you pass the tax id details associated with a Customer. type CustomerTaxIDDataParams struct { - Type *string `form:"type"` - Value *string `form:"value"` + Type *string `form:"type" json:"type"` + Value *string `form:"value" json:"value"` } // SetSource adds valid sources to a CustomerParams object, @@ -108,10 +108,10 @@ func (cp *CustomerParams) SetSource(sp interface{}) error { // CustomerListParams is the set of parameters that can be used when listing customers. // For more details see https://stripe.com/docs/api#list_customers. type CustomerListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Email *string `form:"email"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Email *string `form:"email" json:"email"` } // The customer's location as identified by Stripe Tax. @@ -160,8 +160,8 @@ type Customer struct { // CustomerInvoiceCustomField represents a custom field associated with the customer's invoices. type CustomerInvoiceCustomField struct { - Name *string `form:"name"` - Value *string `form:"value"` + Name *string `form:"name" json:"name"` + Value *string `form:"value" json:"value"` } // CustomerInvoiceSettings is the structure containing the default settings for invoices associated diff --git a/customerbalancetransaction.go b/customerbalancetransaction.go index 742634a572..d9b2f346a2 100644 --- a/customerbalancetransaction.go +++ b/customerbalancetransaction.go @@ -29,19 +29,19 @@ const ( // updating a customer balance transactions. // For more details see https://stripe.com/docs/api/customers/create_customer_balance_transaction type CustomerBalanceTransactionParams struct { - Params `form:"*"` - Customer *string `form:"-"` // Included in URL - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` + Params `form:"*" json:"*"` + Customer *string `form:"-" json:"-"` // Included in URL + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` } // CustomerBalanceTransactionListParams is the set of parameters that can be used when listing // customer balance transactions. // For more detail see https://stripe.com/docs/api/customers/customer_balance_transactions type CustomerBalanceTransactionListParams struct { - ListParams `form:"*"` - Customer *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + Customer *string `form:"-" json:"-"` // Included in URL } // CustomerBalanceTransaction is the resource representing a customer balance transaction. diff --git a/discount.go b/discount.go index b1cd3efaa8..e97eb5613f 100644 --- a/discount.go +++ b/discount.go @@ -10,7 +10,7 @@ import "encoding/json" // DiscountParams is the set of parameters that can be used when deleting a discount. type DiscountParams struct { - Params `form:"*" json:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` } // Discount is the resource representing a Stripe discount. diff --git a/dispute.go b/dispute.go index eb6ea4f4a9..0f3185caaf 100644 --- a/dispute.go +++ b/dispute.go @@ -47,51 +47,51 @@ const ( // DisputeParams is the set of parameters that can be used when updating a dispute. // For more details see https://stripe.com/docs/api#update_dispute. type DisputeParams struct { - Params `form:"*"` - Evidence *DisputeEvidenceParams `form:"evidence"` - Submit *bool `form:"submit"` + Params `form:"*" json:"*"` + Evidence *DisputeEvidenceParams `form:"evidence" json:"evidence"` + Submit *bool `form:"submit" json:"submit"` } // DisputeEvidenceParams is the set of parameters that can be used when submitting // evidence for disputes. type DisputeEvidenceParams struct { - AccessActivityLog *string `form:"access_activity_log"` - BillingAddress *string `form:"billing_address"` - CancellationPolicy *string `form:"cancellation_policy"` - CancellationPolicyDisclosure *string `form:"cancellation_policy_disclosure"` - CancellationRebuttal *string `form:"cancellation_rebuttal"` - CustomerCommunication *string `form:"customer_communication"` - CustomerEmailAddress *string `form:"customer_email_address"` - CustomerName *string `form:"customer_name"` - CustomerPurchaseIP *string `form:"customer_purchase_ip"` - CustomerSignature *string `form:"customer_signature"` - DuplicateChargeDocumentation *string `form:"duplicate_charge_documentation"` - DuplicateChargeExplanation *string `form:"duplicate_charge_explanation"` - DuplicateChargeID *string `form:"duplicate_charge_id"` - ProductDescription *string `form:"product_description"` - Receipt *string `form:"receipt"` - RefundPolicy *string `form:"refund_policy"` - RefundPolicyDisclosure *string `form:"refund_policy_disclosure"` - RefundRefusalExplanation *string `form:"refund_refusal_explanation"` - ServiceDate *string `form:"service_date"` - ServiceDocumentation *string `form:"service_documentation"` - ShippingAddress *string `form:"shipping_address"` - ShippingCarrier *string `form:"shipping_carrier"` - ShippingDate *string `form:"shipping_date"` - ShippingDocumentation *string `form:"shipping_documentation"` - ShippingTrackingNumber *string `form:"shipping_tracking_number"` - UncategorizedFile *string `form:"uncategorized_file"` - UncategorizedText *string `form:"uncategorized_text"` + AccessActivityLog *string `form:"access_activity_log" json:"access_activity_log"` + BillingAddress *string `form:"billing_address" json:"billing_address"` + CancellationPolicy *string `form:"cancellation_policy" json:"cancellation_policy"` + CancellationPolicyDisclosure *string `form:"cancellation_policy_disclosure" json:"cancellation_policy_disclosure"` + CancellationRebuttal *string `form:"cancellation_rebuttal" json:"cancellation_rebuttal"` + CustomerCommunication *string `form:"customer_communication" json:"customer_communication"` + CustomerEmailAddress *string `form:"customer_email_address" json:"customer_email_address"` + CustomerName *string `form:"customer_name" json:"customer_name"` + CustomerPurchaseIP *string `form:"customer_purchase_ip" json:"customer_purchase_ip"` + CustomerSignature *string `form:"customer_signature" json:"customer_signature"` + DuplicateChargeDocumentation *string `form:"duplicate_charge_documentation" json:"duplicate_charge_documentation"` + DuplicateChargeExplanation *string `form:"duplicate_charge_explanation" json:"duplicate_charge_explanation"` + DuplicateChargeID *string `form:"duplicate_charge_id" json:"duplicate_charge_id"` + ProductDescription *string `form:"product_description" json:"product_description"` + Receipt *string `form:"receipt" json:"receipt"` + RefundPolicy *string `form:"refund_policy" json:"refund_policy"` + RefundPolicyDisclosure *string `form:"refund_policy_disclosure" json:"refund_policy_disclosure"` + RefundRefusalExplanation *string `form:"refund_refusal_explanation" json:"refund_refusal_explanation"` + ServiceDate *string `form:"service_date" json:"service_date"` + ServiceDocumentation *string `form:"service_documentation" json:"service_documentation"` + ShippingAddress *string `form:"shipping_address" json:"shipping_address"` + ShippingCarrier *string `form:"shipping_carrier" json:"shipping_carrier"` + ShippingDate *string `form:"shipping_date" json:"shipping_date"` + ShippingDocumentation *string `form:"shipping_documentation" json:"shipping_documentation"` + ShippingTrackingNumber *string `form:"shipping_tracking_number" json:"shipping_tracking_number"` + UncategorizedFile *string `form:"uncategorized_file" json:"uncategorized_file"` + UncategorizedText *string `form:"uncategorized_text" json:"uncategorized_text"` } // DisputeListParams is the set of parameters that can be used when listing disputes. // For more details see https://stripe.com/docs/api#list_disputes. type DisputeListParams struct { - ListParams `form:"*"` - Charge *string `form:"charge"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - PaymentIntent *string `form:"payment_intent"` + ListParams `form:"*" json:"*"` + Charge *string `form:"charge" json:"charge"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + PaymentIntent *string `form:"payment_intent" json:"payment_intent"` } // Dispute is the resource representing a Stripe dispute. diff --git a/ephemeralkey.go b/ephemeralkey.go index 0a7c5916e2..4b9404163e 100644 --- a/ephemeralkey.go +++ b/ephemeralkey.go @@ -11,10 +11,10 @@ import "encoding/json" // EphemeralKeyParams is the set of parameters that can be used when creating // an ephemeral key. type EphemeralKeyParams struct { - Params `form:"*" json:"*"` - Customer *string `form:"customer" json:"customer"` - IssuingCard *string `form:"issuing_card" json:"issuing_card"` - StripeVersion *string `form:"-" json:"-"` // This goes in the `Stripe-Version` header + Params `form:"*" json:"*" json:"*" json:"*"` + Customer *string `form:"customer" json:"customer" json:"customer" json:"customer"` + IssuingCard *string `form:"issuing_card" json:"issuing_card" json:"issuing_card" json:"issuing_card"` + StripeVersion *string `form:"-" json:"-" json:"-" json:"-"` // This goes in the `Stripe-Version` header } // EphemeralKey is the resource representing a Stripe ephemeral key. This is used by Mobile SDKs diff --git a/event.go b/event.go index 5b13152048..69c1c41d49 100644 --- a/event.go +++ b/event.go @@ -45,7 +45,7 @@ type EventData struct { // EventParams is the set of parameters that can be used when retrieving events. // For more details see https://stripe.com/docs/api#retrieve_events. type EventParams struct { - Params `form:"*" json:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` } // EventList is a list of events as retrieved from a list endpoint. @@ -58,12 +58,12 @@ type EventList struct { // EventListParams is the set of parameters that can be used when listing events. // For more details see https://stripe.com/docs/api#list_events. type EventListParams struct { - ListParams `form:"*" json:"*"` - Created *int64 `form:"created" json:"created"` - CreatedRange *RangeQueryParams `form:"created" json:"created"` - DeliverySuccess *bool `form:"delivery_success" json:"delivery_success"` - Type *string `form:"type" json:"type"` - Types []*string `form:"types" json:"types"` + ListParams `form:"*" json:"*" json:"*" json:"*"` + Created *int64 `form:"created" json:"created" json:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created" json:"created" json:"created"` + DeliverySuccess *bool `form:"delivery_success" json:"delivery_success" json:"delivery_success" json:"delivery_success"` + Type *string `form:"type" json:"type" json:"type" json:"type"` + Types []*string `form:"types" json:"types" json:"types" json:"types"` } // GetObjectValue returns the value from the e.Data.Object bag based on the keys hierarchy. diff --git a/exchangerate.go b/exchangerate.go index 39a3b117a4..eceb7cbac6 100644 --- a/exchangerate.go +++ b/exchangerate.go @@ -10,7 +10,7 @@ type ExchangeRate struct { // ExchangeRateParams is the set of parameters that can be used when retrieving // exchange rates. type ExchangeRateParams struct { - Params `form:"*" json:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` } // ExchangeRateList is a list of exchange rates as retrieved from a list endpoint. @@ -21,5 +21,5 @@ type ExchangeRateList struct { // ExchangeRateListParams are the parameters allowed during ExchangeRate listing. type ExchangeRateListParams struct { - ListParams `form:"*" json:"*"` + ListParams `form:"*" json:"*" json:"*" json:"*"` } diff --git a/fee.go b/fee.go index 7adc549bd7..8b396cf656 100644 --- a/fee.go +++ b/fee.go @@ -11,16 +11,16 @@ import "encoding/json" // ApplicationFeeParams is the set of parameters that can be used when refunding an application fee. // For more details see https://stripe.com/docs/api#refund_application_fee. type ApplicationFeeParams struct { - Params `form:"*" json:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` } // ApplicationFeeListParams is the set of parameters that can be used when listing application fees. // For more details see https://stripe.com/docs/api#list_application_fees. type ApplicationFeeListParams struct { - ListParams `form:"*" json:"*"` - Charge *string `form:"charge" json:"charge"` - Created *int64 `form:"created" json:"created"` - CreatedRange *RangeQueryParams `form:"created" json:"created"` + ListParams `form:"*" json:"*" json:"*" json:"*"` + Charge *string `form:"charge" json:"charge" json:"charge" json:"charge"` + Created *int64 `form:"created" json:"created" json:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created" json:"created" json:"created"` } // ApplicationFee is the resource representing a Stripe application fee. diff --git a/feerefund.go b/feerefund.go index 0a9185b03a..6e770d1d12 100644 --- a/feerefund.go +++ b/feerefund.go @@ -11,16 +11,16 @@ import "encoding/json" // FeeRefundParams is the set of parameters that can be used when refunding an application fee. // For more details see https://stripe.com/docs/api#fee_refund. type FeeRefundParams struct { - Params `form:"*"` - ApplicationFee *string `form:"-"` // Included in URL - Amount *int64 `form:"amount"` + Params `form:"*" json:"*"` + ApplicationFee *string `form:"-" json:"-"` // Included in URL + Amount *int64 `form:"amount" json:"amount"` } // FeeRefundListParams is the set of parameters that can be used when listing application fee refunds. // For more details see https://stripe.com/docs/api#list_fee_refunds. type FeeRefundListParams struct { - ListParams `form:"*"` - ApplicationFee *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + ApplicationFee *string `form:"-" json:"-"` // Included in URL } // FeeRefund is the resource representing a Stripe application fee refund. diff --git a/file.go b/file.go index fd974f8246..2d5c925f4b 100644 --- a/file.go +++ b/file.go @@ -34,7 +34,7 @@ const ( // FileParams is the set of parameters that can be used when creating a file. // For more details see https://stripe.com/docs/api#create_file. type FileParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` // FileReader is a reader with the contents of the file that should be uploaded. FileReader io.Reader @@ -50,18 +50,18 @@ type FileParams struct { // FileFileLinkDataParams is the set of parameters allowed for the // file_link_data hash. type FileFileLinkDataParams struct { - Params `form:"*"` - Create *bool `form:"create"` - ExpiresAt *int64 `form:"expires_at"` + Params `form:"*" json:"*"` + Create *bool `form:"create" json:"create"` + ExpiresAt *int64 `form:"expires_at" json:"expires_at"` } // FileListParams is the set of parameters that can be used when listing // files. For more details see https://stripe.com/docs/api#list_files. type FileListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Purpose *string `form:"purpose"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Purpose *string `form:"purpose" json:"purpose"` } // File is the resource representing a Stripe file. diff --git a/filelink.go b/filelink.go index 00849672d2..f90ee2472e 100644 --- a/filelink.go +++ b/filelink.go @@ -11,10 +11,10 @@ import "github.com/stripe/stripe-go/v72/form" // FileLinkParams is the set of parameters that can be used when creating or updating a file link. type FileLinkParams struct { - Params `form:"*"` - ExpiresAt *int64 `form:"expires_at"` - ExpiresAtNow *bool `form:"-"` // See custom AppendTo - File *string `form:"file"` + Params `form:"*" json:"*"` + ExpiresAt *int64 `form:"expires_at" json:"expires_at"` + ExpiresAtNow *bool `form:"-" json:"-"` // See custom AppendTo + File *string `form:"file" json:"file"` } // AppendTo implements custom encoding logic for FileLinkParams. @@ -26,11 +26,11 @@ func (f *FileLinkParams) AppendTo(body *form.Values, keyParts []string) { // FileLinkListParams is the set of parameters that can be used when listing file links. type FileLinkListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Expired *bool `form:"expired"` - File *string `form:"file"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Expired *bool `form:"expired" json:"expired"` + File *string `form:"file" json:"file"` } // FileLink is the resource representing a Stripe file link. diff --git a/form/form_test.go b/form/form_test.go index 31b0fe2eb8..c16f528429 100644 --- a/form/form_test.go +++ b/form/form_test.go @@ -10,79 +10,79 @@ import ( ) type benchStruct struct { - Bool bool `form:"bool" json:"bool"` - Ignored string `form:"-" json:"-"` - Int int64 `form:"int64" json:"int64"` - String string `form:"string" json:"string"` - SubSubStruct *testSubSubStruct `form:"subsubstruct" json:"subsubstruct"` + Bool bool `form:"bool" json:"bool" json:"bool" json:"bool"` + Ignored string `form:"-" json:"-" json:"-" json:"-"` + Int int64 `form:"int64" json:"int64" json:"int64" json:"int64"` + String string `form:"string" json:"string" json:"string" json:"string"` + SubSubStruct *testSubSubStruct `form:"subsubstruct" json:"subsubstruct" json:"subsubstruct" json:"subsubstruct"` } type testStruct struct { // Note that only a pointer can implement the Appender interface, so only // the pointer of testAppender is checked. - Appender *testAppender `form:"appender" json:"appender"` + Appender *testAppender `form:"appender" json:"appender" json:"appender" json:"appender"` - Array [3]string `form:"array" json:"array"` - ArrayPtr *[3]string `form:"array_ptr" json:"array_ptr"` + Array [3]string `form:"array" json:"array" json:"array" json:"array"` + ArrayPtr *[3]string `form:"array_ptr" json:"array_ptr" json:"array_ptr" json:"array_ptr"` - Bool bool `form:"bool" json:"bool"` - BoolPtr *bool `form:"bool_ptr" json:"bool_ptr"` + Bool bool `form:"bool" json:"bool" json:"bool" json:"bool"` + BoolPtr *bool `form:"bool_ptr" json:"bool_ptr" json:"bool_ptr" json:"bool_ptr"` - Emptied bool `form:"emptied,empty" json:"emptied,empty"` + Emptied bool `form:"emptied,empty" json:"emptied,empty" json:"emptied,empty" json:"emptied,empty"` - Float32 float32 `form:"float32" json:"float32"` - Float32Ptr *float32 `form:"float32_ptr" json:"float32_ptr"` + Float32 float32 `form:"float32" json:"float32" json:"float32" json:"float32"` + Float32Ptr *float32 `form:"float32_ptr" json:"float32_ptr" json:"float32_ptr" json:"float32_ptr"` - Float32Precise float32 `form:"float32_precise,high_precision" json:"float32_precise,high_precision"` - Float32PrecisePtr *float32 `form:"float32_precise_ptr,high_precision" json:"float32_precise_ptr,high_precision"` + Float32Precise float32 `form:"float32_precise,high_precision" json:"float32_precise,high_precision" json:"float32_precise,high_precision" json:"float32_precise,high_precision"` + Float32PrecisePtr *float32 `form:"float32_precise_ptr,high_precision" json:"float32_precise_ptr,high_precision" json:"float32_precise_ptr,high_precision" json:"float32_precise_ptr,high_precision"` - Float64 float64 `form:"float64" json:"float64"` - Float64Ptr *float64 `form:"float64_ptr" json:"float64_ptr"` + Float64 float64 `form:"float64" json:"float64" json:"float64" json:"float64"` + Float64Ptr *float64 `form:"float64_ptr" json:"float64_ptr" json:"float64_ptr" json:"float64_ptr"` - Float64Precise float64 `form:"float64_precise,high_precision" json:"float64_precise,high_precision"` - Float64PrecisePtr *float64 `form:"float64_precise_ptr,high_precision" json:"float64_precise_ptr,high_precision"` + Float64Precise float64 `form:"float64_precise,high_precision" json:"float64_precise,high_precision" json:"float64_precise,high_precision" json:"float64_precise,high_precision"` + Float64PrecisePtr *float64 `form:"float64_precise_ptr,high_precision" json:"float64_precise_ptr,high_precision" json:"float64_precise_ptr,high_precision" json:"float64_precise_ptr,high_precision"` - Ignored string `form:"-" json:"-"` + Ignored string `form:"-" json:"-" json:"-" json:"-"` - Int int `form:"int" json:"int"` - IntPtr *int `form:"int_ptr" json:"int_ptr"` - Int8 int8 `form:"int8" json:"int8"` - Int8Ptr *int8 `form:"int8_ptr" json:"int8_ptr"` - Int16 int16 `form:"int16" json:"int16"` - Int16Ptr *int16 `form:"int16_ptr" json:"int16_ptr"` - Int32 int32 `form:"int32" json:"int32"` - Int32Ptr *int32 `form:"int32_ptr" json:"int32_ptr"` - Int64 int64 `form:"int64" json:"int64"` - Int64Ptr *int64 `form:"int64_ptr" json:"int64_ptr"` + Int int `form:"int" json:"int" json:"int" json:"int"` + IntPtr *int `form:"int_ptr" json:"int_ptr" json:"int_ptr" json:"int_ptr"` + Int8 int8 `form:"int8" json:"int8" json:"int8" json:"int8"` + Int8Ptr *int8 `form:"int8_ptr" json:"int8_ptr" json:"int8_ptr" json:"int8_ptr"` + Int16 int16 `form:"int16" json:"int16" json:"int16" json:"int16"` + Int16Ptr *int16 `form:"int16_ptr" json:"int16_ptr" json:"int16_ptr" json:"int16_ptr"` + Int32 int32 `form:"int32" json:"int32" json:"int32" json:"int32"` + Int32Ptr *int32 `form:"int32_ptr" json:"int32_ptr" json:"int32_ptr" json:"int32_ptr"` + Int64 int64 `form:"int64" json:"int64" json:"int64" json:"int64"` + Int64Ptr *int64 `form:"int64_ptr" json:"int64_ptr" json:"int64_ptr" json:"int64_ptr"` - Map map[string]interface{} `form:"map" json:"map"` + Map map[string]interface{} `form:"map" json:"map" json:"map" json:"map"` - Slice []string `form:"slice" json:"slice"` - SlicePtr *[]string `form:"slice_ptr" json:"slice_ptr"` + Slice []string `form:"slice" json:"slice" json:"slice" json:"slice"` + SlicePtr *[]string `form:"slice_ptr" json:"slice_ptr" json:"slice_ptr" json:"slice_ptr"` - String string `form:"string" json:"string"` - StringPtr *string `form:"string_ptr" json:"string_ptr"` + String string `form:"string" json:"string" json:"string" json:"string"` + StringPtr *string `form:"string_ptr" json:"string_ptr" json:"string_ptr" json:"string_ptr"` - SubStruct testSubStruct `form:"substruct" json:"substruct"` - SubStructPtr *testSubStruct `form:"substruct_ptr" json:"substruct_ptr"` + SubStruct testSubStruct `form:"substruct" json:"substruct" json:"substruct" json:"substruct"` + SubStructPtr *testSubStruct `form:"substruct_ptr" json:"substruct_ptr" json:"substruct_ptr" json:"substruct_ptr"` - SubStructFlat testSubStruct `form:"*" json:"*"` - SubStructFlatPtr *testSubStruct `form:"*" json:"*"` + SubStructFlat testSubStruct `form:"*" json:"*" json:"*" json:"*"` + SubStructFlatPtr *testSubStruct `form:"*" json:"*" json:"*" json:"*"` - Uuint uint `form:"uint" json:"uint"` - UuintPtr *uint `form:"uint_ptr" json:"uint_ptr"` - Uuint8 uint8 `form:"uint8" json:"uint8"` - Uuint8Ptr *uint8 `form:"uint8_ptr" json:"uint8_ptr"` - Uuint16 uint16 `form:"uint16" json:"uint16"` - Uuint16Ptr *uint16 `form:"uint16_ptr" json:"uint16_ptr"` - Uuint32 uint32 `form:"uint32" json:"uint32"` - Uuint32Ptr *uint32 `form:"uint32_ptr" json:"uint32_ptr"` - Uuint64 uint64 `form:"uint64" json:"uint64"` - Uuint64Ptr *uint64 `form:"uint64_ptr" json:"uint64_ptr"` + Uuint uint `form:"uint" json:"uint" json:"uint" json:"uint"` + UuintPtr *uint `form:"uint_ptr" json:"uint_ptr" json:"uint_ptr" json:"uint_ptr"` + Uuint8 uint8 `form:"uint8" json:"uint8" json:"uint8" json:"uint8"` + Uuint8Ptr *uint8 `form:"uint8_ptr" json:"uint8_ptr" json:"uint8_ptr" json:"uint8_ptr"` + Uuint16 uint16 `form:"uint16" json:"uint16" json:"uint16" json:"uint16"` + Uuint16Ptr *uint16 `form:"uint16_ptr" json:"uint16_ptr" json:"uint16_ptr" json:"uint16_ptr"` + Uuint32 uint32 `form:"uint32" json:"uint32" json:"uint32" json:"uint32"` + Uuint32Ptr *uint32 `form:"uint32_ptr" json:"uint32_ptr" json:"uint32_ptr" json:"uint32_ptr"` + Uuint64 uint64 `form:"uint64" json:"uint64" json:"uint64" json:"uint64"` + Uuint64Ptr *uint64 `form:"uint64_ptr" json:"uint64_ptr" json:"uint64_ptr" json:"uint64_ptr"` } type testAppender struct { - String string `form:"-" json:"-"` // Value added manually + String string `form:"-" json:"-" json:"-" json:"-"` // Value added manually } func (a *testAppender) AppendTo(values *Values, keyParts []string) { @@ -90,11 +90,11 @@ func (a *testAppender) AppendTo(values *Values, keyParts []string) { } type testSubStruct struct { - SubSubStruct testSubSubStruct `form:"subsubstruct" json:"subsubstruct"` + SubSubStruct testSubSubStruct `form:"subsubstruct" json:"subsubstruct" json:"subsubstruct" json:"subsubstruct"` } type testSubSubStruct struct { - String string `form:"string" json:"string"` + String string `form:"string" json:"string" json:"string" json:"string"` } func init() { diff --git a/identity_verificationreport.go b/identity_verificationreport.go index 583a0e8228..2a2a4aa22c 100644 --- a/identity_verificationreport.go +++ b/identity_verificationreport.go @@ -97,16 +97,16 @@ const ( // Retrieves an existing VerificationReport type IdentityVerificationReportParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // List all verification reports. type IdentityVerificationReportListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Type *string `form:"type"` - VerificationSession *string `form:"verification_session"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Type *string `form:"type" json:"type"` + VerificationSession *string `form:"verification_session" json:"verification_session"` } // Date of birth as it appears in the document. diff --git a/identity_verificationsession.go b/identity_verificationsession.go index c605cc91fe..5bf18aa3f6 100644 --- a/identity_verificationsession.go +++ b/identity_verificationsession.go @@ -73,15 +73,15 @@ const ( // Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). type IdentityVerificationSessionOptionsDocumentParams struct { - AllowedTypes []*string `form:"allowed_types"` - RequireIDNumber *bool `form:"require_id_number"` - RequireLiveCapture *bool `form:"require_live_capture"` - RequireMatchingSelfie *bool `form:"require_matching_selfie"` + AllowedTypes []*string `form:"allowed_types" json:"allowed_types"` + RequireIDNumber *bool `form:"require_id_number" json:"require_id_number"` + RequireLiveCapture *bool `form:"require_live_capture" json:"require_live_capture"` + RequireMatchingSelfie *bool `form:"require_matching_selfie" json:"require_matching_selfie"` } // A set of options for the session's verification checks. type IdentityVerificationSessionOptionsParams struct { - Document *IdentityVerificationSessionOptionsDocumentParams `form:"document"` + Document *IdentityVerificationSessionOptionsDocumentParams `form:"document" json:"document"` } // Creates a VerificationSession object. @@ -92,25 +92,25 @@ type IdentityVerificationSessionOptionsParams struct { // // Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents). type IdentityVerificationSessionParams struct { - Params `form:"*"` - Options *IdentityVerificationSessionOptionsParams `form:"options"` - ReturnURL *string `form:"return_url"` - Type *string `form:"type"` + Params `form:"*" json:"*"` + Options *IdentityVerificationSessionOptionsParams `form:"options" json:"options"` + ReturnURL *string `form:"return_url" json:"return_url"` + Type *string `form:"type" json:"type"` } // Returns a list of VerificationSessions type IdentityVerificationSessionListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Status *string `form:"status"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Status *string `form:"status" json:"status"` } // A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). // // Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). type IdentityVerificationSessionCancelParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -133,7 +133,7 @@ type IdentityVerificationSessionCancelParams struct { // // [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). type IdentityVerificationSessionRedactParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // If present, this property tells you the last error encountered when processing the verification. diff --git a/invoice.go b/invoice.go index 0f8b522b91..3e0a0fac1e 100644 --- a/invoice.go +++ b/invoice.go @@ -111,164 +111,164 @@ const ( ) type InvoiceUpcomingAutomaticTaxParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } type InvoiceUpcomingCustomerDetailsShippingParams struct { - Address *AddressParams `form:"address"` - Name *string `form:"name"` - Phone *string `form:"phone"` + Address *AddressParams `form:"address" json:"address"` + Name *string `form:"name" json:"name"` + Phone *string `form:"phone" json:"phone"` } type InvoiceUpcomingCustomerDetailsTaxParams struct { - IPAddress *string `form:"ip_address"` + IPAddress *string `form:"ip_address" json:"ip_address"` } type InvoiceUpcomingCustomerDetailsTaxIDParams struct { - Type *string `form:"type"` - Value *string `form:"value"` + Type *string `form:"type" json:"type"` + Value *string `form:"value" json:"value"` } type InvoiceUpcomingCustomerDetailsParams struct { - Address *AddressParams `form:"address"` - Shipping *InvoiceUpcomingCustomerDetailsShippingParams `form:"shipping"` - Tax *InvoiceUpcomingCustomerDetailsTaxParams `form:"tax"` - TaxExempt *string `form:"tax_exempt"` - TaxIDs []*InvoiceUpcomingCustomerDetailsTaxIDParams `form:"tax_ids"` + Address *AddressParams `form:"address" json:"address"` + Shipping *InvoiceUpcomingCustomerDetailsShippingParams `form:"shipping" json:"shipping"` + Tax *InvoiceUpcomingCustomerDetailsTaxParams `form:"tax" json:"tax"` + TaxExempt *string `form:"tax_exempt" json:"tax_exempt"` + TaxIDs []*InvoiceUpcomingCustomerDetailsTaxIDParams `form:"tax_ids" json:"tax_ids"` } // InvoiceUpcomingInvoiceItemPeriodParams represents the period associated with that invoice item type InvoiceUpcomingInvoiceItemPeriodParams struct { - End *int64 `form:"end"` - Start *int64 `form:"start"` + End *int64 `form:"end" json:"end"` + Start *int64 `form:"start" json:"start"` } // InvoiceUpcomingInvoiceItemParams is the set of parameters that can be used when adding or modifying // invoice items on an upcoming invoice. // For more details see https://stripe.com/docs/api#upcoming_invoice-invoice_items. type InvoiceUpcomingInvoiceItemParams struct { - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - Discountable *bool `form:"discountable"` - Discounts []*InvoiceItemDiscountParams `form:"discounts"` - InvoiceItem *string `form:"invoiceitem"` - Period *InvoiceUpcomingInvoiceItemPeriodParams `form:"period"` - Price *string `form:"price"` - PriceData *InvoiceItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - Schedule *string `form:"schedule"` - TaxRates []*string `form:"tax_rates"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + Discountable *bool `form:"discountable" json:"discountable"` + Discounts []*InvoiceItemDiscountParams `form:"discounts" json:"discounts"` + InvoiceItem *string `form:"invoiceitem" json:"invoiceitem"` + Period *InvoiceUpcomingInvoiceItemPeriodParams `form:"period" json:"period"` + Price *string `form:"price" json:"price"` + PriceData *InvoiceItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + Schedule *string `form:"schedule" json:"schedule"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } type InvoiceAutomaticTaxParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // InvoiceCustomFieldParams represents the parameters associated with one custom field on an invoice. type InvoiceCustomFieldParams struct { - Name *string `form:"name"` - Value *string `form:"value"` + Name *string `form:"name" json:"name"` + Value *string `form:"value" json:"value"` } // InvoiceDiscountParams represents the parameters associated with the discounts to apply to an invoice. type InvoiceDiscountParams struct { - Coupon *string `form:"coupon"` - Discount *string `form:"discount"` + Coupon *string `form:"coupon" json:"coupon"` + Discount *string `form:"discount" json:"discount"` } // Additional fields for Mandate creation type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams struct { - TransactionType *string `form:"transaction_type"` + TransactionType *string `form:"transaction_type" json:"transaction_type"` } // If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitParams struct { - MandateOptions *InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"` - VerificationMethod *string `form:"verification_method"` + MandateOptions *InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options" json:"mandate_options"` + VerificationMethod *string `form:"verification_method" json:"verification_method"` } // InvoicePaymentSettingsPaymentMethodOptionsBancontactParams is the set of parameters allowed for // bancontact on payment_method_options on payment_settings on an invoice. type InvoicePaymentSettingsPaymentMethodOptionsBancontactParams struct { - PreferredLanguage *string `form:"preferred_language"` + PreferredLanguage *string `form:"preferred_language" json:"preferred_language"` } // InvoicePaymentSettingsPaymentMethodOptionsCardParams is the set of parameters allowed for // payment method options when using the card payment method. type InvoicePaymentSettingsPaymentMethodOptionsCardParams struct { - RequestThreeDSecure *string `form:"request_three_d_secure"` + RequestThreeDSecure *string `form:"request_three_d_secure" json:"request_three_d_secure"` } // InvoicePaymentSettingsPaymentMethodOptionsParams is the set of parameters allowed for // specific payment methods on an invoice's payment settings. type InvoicePaymentSettingsPaymentMethodOptionsParams struct { - ACSSDebit *InvoicePaymentSettingsPaymentMethodOptionsACSSDebitParams `form:"acss_debit"` - Bancontact *InvoicePaymentSettingsPaymentMethodOptionsBancontactParams `form:"bancontact"` - Card *InvoicePaymentSettingsPaymentMethodOptionsCardParams `form:"card"` + ACSSDebit *InvoicePaymentSettingsPaymentMethodOptionsACSSDebitParams `form:"acss_debit" json:"acss_debit"` + Bancontact *InvoicePaymentSettingsPaymentMethodOptionsBancontactParams `form:"bancontact" json:"bancontact"` + Card *InvoicePaymentSettingsPaymentMethodOptionsCardParams `form:"card" json:"card"` } // InvoicePaymentSettingsParams is the set of parameters allowed for the payment_settings on an invoice. type InvoicePaymentSettingsParams struct { - PaymentMethodOptions *InvoicePaymentSettingsPaymentMethodOptionsParams `form:"payment_method_options"` - PaymentMethodTypes []*string `form:"payment_method_types"` + PaymentMethodOptions *InvoicePaymentSettingsPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + PaymentMethodTypes []*string `form:"payment_method_types" json:"payment_method_types"` } // InvoiceTransferDataParams is the set of parameters allowed for the transfer_data hash. type InvoiceTransferDataParams struct { - Amount *int64 `form:"amount"` - Destination *string `form:"destination"` + Amount *int64 `form:"amount" json:"amount"` + Destination *string `form:"destination" json:"destination"` } // InvoiceParams is the set of parameters that can be used when creating or updating an invoice. // For more details see https://stripe.com/docs/api#create_invoice, https://stripe.com/docs/api#update_invoice. type InvoiceParams struct { - Params `form:"*"` - AccountTaxIDs []*string `form:"account_tax_ids"` - AutoAdvance *bool `form:"auto_advance"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - AutomaticTax *InvoiceAutomaticTaxParams `form:"automatic_tax"` - CollectionMethod *string `form:"collection_method"` - CustomFields []*InvoiceCustomFieldParams `form:"custom_fields"` - Customer *string `form:"customer"` - DaysUntilDue *int64 `form:"days_until_due"` - DefaultPaymentMethod *string `form:"default_payment_method"` - DefaultSource *string `form:"default_source"` - DefaultTaxRates []*string `form:"default_tax_rates"` - Description *string `form:"description"` - Discounts []*InvoiceDiscountParams `form:"discounts"` - DueDate *int64 `form:"due_date"` - Footer *string `form:"footer"` - OnBehalfOf *string `form:"on_behalf_of"` - Paid *bool `form:"paid"` - PaymentSettings *InvoicePaymentSettingsParams `form:"payment_settings"` - StatementDescriptor *string `form:"statement_descriptor"` - Subscription *string `form:"subscription"` - TransferData *InvoiceTransferDataParams `form:"transfer_data"` + Params `form:"*" json:"*"` + AccountTaxIDs []*string `form:"account_tax_ids" json:"account_tax_ids"` + AutoAdvance *bool `form:"auto_advance" json:"auto_advance"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + AutomaticTax *InvoiceAutomaticTaxParams `form:"automatic_tax" json:"automatic_tax"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + CustomFields []*InvoiceCustomFieldParams `form:"custom_fields" json:"custom_fields"` + Customer *string `form:"customer" json:"customer"` + DaysUntilDue *int64 `form:"days_until_due" json:"days_until_due"` + DefaultPaymentMethod *string `form:"default_payment_method" json:"default_payment_method"` + DefaultSource *string `form:"default_source" json:"default_source"` + DefaultTaxRates []*string `form:"default_tax_rates" json:"default_tax_rates"` + Description *string `form:"description" json:"description"` + Discounts []*InvoiceDiscountParams `form:"discounts" json:"discounts"` + DueDate *int64 `form:"due_date" json:"due_date"` + Footer *string `form:"footer" json:"footer"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + Paid *bool `form:"paid" json:"paid"` + PaymentSettings *InvoicePaymentSettingsParams `form:"payment_settings" json:"payment_settings"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + Subscription *string `form:"subscription" json:"subscription"` + TransferData *InvoiceTransferDataParams `form:"transfer_data" json:"transfer_data"` // These are all for exclusive use by GetNext. - Coupon *string `form:"coupon"` - CustomerDetails *InvoiceUpcomingCustomerDetailsParams `form:"customer_details"` - InvoiceItems []*InvoiceUpcomingInvoiceItemParams `form:"invoice_items"` - SubscriptionBillingCycleAnchor *int64 `form:"subscription_billing_cycle_anchor"` - SubscriptionBillingCycleAnchorNow *bool `form:"-"` // See custom AppendTo - SubscriptionBillingCycleAnchorUnchanged *bool `form:"-"` // See custom AppendTo - SubscriptionCancelAt *int64 `form:"subscription_cancel_at"` - SubscriptionCancelAtPeriodEnd *bool `form:"subscription_cancel_at_period_end"` - SubscriptionCancelNow *bool `form:"subscription_cancel_now"` - SubscriptionDefaultTaxRates []*string `form:"subscription_default_tax_rates"` - SubscriptionItems []*SubscriptionItemsParams `form:"subscription_items"` - SubscriptionPlan *string `form:"subscription_plan"` - SubscriptionProrationBehavior *string `form:"subscription_proration_behavior"` - SubscriptionProrationDate *int64 `form:"subscription_proration_date"` - SubscriptionQuantity *int64 `form:"subscription_quantity"` - SubscriptionStartDate *int64 `form:"subscription_start_date"` - SubscriptionTrialEnd *int64 `form:"subscription_trial_end"` - SubscriptionTrialEndNow *bool `form:"-"` // See custom AppendTo - SubscriptionTrialFromPlan *bool `form:"subscription_trial_from_plan"` + Coupon *string `form:"coupon" json:"coupon"` + CustomerDetails *InvoiceUpcomingCustomerDetailsParams `form:"customer_details" json:"customer_details"` + InvoiceItems []*InvoiceUpcomingInvoiceItemParams `form:"invoice_items" json:"invoice_items"` + SubscriptionBillingCycleAnchor *int64 `form:"subscription_billing_cycle_anchor" json:"subscription_billing_cycle_anchor"` + SubscriptionBillingCycleAnchorNow *bool `form:"-" json:"-"` // See custom AppendTo + SubscriptionBillingCycleAnchorUnchanged *bool `form:"-" json:"-"` // See custom AppendTo + SubscriptionCancelAt *int64 `form:"subscription_cancel_at" json:"subscription_cancel_at"` + SubscriptionCancelAtPeriodEnd *bool `form:"subscription_cancel_at_period_end" json:"subscription_cancel_at_period_end"` + SubscriptionCancelNow *bool `form:"subscription_cancel_now" json:"subscription_cancel_now"` + SubscriptionDefaultTaxRates []*string `form:"subscription_default_tax_rates" json:"subscription_default_tax_rates"` + SubscriptionItems []*SubscriptionItemsParams `form:"subscription_items" json:"subscription_items"` + SubscriptionPlan *string `form:"subscription_plan" json:"subscription_plan"` + SubscriptionProrationBehavior *string `form:"subscription_proration_behavior" json:"subscription_proration_behavior"` + SubscriptionProrationDate *int64 `form:"subscription_proration_date" json:"subscription_proration_date"` + SubscriptionQuantity *int64 `form:"subscription_quantity" json:"subscription_quantity"` + SubscriptionStartDate *int64 `form:"subscription_start_date" json:"subscription_start_date"` + SubscriptionTrialEnd *int64 `form:"subscription_trial_end" json:"subscription_trial_end"` + SubscriptionTrialEndNow *bool `form:"-" json:"-"` // See custom AppendTo + SubscriptionTrialFromPlan *bool `form:"subscription_trial_from_plan" json:"subscription_trial_from_plan"` } // AppendTo implements custom encoding logic for InvoiceParams so that the special @@ -291,62 +291,62 @@ func (p *InvoiceParams) AppendTo(body *form.Values, keyParts []string) { // InvoiceListParams is the set of parameters that can be used when listing invoices. // For more details see https://stripe.com/docs/api#list_customer_invoices. type InvoiceListParams struct { - ListParams `form:"*"` - CollectionMethod *string `form:"collection_method"` - Customer *string `form:"customer"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - DueDate *int64 `form:"due_date"` - DueDateRange *RangeQueryParams `form:"due_date"` - Status *string `form:"status"` - Subscription *string `form:"subscription"` + ListParams `form:"*" json:"*"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + Customer *string `form:"customer" json:"customer"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + DueDate *int64 `form:"due_date" json:"due_date"` + DueDateRange *RangeQueryParams `form:"due_date" json:"due_date"` + Status *string `form:"status" json:"status"` + Subscription *string `form:"subscription" json:"subscription"` } // InvoiceLineListParams is the set of parameters that can be used when listing invoice line items. // For more details see https://stripe.com/docs/api#invoice_lines. type InvoiceLineListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` - Customer *string `form:"customer"` + Customer *string `form:"customer" json:"customer"` // ID is the invoice ID to list invoice lines for. - ID *string `form:"-"` // Goes in the URL + ID *string `form:"-" json:"-"` // Goes in the URL - Subscription *string `form:"subscription"` + Subscription *string `form:"subscription" json:"subscription"` } // InvoiceFinalizeParams is the set of parameters that can be used when finalizing invoices. type InvoiceFinalizeParams struct { - Params `form:"*"` - AutoAdvance *bool `form:"auto_advance"` + Params `form:"*" json:"*"` + AutoAdvance *bool `form:"auto_advance" json:"auto_advance"` } // InvoiceMarkUncollectibleParams is the set of parameters that can be used when marking // invoices as uncollectible. type InvoiceMarkUncollectibleParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // InvoicePayParams is the set of parameters that can be used when // paying invoices. For more details, see: // https://stripe.com/docs/api#pay_invoice. type InvoicePayParams struct { - Params `form:"*"` - Forgive *bool `form:"forgive"` - OffSession *bool `form:"off_session"` - PaidOutOfBand *bool `form:"paid_out_of_band"` - PaymentMethod *string `form:"payment_method"` - Source *string `form:"source"` + Params `form:"*" json:"*"` + Forgive *bool `form:"forgive" json:"forgive"` + OffSession *bool `form:"off_session" json:"off_session"` + PaidOutOfBand *bool `form:"paid_out_of_band" json:"paid_out_of_band"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` + Source *string `form:"source" json:"source"` } // InvoiceSendParams is the set of parameters that can be used when sending invoices. type InvoiceSendParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // InvoiceVoidParams is the set of parameters that can be used when voiding invoices. type InvoiceVoidParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // Invoice is the resource representing a Stripe invoice. diff --git a/invoiceitem.go b/invoiceitem.go index 38e8269f97..fc93849a09 100644 --- a/invoiceitem.go +++ b/invoiceitem.go @@ -10,55 +10,55 @@ import "encoding/json" // InvoiceItemDiscountParams represents the parameters associated with the discounts to apply to an invoice item. type InvoiceItemDiscountParams struct { - Coupon *string `form:"coupon"` - Discount *string `form:"discount"` + Coupon *string `form:"coupon" json:"coupon"` + Discount *string `form:"discount" json:"discount"` } // InvoiceItemPeriodParams represents the period associated with that invoice item. type InvoiceItemPeriodParams struct { - End *int64 `form:"end"` - Start *int64 `form:"start"` + End *int64 `form:"end" json:"end"` + Start *int64 `form:"start" json:"start"` } // InvoiceItemPriceDataParams is a structure representing the parameters to create an inline price. type InvoiceItemPriceDataParams struct { - Currency *string `form:"currency"` - Product *string `form:"product"` - TaxBehavior *string `form:"tax_behavior"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Currency *string `form:"currency" json:"currency"` + Product *string `form:"product" json:"product"` + TaxBehavior *string `form:"tax_behavior" json:"tax_behavior"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // InvoiceItemParams is the set of parameters that can be used when creating or updating an invoice item. // For more details see https://stripe.com/docs/api#create_invoiceitem and https://stripe.com/docs/api#update_invoiceitem. type InvoiceItemParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Customer *string `form:"customer"` - Description *string `form:"description"` - Discountable *bool `form:"discountable"` - Discounts []*InvoiceItemDiscountParams `form:"discounts"` - Invoice *string `form:"invoice"` - Period *InvoiceItemPeriodParams `form:"period"` - Price *string `form:"price"` - PriceData *InvoiceItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - Subscription *string `form:"subscription"` - TaxRates []*string `form:"tax_rates"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"customer" json:"customer"` + Description *string `form:"description" json:"description"` + Discountable *bool `form:"discountable" json:"discountable"` + Discounts []*InvoiceItemDiscountParams `form:"discounts" json:"discounts"` + Invoice *string `form:"invoice" json:"invoice"` + Period *InvoiceItemPeriodParams `form:"period" json:"period"` + Price *string `form:"price" json:"price"` + PriceData *InvoiceItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + Subscription *string `form:"subscription" json:"subscription"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // InvoiceItemListParams is the set of parameters that can be used when listing invoice items. // For more details see https://stripe.com/docs/api#list_invoiceitems. type InvoiceItemListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` - Invoice *string `form:"invoice"` - Pending *bool `form:"pending"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer *string `form:"customer" json:"customer"` + Invoice *string `form:"invoice" json:"invoice"` + Pending *bool `form:"pending" json:"pending"` } // InvoiceItem is the resource represneting a Stripe invoice item. diff --git a/issuing/cardholder/client_test.go b/issuing/cardholder/client_test.go index 43e23e5101..05643ad405 100644 --- a/issuing/cardholder/client_test.go +++ b/issuing/cardholder/client_test.go @@ -90,18 +90,18 @@ func TestIssuingCardholderNew(t *testing.T) { // IssuingCardholderSpendingControlsSpendingLimitParams is the set of parameters that can be used to // represent a given spending limit for an issuing cardholder. type IssuingCardholderSpendingControlsSpendingLimitParams struct { - Amount *int64 `form:"amount"` - Categories []*string `form:"categories"` - Interval *string `form:"interval"` + Amount *int64 `form:"amount" json:"amount"` + Categories []*string `form:"categories" json:"categories"` + Interval *string `form:"interval" json:"interval"` } // IssuingCardholderSpendingControlsParams is the set of parameters that can be used to configure // the spending controls for an issuing cardholder type IssuingCardholderSpendingControlsParams struct { - AllowedCategories []*string `form:"allowed_categories"` - BlockedCategories []*string `form:"blocked_categories"` - SpendingLimits []*IssuingCardholderSpendingControlsSpendingLimitParams `form:"spending_limits"` - SpendingLimitsCurrency *string `form:"spending_limits_currency"` + AllowedCategories []*string `form:"allowed_categories" json:"allowed_categories"` + BlockedCategories []*string `form:"blocked_categories" json:"blocked_categories"` + SpendingLimits []*IssuingCardholderSpendingControlsSpendingLimitParams `form:"spending_limits" json:"spending_limits"` + SpendingLimitsCurrency *string `form:"spending_limits_currency" json:"spending_limits_currency"` } func TestIssuingCardholderUpdate(t *testing.T) { diff --git a/issuing_authorization.go b/issuing_authorization.go index 3cf944e35f..af83330192 100644 --- a/issuing_authorization.go +++ b/issuing_authorization.go @@ -93,28 +93,28 @@ const ( // IssuingAuthorizationParams is the set of parameters that can be used when updating an issuing authorization. type IssuingAuthorizationParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // IssuingAuthorizationApproveParams is the set of parameters that can be used when approving an issuing authorization. type IssuingAuthorizationApproveParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` } // IssuingAuthorizationDeclineParams is the set of parameters that can be used when declining an issuing authorization. type IssuingAuthorizationDeclineParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // IssuingAuthorizationListParams is the set of parameters that can be used when listing issuing authorizations. type IssuingAuthorizationListParams struct { - ListParams `form:"*"` - Card *string `form:"card"` - Cardholder *string `form:"cardholder"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Status *string `form:"status"` + ListParams `form:"*" json:"*"` + Card *string `form:"card" json:"card"` + Cardholder *string `form:"cardholder" json:"cardholder"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Status *string `form:"status" json:"status"` } // IssuingAuthorizationAmountDetails is the resource representing the breakdown of the amount. diff --git a/issuing_card.go b/issuing_card.go index a7c7bf6456..8320e32e00 100644 --- a/issuing_card.go +++ b/issuing_card.go @@ -105,56 +105,56 @@ const ( // IssuingCardShippingParams is the set of parameters that can be used for the shipping parameter. type IssuingCardShippingParams struct { - Address *AddressParams `form:"address"` - Name string `form:"name"` - Service *string `form:"service"` - Type *string `form:"type"` + Address *AddressParams `form:"address" json:"address"` + Name string `form:"name" json:"name"` + Service *string `form:"service" json:"service"` + Type *string `form:"type" json:"type"` } // IssuingCardSpendingControlsSpendingLimitParams is the set of parameters that can be used to // represent a given spending limit for an issuing card. type IssuingCardSpendingControlsSpendingLimitParams struct { - Amount *int64 `form:"amount"` - Categories []*string `form:"categories"` - Interval *string `form:"interval"` + Amount *int64 `form:"amount" json:"amount"` + Categories []*string `form:"categories" json:"categories"` + Interval *string `form:"interval" json:"interval"` } // IssuingCardSpendingControlsParams is the set of parameters that can be used to configure // the spending controls for an issuing card type IssuingCardSpendingControlsParams struct { - AllowedCategories []*string `form:"allowed_categories"` - BlockedCategories []*string `form:"blocked_categories"` - SpendingLimits []*IssuingCardSpendingControlsSpendingLimitParams `form:"spending_limits"` - SpendingLimitsCurrency *string `form:"spending_limits_currency"` + AllowedCategories []*string `form:"allowed_categories" json:"allowed_categories"` + BlockedCategories []*string `form:"blocked_categories" json:"blocked_categories"` + SpendingLimits []*IssuingCardSpendingControlsSpendingLimitParams `form:"spending_limits" json:"spending_limits"` + SpendingLimitsCurrency *string `form:"spending_limits_currency" json:"spending_limits_currency"` } // IssuingCardParams is the set of parameters that can be used when creating or updating an issuing card. type IssuingCardParams struct { - Params `form:"*"` - Cardholder *string `form:"cardholder"` - Currency *string `form:"currency"` - ReplacementFor *string `form:"replacement_for"` - ReplacementReason *string `form:"replacement_reason"` - SpendingControls *IssuingCardSpendingControlsParams `form:"spending_controls"` - Shipping *IssuingCardShippingParams `form:"shipping"` - Status *string `form:"status"` - Type *string `form:"type"` + Params `form:"*" json:"*"` + Cardholder *string `form:"cardholder" json:"cardholder"` + Currency *string `form:"currency" json:"currency"` + ReplacementFor *string `form:"replacement_for" json:"replacement_for"` + ReplacementReason *string `form:"replacement_reason" json:"replacement_reason"` + SpendingControls *IssuingCardSpendingControlsParams `form:"spending_controls" json:"spending_controls"` + Shipping *IssuingCardShippingParams `form:"shipping" json:"shipping"` + Status *string `form:"status" json:"status"` + Type *string `form:"type" json:"type"` // The following parameter is only supported when updating a card - CancellationReason *string `form:"cancellation_reason"` + CancellationReason *string `form:"cancellation_reason" json:"cancellation_reason"` } // IssuingCardListParams is the set of parameters that can be used when listing issuing cards. type IssuingCardListParams struct { - ListParams `form:"*"` - Cardholder *string `form:"cardholder"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - ExpMonth *int64 `form:"exp_month"` - ExpYear *int64 `form:"exp_year"` - Last4 *string `form:"last4"` - Status *string `form:"status"` - Type *string `form:"type"` + ListParams `form:"*" json:"*"` + Cardholder *string `form:"cardholder" json:"cardholder"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + ExpMonth *int64 `form:"exp_month" json:"exp_month"` + ExpYear *int64 `form:"exp_year" json:"exp_year"` + Last4 *string `form:"last4" json:"last4"` + Status *string `form:"status" json:"status"` + Type *string `form:"type" json:"type"` } // IssuingCardShipping is the resource representing shipping on an issuing card. diff --git a/issuing_cardholder.go b/issuing_cardholder.go index 9f76cb95ed..7d1582c186 100644 --- a/issuing_cardholder.go +++ b/issuing_cardholder.go @@ -54,84 +54,84 @@ const ( // IssuingCardholderBillingParams is the set of parameters that can be used for billing with the Issuing APIs. type IssuingCardholderBillingParams struct { - Address *AddressParams `form:"address"` + Address *AddressParams `form:"address" json:"address"` } // IssuingCardholderCompanyParams represents additional information about a company cardholder. type IssuingCardholderCompanyParams struct { - TaxID *string `form:"tax_id"` + TaxID *string `form:"tax_id" json:"tax_id"` } // IssuingCardholderIndividualDOBParams represents the date of birth of the // cardholder individual. type IssuingCardholderIndividualDOBParams struct { - Day *int64 `form:"day"` - Month *int64 `form:"month"` - Year *int64 `form:"year"` + Day *int64 `form:"day" json:"day"` + Month *int64 `form:"month" json:"month"` + Year *int64 `form:"year" json:"year"` } // IssuingCardholderIndividualVerificationDocumentParams represents an // identifying document, either a passport or local ID card. type IssuingCardholderIndividualVerificationDocumentParams struct { - Back *string `form:"back"` - Front *string `form:"front"` + Back *string `form:"back" json:"back"` + Front *string `form:"front" json:"front"` } // IssuingCardholderIndividualVerificationParams represents government-issued ID // document for this cardholder. type IssuingCardholderIndividualVerificationParams struct { - Document *IssuingCardholderIndividualVerificationDocumentParams `form:"document"` + Document *IssuingCardholderIndividualVerificationDocumentParams `form:"document" json:"document"` } // IssuingCardholderIndividualParams represents additional information about an // `individual` cardholder. type IssuingCardholderIndividualParams struct { - DOB *IssuingCardholderIndividualDOBParams `form:"dob"` - FirstName *string `form:"first_name"` - LastName *string `form:"last_name"` - Verification *IssuingCardholderIndividualVerificationParams `form:"verification"` + DOB *IssuingCardholderIndividualDOBParams `form:"dob" json:"dob"` + FirstName *string `form:"first_name" json:"first_name"` + LastName *string `form:"last_name" json:"last_name"` + Verification *IssuingCardholderIndividualVerificationParams `form:"verification" json:"verification"` } // IssuingCardholderSpendingControlsSpendingLimitParams is the set of parameters that can be used to // represent a given spending limit for an issuing cardholder. type IssuingCardholderSpendingControlsSpendingLimitParams struct { - Amount *int64 `form:"amount"` - Categories []*string `form:"categories"` - Interval *string `form:"interval"` + Amount *int64 `form:"amount" json:"amount"` + Categories []*string `form:"categories" json:"categories"` + Interval *string `form:"interval" json:"interval"` } // IssuingCardholderSpendingControlsParams is the set of parameters that can be used to configure // the spending controls for an issuing cardholder type IssuingCardholderSpendingControlsParams struct { - AllowedCategories []*string `form:"allowed_categories"` - BlockedCategories []*string `form:"blocked_categories"` - SpendingLimits []*IssuingCardholderSpendingControlsSpendingLimitParams `form:"spending_limits"` - SpendingLimitsCurrency *string `form:"spending_limits_currency"` + AllowedCategories []*string `form:"allowed_categories" json:"allowed_categories"` + BlockedCategories []*string `form:"blocked_categories" json:"blocked_categories"` + SpendingLimits []*IssuingCardholderSpendingControlsSpendingLimitParams `form:"spending_limits" json:"spending_limits"` + SpendingLimitsCurrency *string `form:"spending_limits_currency" json:"spending_limits_currency"` } // IssuingCardholderParams is the set of parameters that can be used when creating or updating an issuing cardholder. type IssuingCardholderParams struct { - Params `form:"*"` - Billing *IssuingCardholderBillingParams `form:"billing"` - Company *IssuingCardholderCompanyParams `form:"company"` - Email *string `form:"email"` - Individual *IssuingCardholderIndividualParams `form:"individual"` - Name *string `form:"name"` - PhoneNumber *string `form:"phone_number"` - SpendingControls *IssuingCardholderSpendingControlsParams `form:"spending_controls"` - Status *string `form:"status"` - Type *string `form:"type"` + Params `form:"*" json:"*"` + Billing *IssuingCardholderBillingParams `form:"billing" json:"billing"` + Company *IssuingCardholderCompanyParams `form:"company" json:"company"` + Email *string `form:"email" json:"email"` + Individual *IssuingCardholderIndividualParams `form:"individual" json:"individual"` + Name *string `form:"name" json:"name"` + PhoneNumber *string `form:"phone_number" json:"phone_number"` + SpendingControls *IssuingCardholderSpendingControlsParams `form:"spending_controls" json:"spending_controls"` + Status *string `form:"status" json:"status"` + Type *string `form:"type" json:"type"` } // IssuingCardholderListParams is the set of parameters that can be used when listing issuing cardholders. type IssuingCardholderListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Email *string `form:"email"` - PhoneNumber *string `form:"phone_number"` - Status *string `form:"status"` - Type *string `form:"type"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Email *string `form:"email" json:"email"` + PhoneNumber *string `form:"phone_number" json:"phone_number"` + Status *string `form:"status" json:"status"` + Type *string `form:"type" json:"type"` } // IssuingCardholderBilling is the resource representing the billing hash with the Issuing APIs. diff --git a/issuing_dispute.go b/issuing_dispute.go index 4342854c69..663808229e 100644 --- a/issuing_dispute.go +++ b/issuing_dispute.go @@ -84,99 +84,99 @@ const ( // IssuingDisputeEvidenceCanceledParams is the resource representing the evidence of an issuing dispute with a reason set to canceled. type IssuingDisputeEvidenceCanceledParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - CanceledAt *int64 `form:"canceled_at"` - CancellationPolicyProvided *bool `form:"cancellation_policy_provided"` - CancellationReason *string `form:"cancellation_reason"` - ExpectedAt *int64 `form:"expected_at"` - Explanation *string `form:"explanation"` - ProductDescription *string `form:"product_description"` - ProductType *string `form:"product_type"` - ReturnStatus *string `form:"return_status"` - ReturnedAt *int64 `form:"returned_at"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + CanceledAt *int64 `form:"canceled_at" json:"canceled_at"` + CancellationPolicyProvided *bool `form:"cancellation_policy_provided" json:"cancellation_policy_provided"` + CancellationReason *string `form:"cancellation_reason" json:"cancellation_reason"` + ExpectedAt *int64 `form:"expected_at" json:"expected_at"` + Explanation *string `form:"explanation" json:"explanation"` + ProductDescription *string `form:"product_description" json:"product_description"` + ProductType *string `form:"product_type" json:"product_type"` + ReturnStatus *string `form:"return_status" json:"return_status"` + ReturnedAt *int64 `form:"returned_at" json:"returned_at"` } // IssuingDisputeEvidenceDuplicateParams is the resource representing the evidence of an issuing dispute with a reason set to duplicate. type IssuingDisputeEvidenceDuplicateParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - CardStatement *string `form:"card_statement"` - CashReceipt *string `form:"cash_receipt"` - CheckImage *string `form:"check_image"` - Explanation *string `form:"explanation"` - OriginalTransaction *string `form:"original_transaction"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + CardStatement *string `form:"card_statement" json:"card_statement"` + CashReceipt *string `form:"cash_receipt" json:"cash_receipt"` + CheckImage *string `form:"check_image" json:"check_image"` + Explanation *string `form:"explanation" json:"explanation"` + OriginalTransaction *string `form:"original_transaction" json:"original_transaction"` } // IssuingDisputeEvidenceFraudulentParams is the resource representing the evidence of an issuing dispute with a reason set to fraudulent. type IssuingDisputeEvidenceFraudulentParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - Explanation *string `form:"explanation"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + Explanation *string `form:"explanation" json:"explanation"` } // IssuingDisputeEvidenceMerchandiseNotAsDescribedParams is the resource representing the evidence of an issuing dispute with a reason set to merchandise not as described. type IssuingDisputeEvidenceMerchandiseNotAsDescribedParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - Explanation *string `form:"explanation"` - ReceivedAt *int64 `form:"received_at"` - ReturnDescription *string `form:"return_description"` - ReturnStatus *string `form:"return_status"` - ReturnedAt *int64 `form:"returned_at"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + Explanation *string `form:"explanation" json:"explanation"` + ReceivedAt *int64 `form:"received_at" json:"received_at"` + ReturnDescription *string `form:"return_description" json:"return_description"` + ReturnStatus *string `form:"return_status" json:"return_status"` + ReturnedAt *int64 `form:"returned_at" json:"returned_at"` } // IssuingDisputeEvidenceNotReceivedParams is the resource representing the evidence of an issuing dispute with a reason set to not received. type IssuingDisputeEvidenceNotReceivedParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - ExpectedAt *int64 `form:"expected_at"` - Explanation *string `form:"explanation"` - ProductDescription *string `form:"product_description"` - ProductType *string `form:"product_type"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + ExpectedAt *int64 `form:"expected_at" json:"expected_at"` + Explanation *string `form:"explanation" json:"explanation"` + ProductDescription *string `form:"product_description" json:"product_description"` + ProductType *string `form:"product_type" json:"product_type"` } // IssuingDisputeEvidenceOtherParams is the resource representing the evidence of an issuing dispute with a reason set to other. type IssuingDisputeEvidenceOtherParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - Explanation *string `form:"explanation"` - ProductDescription *string `form:"product_description"` - ProductType *string `form:"product_type"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + Explanation *string `form:"explanation" json:"explanation"` + ProductDescription *string `form:"product_description" json:"product_description"` + ProductType *string `form:"product_type" json:"product_type"` } // IssuingDisputeEvidenceServiceNotAsDescribedParams is the resource representing the evidence of an issuing dispute with a reason set to service not as described. type IssuingDisputeEvidenceServiceNotAsDescribedParams struct { - AdditionalDocumentation *string `form:"additional_documentation"` - CanceledAt *int64 `form:"canceled_at"` - Explanation *string `form:"explanation"` - ProductDescription *string `form:"product_description"` - ProductType *string `form:"product_type"` + AdditionalDocumentation *string `form:"additional_documentation" json:"additional_documentation"` + CanceledAt *int64 `form:"canceled_at" json:"canceled_at"` + Explanation *string `form:"explanation" json:"explanation"` + ProductDescription *string `form:"product_description" json:"product_description"` + ProductType *string `form:"product_type" json:"product_type"` } // IssuingDisputeEvidenceParams is the set of parameters for the evidence on an issuing dispute type IssuingDisputeEvidenceParams struct { - Canceled *IssuingDisputeEvidenceCanceledParams `form:"canceled"` - Duplicate *IssuingDisputeEvidenceDuplicateParams `form:"duplicate"` - Fraudulent *IssuingDisputeEvidenceFraudulentParams `form:"fraudulent"` - MerchandiseNotAsDescribed *IssuingDisputeEvidenceMerchandiseNotAsDescribedParams `form:"merchandise_not_as_described"` - NotReceived *IssuingDisputeEvidenceNotReceivedParams `form:"not_received"` - Other *IssuingDisputeEvidenceOtherParams `form:"other"` - Reason *string `form:"reason"` - ServiceNotAsDescribed *IssuingDisputeEvidenceServiceNotAsDescribedParams `form:"service_not_as_described"` + Canceled *IssuingDisputeEvidenceCanceledParams `form:"canceled" json:"canceled"` + Duplicate *IssuingDisputeEvidenceDuplicateParams `form:"duplicate" json:"duplicate"` + Fraudulent *IssuingDisputeEvidenceFraudulentParams `form:"fraudulent" json:"fraudulent"` + MerchandiseNotAsDescribed *IssuingDisputeEvidenceMerchandiseNotAsDescribedParams `form:"merchandise_not_as_described" json:"merchandise_not_as_described"` + NotReceived *IssuingDisputeEvidenceNotReceivedParams `form:"not_received" json:"not_received"` + Other *IssuingDisputeEvidenceOtherParams `form:"other" json:"other"` + Reason *string `form:"reason" json:"reason"` + ServiceNotAsDescribed *IssuingDisputeEvidenceServiceNotAsDescribedParams `form:"service_not_as_described" json:"service_not_as_described"` } // IssuingDisputeParams is the set of parameters that can be used when creating or updating an issuing dispute. type IssuingDisputeParams struct { - Params `form:"*"` - Evidence *IssuingDisputeEvidenceParams `form:"evidence"` - Transaction *string `form:"transaction"` + Params `form:"*" json:"*"` + Evidence *IssuingDisputeEvidenceParams `form:"evidence" json:"evidence"` + Transaction *string `form:"transaction" json:"transaction"` } // IssuingDisputeListParams is the set of parameters that can be used when listing issuing dispute. type IssuingDisputeListParams struct { - ListParams `form:"*"` - Status *string `form:"status"` - Transaction *string `form:"transaction"` + ListParams `form:"*" json:"*"` + Status *string `form:"status" json:"status"` + Transaction *string `form:"transaction" json:"transaction"` } // IssuingDisputeSubmitParams is the set of parameters that can be used when submitting an issuing dispute. type IssuingDisputeSubmitParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // IssuingDisputeEvidenceCanceled is the resource representing the evidence of an issuing dispute with a reason set to canceled. diff --git a/issuing_transaction.go b/issuing_transaction.go index 6a31e39e4d..95ff66d3eb 100644 --- a/issuing_transaction.go +++ b/issuing_transaction.go @@ -50,17 +50,17 @@ const ( // IssuingTransactionParams is the set of parameters that can be used when creating or updating an issuing transaction. type IssuingTransactionParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // IssuingTransactionListParams is the set of parameters that can be used when listing issuing transactions. type IssuingTransactionListParams struct { - ListParams `form:"*"` - Card *string `form:"card"` - Cardholder *string `form:"cardholder"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Type *string `form:"type"` + ListParams `form:"*" json:"*"` + Card *string `form:"card" json:"card"` + Cardholder *string `form:"cardholder" json:"cardholder"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Type *string `form:"type" json:"type"` } // IssuingTransactionAmountDetails is the resource representing the breakdown of the amount. diff --git a/loginlink.go b/loginlink.go index c4acd04d4f..303aca1d07 100644 --- a/loginlink.go +++ b/loginlink.go @@ -9,9 +9,9 @@ package stripe // LoginLinkParams is the set of parameters that can be used when creating a login_link. // For more details see https://stripe.com/docs/api#create_login_link. type LoginLinkParams struct { - Params `form:"*" json:"*"` - Account *string `form:"-" json:"-"` // Included in URL - RedirectURL *string `form:"redirect_url" json:"redirect_url"` + Params `form:"*" json:"*" json:"*" json:"*"` + Account *string `form:"-" json:"-" json:"-" json:"-"` // Included in URL + RedirectURL *string `form:"redirect_url" json:"redirect_url" json:"redirect_url" json:"redirect_url"` } // LoginLink is the resource representing a login link for Express accounts. diff --git a/mandate.go b/mandate.go index 7a840ad791..06836feeae 100644 --- a/mandate.go +++ b/mandate.go @@ -73,7 +73,7 @@ type MandateType string // MandateParams is the set of parameters that can be used when retrieving a mandate. type MandateParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // MandateCustomerAcceptanceOffline represents details about the customer acceptance of an offline diff --git a/oauth.go b/oauth.go index 06c77d44db..f5da89d963 100644 --- a/oauth.go +++ b/oauth.go @@ -42,70 +42,70 @@ const ( // OAuthStripeUserParams for the stripe_user OAuth Authorize params. type OAuthStripeUserParams struct { - BlockKana *string `form:"block_kana" json:"block_kana"` - BlockKanji *string `form:"block_kanji" json:"block_kanji"` - BuildingKana *string `form:"building_kana" json:"building_kana"` - BuildingKanji *string `form:"building_kanji" json:"building_kanji"` - BusinessName *string `form:"business_name" json:"business_name"` - BusinessType *string `form:"business_type" json:"business_type"` - City *string `form:"city" json:"city"` - Country *string `form:"country" json:"country"` - Currency *string `form:"currency" json:"currency"` - DOBDay *int64 `form:"dob_day" json:"dob_day"` - DOBMonth *int64 `form:"dob_month" json:"dob_month"` - DOBYear *int64 `form:"dob_year" json:"dob_year"` - Email *string `form:"email" json:"email"` - FirstName *string `form:"first_name" json:"first_name"` - FirstNameKana *string `form:"first_name_kana" json:"first_name_kana"` - FirstNameKanji *string `form:"first_name_kanji" json:"first_name_kanji"` - Gender *string `form:"gender" json:"gender"` - LastName *string `form:"last_name" json:"last_name"` - LastNameKana *string `form:"last_name_kana" json:"last_name_kana"` - LastNameKanji *string `form:"last_name_kanji" json:"last_name_kanji"` - PhoneNumber *string `form:"phone_number" json:"phone_number"` - PhysicalProduct *bool `form:"physical_product" json:"physical_product"` - ProductDescription *string `form:"product_description" json:"product_description"` - State *string `form:"state" json:"state"` - StreetAddress *string `form:"street_address" json:"street_address"` - URL *string `form:"url" json:"url"` - Zip *string `form:"zip" json:"zip"` + BlockKana *string `form:"block_kana" json:"block_kana" json:"block_kana" json:"block_kana"` + BlockKanji *string `form:"block_kanji" json:"block_kanji" json:"block_kanji" json:"block_kanji"` + BuildingKana *string `form:"building_kana" json:"building_kana" json:"building_kana" json:"building_kana"` + BuildingKanji *string `form:"building_kanji" json:"building_kanji" json:"building_kanji" json:"building_kanji"` + BusinessName *string `form:"business_name" json:"business_name" json:"business_name" json:"business_name"` + BusinessType *string `form:"business_type" json:"business_type" json:"business_type" json:"business_type"` + City *string `form:"city" json:"city" json:"city" json:"city"` + Country *string `form:"country" json:"country" json:"country" json:"country"` + Currency *string `form:"currency" json:"currency" json:"currency" json:"currency"` + DOBDay *int64 `form:"dob_day" json:"dob_day" json:"dob_day" json:"dob_day"` + DOBMonth *int64 `form:"dob_month" json:"dob_month" json:"dob_month" json:"dob_month"` + DOBYear *int64 `form:"dob_year" json:"dob_year" json:"dob_year" json:"dob_year"` + Email *string `form:"email" json:"email" json:"email" json:"email"` + FirstName *string `form:"first_name" json:"first_name" json:"first_name" json:"first_name"` + FirstNameKana *string `form:"first_name_kana" json:"first_name_kana" json:"first_name_kana" json:"first_name_kana"` + FirstNameKanji *string `form:"first_name_kanji" json:"first_name_kanji" json:"first_name_kanji" json:"first_name_kanji"` + Gender *string `form:"gender" json:"gender" json:"gender" json:"gender"` + LastName *string `form:"last_name" json:"last_name" json:"last_name" json:"last_name"` + LastNameKana *string `form:"last_name_kana" json:"last_name_kana" json:"last_name_kana" json:"last_name_kana"` + LastNameKanji *string `form:"last_name_kanji" json:"last_name_kanji" json:"last_name_kanji" json:"last_name_kanji"` + PhoneNumber *string `form:"phone_number" json:"phone_number" json:"phone_number" json:"phone_number"` + PhysicalProduct *bool `form:"physical_product" json:"physical_product" json:"physical_product" json:"physical_product"` + ProductDescription *string `form:"product_description" json:"product_description" json:"product_description" json:"product_description"` + State *string `form:"state" json:"state" json:"state" json:"state"` + StreetAddress *string `form:"street_address" json:"street_address" json:"street_address" json:"street_address"` + URL *string `form:"url" json:"url" json:"url" json:"url"` + Zip *string `form:"zip" json:"zip" json:"zip" json:"zip"` } // AuthorizeURLParams for creating OAuth AuthorizeURLs. type AuthorizeURLParams struct { - Params `form:"*" json:"*"` - AlwaysPrompt *bool `form:"always_prompt" json:"always_prompt"` - ClientID *string `form:"client_id" json:"client_id"` - RedirectURI *string `form:"redirect_uri" json:"redirect_uri"` - ResponseType *string `form:"response_type" json:"response_type"` - Scope *string `form:"scope" json:"scope"` - State *string `form:"state" json:"state"` - StripeLanding *string `form:"stripe_landing" json:"stripe_landing"` - StripeUser *OAuthStripeUserParams `form:"stripe_user" json:"stripe_user"` - SuggestedCapabilities []*string `form:"suggested_capabilities" json:"suggested_capabilities"` + Params `form:"*" json:"*" json:"*" json:"*"` + AlwaysPrompt *bool `form:"always_prompt" json:"always_prompt" json:"always_prompt" json:"always_prompt"` + ClientID *string `form:"client_id" json:"client_id" json:"client_id" json:"client_id"` + RedirectURI *string `form:"redirect_uri" json:"redirect_uri" json:"redirect_uri" json:"redirect_uri"` + ResponseType *string `form:"response_type" json:"response_type" json:"response_type" json:"response_type"` + Scope *string `form:"scope" json:"scope" json:"scope" json:"scope"` + State *string `form:"state" json:"state" json:"state" json:"state"` + StripeLanding *string `form:"stripe_landing" json:"stripe_landing" json:"stripe_landing" json:"stripe_landing"` + StripeUser *OAuthStripeUserParams `form:"stripe_user" json:"stripe_user" json:"stripe_user" json:"stripe_user"` + SuggestedCapabilities []*string `form:"suggested_capabilities" json:"suggested_capabilities" json:"suggested_capabilities" json:"suggested_capabilities"` // Express is not sent as a parameter, but is used to modify the authorize URL // path to use the express OAuth path. - Express *bool `form:"-" json:"-"` + Express *bool `form:"-" json:"-" json:"-" json:"-"` } // DeauthorizeParams for deauthorizing an account. type DeauthorizeParams struct { - Params `form:"*" json:"*"` - ClientID *string `form:"client_id" json:"client_id"` - StripeUserID *string `form:"stripe_user_id" json:"stripe_user_id"` + Params `form:"*" json:"*" json:"*" json:"*"` + ClientID *string `form:"client_id" json:"client_id" json:"client_id" json:"client_id"` + StripeUserID *string `form:"stripe_user_id" json:"stripe_user_id" json:"stripe_user_id" json:"stripe_user_id"` } // OAuthTokenParams is the set of paramaters that can be used to request // OAuthTokens. type OAuthTokenParams struct { - Params `form:"*" json:"*"` - AssertCapabilities []*string `form:"assert_capabilities" json:"assert_capabilities"` - ClientSecret *string `form:"client_secret" json:"client_secret"` - Code *string `form:"code" json:"code"` - GrantType *string `form:"grant_type" json:"grant_type"` - RefreshToken *string `form:"refresh_token" json:"refresh_token"` - Scope *string `form:"scope" json:"scope"` + Params `form:"*" json:"*" json:"*" json:"*"` + AssertCapabilities []*string `form:"assert_capabilities" json:"assert_capabilities" json:"assert_capabilities" json:"assert_capabilities"` + ClientSecret *string `form:"client_secret" json:"client_secret" json:"client_secret" json:"client_secret"` + Code *string `form:"code" json:"code" json:"code" json:"code"` + GrantType *string `form:"grant_type" json:"grant_type" json:"grant_type" json:"grant_type"` + RefreshToken *string `form:"refresh_token" json:"refresh_token" json:"refresh_token" json:"refresh_token"` + Scope *string `form:"scope" json:"scope" json:"scope" json:"scope"` } // OAuthToken is the value of the OAuthToken from OAuth flow. diff --git a/order.go b/order.go index 6ee002cf72..1246db739a 100644 --- a/order.go +++ b/order.go @@ -58,37 +58,37 @@ type OrderItemParent struct { // OrderParams is the set of parameters that can be used when creating an order. type OrderParams struct { - Params `form:"*"` - Coupon *string `form:"coupon"` - Currency *string `form:"currency"` - Customer *string `form:"customer"` - Email *string `form:"email"` - Items []*OrderItemParams `form:"items"` - Shipping *ShippingParams `form:"shipping"` + Params `form:"*" json:"*"` + Coupon *string `form:"coupon" json:"coupon"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"customer" json:"customer"` + Email *string `form:"email" json:"email"` + Items []*OrderItemParams `form:"items" json:"items"` + Shipping *ShippingParams `form:"shipping" json:"shipping"` } // ShippingParams is the set of parameters that can be used for the shipping hash // on order creation. type ShippingParams struct { - Address *AddressParams `form:"address"` - Name *string `form:"name"` - Phone *string `form:"phone"` + Address *AddressParams `form:"address" json:"address"` + Name *string `form:"name" json:"name"` + Phone *string `form:"phone" json:"phone"` } // OrderUpdateParams is the set of parameters that can be used when updating an order. type OrderUpdateParams struct { - Params `form:"*"` - Coupon *string `form:"coupon"` - SelectedShippingMethod *string `form:"selected_shipping_method"` - Shipping *OrderUpdateShippingParams `form:"shipping"` - Status *string `form:"status"` + Params `form:"*" json:"*"` + Coupon *string `form:"coupon" json:"coupon"` + SelectedShippingMethod *string `form:"selected_shipping_method" json:"selected_shipping_method"` + Shipping *OrderUpdateShippingParams `form:"shipping" json:"shipping"` + Status *string `form:"status" json:"status"` } // OrderUpdateShippingParams is the set of parameters that can be used for the shipping // hash on order update. type OrderUpdateShippingParams struct { - Carrier *string `form:"carrier"` - TrackingNumber *string `form:"tracking_number"` + Carrier *string `form:"carrier" json:"carrier"` + TrackingNumber *string `form:"tracking_number" json:"tracking_number"` } // Shipping describes the shipping hash on an order. @@ -156,26 +156,26 @@ type OrderList struct { // OrderListParams is the set of parameters that can be used when listing orders. type OrderListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` - IDs []*string `form:"ids"` - Status *string `form:"status"` - StatusTransitions *StatusTransitionsFilterParams `form:"status_transitions"` - UpstreamIDs []*string `form:"upstream_ids"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer *string `form:"customer" json:"customer"` + IDs []*string `form:"ids" json:"ids"` + Status *string `form:"status" json:"status"` + StatusTransitions *StatusTransitionsFilterParams `form:"status_transitions" json:"status_transitions"` + UpstreamIDs []*string `form:"upstream_ids" json:"upstream_ids"` } // StatusTransitionsFilterParams are parameters that can used to filter on status_transition when listing orders. type StatusTransitionsFilterParams struct { - Canceled *int64 `form:"canceled"` - CanceledRange *RangeQueryParams `form:"canceled"` - Fulfilled *int64 `form:"fulfilled"` - FulfilledRange *RangeQueryParams `form:"fulfilled"` - Paid *int64 `form:"paid"` - PaidRange *RangeQueryParams `form:"paid"` - Returned *int64 `form:"returned"` - ReturnedRange *RangeQueryParams `form:"returned"` + Canceled *int64 `form:"canceled" json:"canceled"` + CanceledRange *RangeQueryParams `form:"canceled" json:"canceled"` + Fulfilled *int64 `form:"fulfilled" json:"fulfilled"` + FulfilledRange *RangeQueryParams `form:"fulfilled" json:"fulfilled"` + Paid *int64 `form:"paid" json:"paid"` + PaidRange *RangeQueryParams `form:"paid" json:"paid"` + Returned *int64 `form:"returned" json:"returned"` + ReturnedRange *RangeQueryParams `form:"returned" json:"returned"` } // StatusTransitions are the timestamps at which the order status was updated. @@ -188,21 +188,21 @@ type StatusTransitions struct { // OrderPayParams is the set of parameters that can be used when paying orders. type OrderPayParams struct { - Params `form:"*"` - ApplicationFee *int64 `form:"application_fee"` - Customer *string `form:"customer"` - Email *string `form:"email"` - Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" + Params `form:"*" json:"*"` + ApplicationFee *int64 `form:"application_fee" json:"application_fee"` + Customer *string `form:"customer" json:"customer"` + Email *string `form:"email" json:"email"` + Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" } // OrderItemParams is the set of parameters describing an order item on order creation or update. type OrderItemParams struct { - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - Parent *string `form:"parent"` - Quantity *int64 `form:"quantity"` - Type *string `form:"type"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + Parent *string `form:"parent" json:"parent"` + Quantity *int64 `form:"quantity" json:"quantity"` + Type *string `form:"type" json:"type"` } // OrderItem is the resource representing an order item. diff --git a/orderreturn.go b/orderreturn.go index a482629764..297f2b0722 100644 --- a/orderreturn.go +++ b/orderreturn.go @@ -4,9 +4,9 @@ import "encoding/json" // OrderReturnParams is the set of parameters that can be used when returning orders. type OrderReturnParams struct { - Params `form:"*"` - Items []*OrderItemParams `form:"items"` - Order *string `form:"-"` // Included in the URL + Params `form:"*" json:"*"` + Items []*OrderItemParams `form:"items" json:"items"` + Order *string `form:"-" json:"-"` // Included in the URL } // OrderReturn is the resource representing an order return. @@ -32,10 +32,10 @@ type OrderReturnList struct { // OrderReturnListParams is the set of parameters that can be used when listing order returns. type OrderReturnListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Order *string `form:"order"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Order *string `form:"order" json:"order"` } // UnmarshalJSON handles deserialization of an OrderReturn. diff --git a/params.go b/params.go index 24b61103aa..1a17fb2891 100644 --- a/params.go +++ b/params.go @@ -30,7 +30,7 @@ const ( // They're implemented as a custom type so that they can have their own // AppendTo implementation. type ExtraValues struct { - url.Values `form:"-" json:"-"` // See custom AppendTo implementation + url.Values `form:"-" json:"-" json:"-" json:"-"` // See custom AppendTo implementation } // AppendTo implements custom form encoding for extra parameter values. @@ -44,7 +44,7 @@ func (v ExtraValues) AppendTo(body *form.Values, keyParts []string) { // Filters is a structure that contains a collection of filters for list-related APIs. type Filters struct { - f []*filter `form:"-" json:"-"` // See custom AppendTo implementation + f []*filter `form:"-" json:"-" json:"-" json:"-"` // See custom AppendTo implementation } // AddFilter adds a new filter with a given key, op and value. @@ -106,26 +106,26 @@ type ListParams struct { // guarantee whether the operation was or was not completed on Stripe's API // servers. For certainty, you must either retry with the same idempotency // key or query the state of the API. - Context context.Context `form:"-" json:"-"` + Context context.Context `form:"-" json:"-" json:"-" json:"-"` - EndingBefore *string `form:"ending_before" json:"ending_before"` - Expand []*string `form:"expand" json:"expand"` - Filters Filters `form:"*" json:"*"` - Limit *int64 `form:"limit" json:"limit"` + EndingBefore *string `form:"ending_before" json:"ending_before" json:"ending_before" json:"ending_before"` + Expand []*string `form:"expand" json:"expand" json:"expand" json:"expand"` + Filters Filters `form:"*" json:"*" json:"*" json:"*"` + Limit *int64 `form:"limit" json:"limit" json:"limit" json:"limit"` // Single specifies whether this is a single page iterator. By default, // listing through an iterator will automatically grab additional pages as // the query progresses. To change this behavior and just load a single // page, set this to true. - Single bool `form:"-" json:"-"` // Not an API parameter + Single bool `form:"-" json:"-" json:"-" json:"-"` // Not an API parameter - StartingAfter *string `form:"starting_after" json:"starting_after"` + StartingAfter *string `form:"starting_after" json:"starting_after" json:"starting_after" json:"starting_after"` // StripeAccount may contain the ID of a connected account. By including // this field, the request is made as if it originated from the connected // account instead of under the account of the owner of the configured // Stripe key. - StripeAccount *string `form:"-" json:"-"` // Passed as header + StripeAccount *string `form:"-" json:"-" json:"-" json:"-"` // Passed as header } // AddExpand appends a new field to expand. @@ -181,22 +181,22 @@ type Params struct { // guarantee whether the operation was or was not completed on Stripe's API // servers. For certainty, you must either retry with the same idempotency // key or query the state of the API. - Context context.Context `form:"-" json:"-"` + Context context.Context `form:"-" json:"-" json:"-" json:"-"` - Expand []*string `form:"expand" json:"expand"` - Extra *ExtraValues `form:"*" json:"*"` + Expand []*string `form:"expand" json:"expand" json:"expand" json:"expand"` + Extra *ExtraValues `form:"*" json:"*" json:"*" json:"*"` // Headers may be used to provide extra header lines on the HTTP request. - Headers http.Header `form:"-" json:"-"` + Headers http.Header `form:"-" json:"-" json:"-" json:"-"` - IdempotencyKey *string `form:"-" json:"-"` // Passed as header - Metadata map[string]string `form:"metadata" json:"metadata"` + IdempotencyKey *string `form:"-" json:"-" json:"-" json:"-"` // Passed as header + Metadata map[string]string `form:"metadata" json:"metadata" json:"metadata" json:"metadata"` // StripeAccount may contain the ID of a connected account. By including // this field, the request is made as if it originated from the connected // account instead of under the account of the owner of the configured // Stripe key. - StripeAccount *string `form:"-" json:"-"` // Passed as header + StripeAccount *string `form:"-" json:"-" json:"-" json:"-"` // Passed as header } // AddExpand appends a new field to expand. @@ -251,18 +251,18 @@ type ParamsContainer interface { type RangeQueryParams struct { // GreaterThan specifies that values should be a greater than this // timestamp. - GreaterThan int64 `form:"gt" json:"gt"` + GreaterThan int64 `form:"gt" json:"gt" json:"gt" json:"gt"` // GreaterThanOrEqual specifies that values should be greater than or equal // to this timestamp. - GreaterThanOrEqual int64 `form:"gte" json:"gte"` + GreaterThanOrEqual int64 `form:"gte" json:"gte" json:"gte" json:"gte"` // LesserThan specifies that values should be lesser than this timetamp. - LesserThan int64 `form:"lt" json:"lt"` + LesserThan int64 `form:"lt" json:"lt" json:"lt" json:"lt"` // LesserThanOrEqual specifies that values should be lesser than or // equalthis timetamp. - LesserThanOrEqual int64 `form:"lte" json:"lte"` + LesserThanOrEqual int64 `form:"lte" json:"lte" json:"lte" json:"lte"` } // diff --git a/params_test.go b/params_test.go index d3b0955788..73582f24b5 100644 --- a/params_test.go +++ b/params_test.go @@ -12,7 +12,7 @@ import ( func TestRangeQueryParamsAppendTo(t *testing.T) { type testParams struct { - CreatedRange *stripe.RangeQueryParams `form:"created" json:"created"` + CreatedRange *stripe.RangeQueryParams `form:"created" json:"created" json:"created" json:"created"` } { @@ -68,8 +68,8 @@ func TestRangeQueryParamsAppendTo(t *testing.T) { } type testListParams struct { - stripe.ListParams `form:"*" json:"*"` - Field string `form:"field" json:"field"` + stripe.ListParams `form:"*" json:"*" json:"*" json:"*"` + Field string `form:"field" json:"field" json:"field" json:"field"` } func TestListParams_Nested(t *testing.T) { @@ -125,9 +125,9 @@ func TestParams_AppendTo_Extra(t *testing.T) { } type testParams struct { - stripe.Params `form:"*" json:"*"` - Field string `form:"field" json:"field"` - SubParams *testSubParams `form:"sub_params" json:"sub_params"` + stripe.Params `form:"*" json:"*" json:"*" json:"*"` + Field string `form:"field" json:"field" json:"field" json:"field"` + SubParams *testSubParams `form:"sub_params" json:"sub_params" json:"sub_params" json:"sub_params"` } // AppendTo is implemented for testParams so that we can verify that Params is @@ -137,8 +137,8 @@ func (p *testParams) AppendTo(body *form.Values, keyParts []string) { } type testSubParams struct { - stripe.Params `form:"*" json:"*"` - SubField string `form:"sub_field" json:"sub_field"` + stripe.Params `form:"*" json:"*" json:"*" json:"*"` + SubField string `form:"sub_field" json:"sub_field" json:"sub_field" json:"sub_field"` } func TestParams_AppendTo_Nested(t *testing.T) { diff --git a/paymentintent.go b/paymentintent.go index fd92ffb60f..ce4fe9e276 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -143,36 +143,36 @@ const ( // PaymentIntentCancelParams is the set of parameters that can be used when canceling a payment intent. type PaymentIntentCancelParams struct { - Params `form:"*"` - CancellationReason *string `form:"cancellation_reason"` + Params `form:"*" json:"*"` + CancellationReason *string `form:"cancellation_reason" json:"cancellation_reason"` } // PaymentIntentCaptureParams is the set of parameters that can be used when capturing a payment intent. type PaymentIntentCaptureParams struct { - Params `form:"*"` - AmountToCapture *int64 `form:"amount_to_capture"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - StatementDescriptor *string `form:"statement_descriptor"` - StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` - TransferData *PaymentIntentTransferDataParams `form:"transfer_data"` + Params `form:"*" json:"*"` + AmountToCapture *int64 `form:"amount_to_capture" json:"amount_to_capture"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + StatementDescriptorSuffix *string `form:"statement_descriptor_suffix" json:"statement_descriptor_suffix"` + TransferData *PaymentIntentTransferDataParams `form:"transfer_data" json:"transfer_data"` } // PaymentIntentConfirmParams is the set of parameters that can be used when confirming a payment intent. type PaymentIntentConfirmParams struct { - Params `form:"*"` - ErrorOnRequiresAction *bool `form:"error_on_requires_action"` - Mandate *string `form:"mandate"` - MandateData *PaymentIntentMandateDataParams `form:"mandate_data"` - OffSession *bool `form:"off_session"` - PaymentMethod *string `form:"payment_method"` - PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data"` - PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"` - PaymentMethodTypes []*string `form:"payment_method_types"` - ReceiptEmail *string `form:"receipt_email"` - ReturnURL *string `form:"return_url"` - SetupFutureUsage *string `form:"setup_future_usage"` - Shipping *ShippingDetailsParams `form:"shipping"` - UseStripeSDK *bool `form:"use_stripe_sdk"` + Params `form:"*" json:"*"` + ErrorOnRequiresAction *bool `form:"error_on_requires_action" json:"error_on_requires_action"` + Mandate *string `form:"mandate" json:"mandate"` + MandateData *PaymentIntentMandateDataParams `form:"mandate_data" json:"mandate_data"` + OffSession *bool `form:"off_session" json:"off_session"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` + PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data" json:"payment_method_data"` + PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + PaymentMethodTypes []*string `form:"payment_method_types" json:"payment_method_types"` + ReceiptEmail *string `form:"receipt_email" json:"receipt_email"` + ReturnURL *string `form:"return_url" json:"return_url"` + SetupFutureUsage *string `form:"setup_future_usage" json:"setup_future_usage"` + Shipping *ShippingDetailsParams `form:"shipping" json:"shipping"` + UseStripeSDK *bool `form:"use_stripe_sdk" json:"use_stripe_sdk"` } // PaymentIntentMandateDataCustomerAcceptanceOfflineParams is the set of parameters for the customer @@ -183,66 +183,66 @@ type PaymentIntentMandateDataCustomerAcceptanceOfflineParams struct { // PaymentIntentMandateDataCustomerAcceptanceOnlineParams is the set of parameters for the customer // acceptance of an online mandate. type PaymentIntentMandateDataCustomerAcceptanceOnlineParams struct { - IPAddress *string `form:"ip_address"` - UserAgent *string `form:"user_agent"` + IPAddress *string `form:"ip_address" json:"ip_address"` + UserAgent *string `form:"user_agent" json:"user_agent"` } // PaymentIntentMandateDataCustomerAcceptanceParams is the set of parameters for the customer // acceptance of a mandate. type PaymentIntentMandateDataCustomerAcceptanceParams struct { - AcceptedAt int64 `form:"accepted_at"` - Offline *PaymentIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline"` - Online *PaymentIntentMandateDataCustomerAcceptanceOnlineParams `form:"online"` - Type MandateCustomerAcceptanceType `form:"type"` + AcceptedAt int64 `form:"accepted_at" json:"accepted_at"` + Offline *PaymentIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline" json:"offline"` + Online *PaymentIntentMandateDataCustomerAcceptanceOnlineParams `form:"online" json:"online"` + Type MandateCustomerAcceptanceType `form:"type" json:"type"` } // PaymentIntentMandateDataParams is the set of parameters controlling the creation of the mandate // associated with this PaymentIntent. type PaymentIntentMandateDataParams struct { - CustomerAcceptance *PaymentIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"` + CustomerAcceptance *PaymentIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance" json:"customer_acceptance"` } // PaymentIntentPaymentMethodDataParams represents the type-specific parameters associated with a // payment method on payment intent. type PaymentIntentPaymentMethodDataParams struct { - ACSSDebit *PaymentMethodACSSDebitParams `form:"acss_debit"` - AfterpayClearpay *PaymentMethodAfterpayClearpayParams `form:"afterpay_clearpay"` - Alipay *PaymentMethodAlipayParams `form:"alipay"` - AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit"` - BillingDetails *BillingDetailsParams `form:"billing_details"` - Boleto *PaymentMethodBoletoParams `form:"boleto"` - Card *PaymentMethodCardParams `form:"card"` - EPS *PaymentMethodEPSParams `form:"eps"` - FPX *PaymentMethodFPXParams `form:"fpx"` - Grabpay *PaymentMethodGrabpayParams `form:"grabpay"` - Ideal *PaymentMethodIdealParams `form:"ideal"` - OXXO *PaymentMethodOXXOParams `form:"oxxo"` - P24 *PaymentMethodP24Params `form:"p24"` - SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit"` - WechatPay *PaymentMethodWechatPayParams `form:"sepa_debit"` - Type *string `form:"type"` + ACSSDebit *PaymentMethodACSSDebitParams `form:"acss_debit" json:"acss_debit"` + AfterpayClearpay *PaymentMethodAfterpayClearpayParams `form:"afterpay_clearpay" json:"afterpay_clearpay"` + Alipay *PaymentMethodAlipayParams `form:"alipay" json:"alipay"` + AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit" json:"au_becs_debit"` + BillingDetails *BillingDetailsParams `form:"billing_details" json:"billing_details"` + Boleto *PaymentMethodBoletoParams `form:"boleto" json:"boleto"` + Card *PaymentMethodCardParams `form:"card" json:"card"` + EPS *PaymentMethodEPSParams `form:"eps" json:"eps"` + FPX *PaymentMethodFPXParams `form:"fpx" json:"fpx"` + Grabpay *PaymentMethodGrabpayParams `form:"grabpay" json:"grabpay"` + Ideal *PaymentMethodIdealParams `form:"ideal" json:"ideal"` + OXXO *PaymentMethodOXXOParams `form:"oxxo" json:"oxxo"` + P24 *PaymentMethodP24Params `form:"p24" json:"p24"` + SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit" json:"sepa_debit"` + WechatPay *PaymentMethodWechatPayParams `form:"sepa_debit" json:"sepa_debit"` + Type *string `form:"type" json:"type"` } // PaymentIntentPaymentMethodOptionsACSSDebitMandateOptionsParams represents the mandate options // for ACSS on the payment intent. type PaymentIntentPaymentMethodOptionsACSSDebitMandateOptionsParams struct { - CustomMandateURL *string `form:"custom_mandate_url"` - IntervalDescription *string `form:"interval_description"` - PaymentSchedule *string `form:"payment_schedule"` - TransactionType *string `form:"transaction_type"` + CustomMandateURL *string `form:"custom_mandate_url" json:"custom_mandate_url"` + IntervalDescription *string `form:"interval_description" json:"interval_description"` + PaymentSchedule *string `form:"payment_schedule" json:"payment_schedule"` + TransactionType *string `form:"transaction_type" json:"transaction_type"` } // PaymentIntentPaymentMethodOptionsACSSDebitParams represents the ACSS debit-specific options // applieed to a PaymentIntent type PaymentIntentPaymentMethodOptionsACSSDebitParams struct { - MandateOptions *PaymentIntentPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"` - VerificationMethod *string `form:"verification_method"` + MandateOptions *PaymentIntentPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options" json:"mandate_options"` + VerificationMethod *string `form:"verification_method" json:"verification_method"` } // PaymentIntentPaymentMethodOptionsAfterpayClearpayParams represents the AfterpayClearpay-specific options // applied to a PaymentIntent. type PaymentIntentPaymentMethodOptionsAfterpayClearpayParams struct { - Reference *string `form:"reference"` + Reference *string `form:"reference" json:"reference"` } // PaymentIntentPaymentMethodOptionsAlipayParams represents the Alipay-specific options @@ -253,119 +253,119 @@ type PaymentIntentPaymentMethodOptionsAlipayParams struct { // PaymentIntentPaymentMethodOptionsBancontactParams represents the bancontact-specific options // applied to a PaymentIntent. type PaymentIntentPaymentMethodOptionsBancontactParams struct { - PreferredLanguage *string `form:"preferred_language"` + PreferredLanguage *string `form:"preferred_language" json:"preferred_language"` } // PaymentIntentPaymentMethodOptionsBoletoParams represents the boleto-specific options // applied to a PaymentIntent. type PaymentIntentPaymentMethodOptionsBoletoParams struct { - ExpiresAfterDays *int64 `form:"expires_after_days"` + ExpiresAfterDays *int64 `form:"expires_after_days" json:"expires_after_days"` } // PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams represents details about the // installment plan chosen for this payment intent. type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams struct { - Count *int64 `form:"count"` - Interval *string `form:"interval"` - Type *string `form:"type"` + Count *int64 `form:"count" json:"count"` + Interval *string `form:"interval" json:"interval"` + Type *string `form:"type" json:"type"` } // PaymentIntentPaymentMethodOptionsCardInstallmentsParams controls whether to enable installment // plans for this payment intent. type PaymentIntentPaymentMethodOptionsCardInstallmentsParams struct { - Enabled *bool `form:"enabled"` - Plan *PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams `form:"plan"` + Enabled *bool `form:"enabled" json:"enabled"` + Plan *PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams `form:"plan" json:"plan"` } // PaymentIntentPaymentMethodOptionsCardParams represents the card-specific options applied to a // PaymentIntent. type PaymentIntentPaymentMethodOptionsCardParams struct { - CVCToken *string `form:"cvc_token"` - Installments *PaymentIntentPaymentMethodOptionsCardInstallmentsParams `form:"installments"` - MOTO *bool `form:"moto"` - Network *string `form:"network"` - RequestThreeDSecure *string `form:"request_three_d_secure"` + CVCToken *string `form:"cvc_token" json:"cvc_token"` + Installments *PaymentIntentPaymentMethodOptionsCardInstallmentsParams `form:"installments" json:"installments"` + MOTO *bool `form:"moto" json:"moto"` + Network *string `form:"network" json:"network"` + RequestThreeDSecure *string `form:"request_three_d_secure" json:"request_three_d_secure"` } // PaymentIntentPaymentMethodOptionsOXXOParams represents the OXXO-specific options applied to a // PaymentIntent. type PaymentIntentPaymentMethodOptionsOXXOParams struct { - ExpiresAfterDays *int64 `form:"expires_after_days"` + ExpiresAfterDays *int64 `form:"expires_after_days" json:"expires_after_days"` } // PaymentIntentPaymentMethodOptionsSofortParams represents the sofort-specific options applied to a // PaymentIntent. type PaymentIntentPaymentMethodOptionsSofortParams struct { - PreferredLanguage *string `form:"preferred_language"` + PreferredLanguage *string `form:"preferred_language" json:"preferred_language"` } // PaymentIntentPaymentMethodOptionsWechatPayParams represents the wechat_pay-specific options applied to a // PaymentIntent. type PaymentIntentPaymentMethodOptionsWechatPayParams struct { - AppID *string `form:"app_id"` - Client *string `form:"client"` + AppID *string `form:"app_id" json:"app_id"` + Client *string `form:"client" json:"client"` } // PaymentIntentPaymentMethodOptionsParams represents the type-specific payment method options // applied to a PaymentIntent. type PaymentIntentPaymentMethodOptionsParams struct { - ACSSDebit *PaymentIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit"` - AfterpayClearpay *PaymentIntentPaymentMethodOptionsAfterpayClearpayParams `form:"afterpay_clearpay"` - Alipay *PaymentIntentPaymentMethodOptionsAlipayParams `form:"alipay"` - Bancontact *PaymentIntentPaymentMethodOptionsBancontactParams `form:"bancontact"` - Boleto *PaymentIntentPaymentMethodOptionsBoletoParams `form:"boleto"` - Card *PaymentIntentPaymentMethodOptionsCardParams `form:"card"` - OXXO *PaymentIntentPaymentMethodOptionsOXXOParams `form:"oxxo"` - Sofort *PaymentIntentPaymentMethodOptionsSofortParams `form:"sofort"` - WechatPay *PaymentIntentPaymentMethodOptionsWechatPayParams `form:"wechat_pay"` + ACSSDebit *PaymentIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit" json:"acss_debit"` + AfterpayClearpay *PaymentIntentPaymentMethodOptionsAfterpayClearpayParams `form:"afterpay_clearpay" json:"afterpay_clearpay"` + Alipay *PaymentIntentPaymentMethodOptionsAlipayParams `form:"alipay" json:"alipay"` + Bancontact *PaymentIntentPaymentMethodOptionsBancontactParams `form:"bancontact" json:"bancontact"` + Boleto *PaymentIntentPaymentMethodOptionsBoletoParams `form:"boleto" json:"boleto"` + Card *PaymentIntentPaymentMethodOptionsCardParams `form:"card" json:"card"` + OXXO *PaymentIntentPaymentMethodOptionsOXXOParams `form:"oxxo" json:"oxxo"` + Sofort *PaymentIntentPaymentMethodOptionsSofortParams `form:"sofort" json:"sofort"` + WechatPay *PaymentIntentPaymentMethodOptionsWechatPayParams `form:"wechat_pay" json:"wechat_pay"` } // PaymentIntentTransferDataParams is the set of parameters allowed for the transfer hash. type PaymentIntentTransferDataParams struct { - Amount *int64 `form:"amount"` - Destination *string `form:"destination"` + Amount *int64 `form:"amount" json:"amount"` + Destination *string `form:"destination" json:"destination"` } // PaymentIntentParams is the set of parameters that can be used when handling a payment intent. type PaymentIntentParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - CaptureMethod *string `form:"capture_method"` - Confirm *bool `form:"confirm"` - ConfirmationMethod *string `form:"confirmation_method"` - Currency *string `form:"currency"` - Customer *string `form:"customer"` - Description *string `form:"description"` - Mandate *string `form:"mandate"` - MandateData *PaymentIntentMandateDataParams `form:"mandate_data"` - OnBehalfOf *string `form:"on_behalf_of"` - PaymentMethod *string `form:"payment_method"` - PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data"` - PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"` - PaymentMethodTypes []*string `form:"payment_method_types"` - ReceiptEmail *string `form:"receipt_email"` - ReturnURL *string `form:"return_url"` - SetupFutureUsage *string `form:"setup_future_usage"` - Shipping *ShippingDetailsParams `form:"shipping"` - StatementDescriptor *string `form:"statement_descriptor"` - StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` - TransferData *PaymentIntentTransferDataParams `form:"transfer_data"` - TransferGroup *string `form:"transfer_group"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + CaptureMethod *string `form:"capture_method" json:"capture_method"` + Confirm *bool `form:"confirm" json:"confirm"` + ConfirmationMethod *string `form:"confirmation_method" json:"confirmation_method"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"customer" json:"customer"` + Description *string `form:"description" json:"description"` + Mandate *string `form:"mandate" json:"mandate"` + MandateData *PaymentIntentMandateDataParams `form:"mandate_data" json:"mandate_data"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` + PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data" json:"payment_method_data"` + PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + PaymentMethodTypes []*string `form:"payment_method_types" json:"payment_method_types"` + ReceiptEmail *string `form:"receipt_email" json:"receipt_email"` + ReturnURL *string `form:"return_url" json:"return_url"` + SetupFutureUsage *string `form:"setup_future_usage" json:"setup_future_usage"` + Shipping *ShippingDetailsParams `form:"shipping" json:"shipping"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + StatementDescriptorSuffix *string `form:"statement_descriptor_suffix" json:"statement_descriptor_suffix"` + TransferData *PaymentIntentTransferDataParams `form:"transfer_data" json:"transfer_data"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` // Those parameters only works if you confirm on creation. - ErrorOnRequiresAction *bool `form:"error_on_requires_action"` - OffSession *bool `form:"off_session"` - UseStripeSDK *bool `form:"use_stripe_sdk"` + ErrorOnRequiresAction *bool `form:"error_on_requires_action" json:"error_on_requires_action"` + OffSession *bool `form:"off_session" json:"off_session"` + UseStripeSDK *bool `form:"use_stripe_sdk" json:"use_stripe_sdk"` } // PaymentIntentListParams is the set of parameters that can be used when listing payment intents. // For more details see https://stripe.com/docs/api#list_payouts. type PaymentIntentListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer *string `form:"customer" json:"customer"` } // PaymentIntentNextActionAlipayHandleRedirect represents the resource for the next action of type diff --git a/paymentmethod.go b/paymentmethod.go index d147b69065..b7edee40f4 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -88,17 +88,17 @@ const ( // BillingDetailsParams is the set of parameters that can be used as billing details // when creating or updating a PaymentMethod type BillingDetailsParams struct { - Address *AddressParams `form:"address"` - Email *string `form:"email"` - Name *string `form:"name"` - Phone *string `form:"phone"` + Address *AddressParams `form:"address" json:"address"` + Email *string `form:"email" json:"email"` + Name *string `form:"name" json:"name"` + Phone *string `form:"phone" json:"phone"` } // PaymentMethodACSSDebitParams TODO type PaymentMethodACSSDebitParams struct { - AccountNumber *string `form:"account_number"` - InstitutionNumber *string `form:"institution_number"` - TransitNumber *string `form:"transit_number"` + AccountNumber *string `form:"account_number" json:"account_number"` + InstitutionNumber *string `form:"institution_number" json:"institution_number"` + TransitNumber *string `form:"transit_number" json:"transit_number"` } // PaymentMethodAfterpayClearpayParams is the set of parameters allowed for the @@ -113,14 +113,14 @@ type PaymentMethodAlipayParams struct { // PaymentMethodAUBECSDebitParams is the set of parameters allowed for the `AUBECSDebit` hash when creating a // PaymentMethod of type AUBECSDebit. type PaymentMethodAUBECSDebitParams struct { - AccountNumber *string `form:"account_number"` - BSBNumber *string `form:"bsb_number"` + AccountNumber *string `form:"account_number" json:"account_number"` + BSBNumber *string `form:"bsb_number" json:"bsb_number"` } // PaymentMethodBACSDebitParams is the set of parameters allowed for BACS Debit payment method. type PaymentMethodBACSDebitParams struct { - AccountNumber *string `form:"account_number"` - SortCode *string `form:"sort_code"` + AccountNumber *string `form:"account_number" json:"account_number"` + SortCode *string `form:"sort_code" json:"sort_code"` } // PaymentMethodBancontactParams is the set of parameters allowed for the `bancontact` hash when creating a @@ -131,30 +131,30 @@ type PaymentMethodBancontactParams struct { // PaymentMethodBoletoParams is the set of parameters allowed for the `boleto` hash when creating a // PaymentMethod of type Boleto type PaymentMethodBoletoParams struct { - TaxID *string `form:"tax_id"` + TaxID *string `form:"tax_id" json:"tax_id"` } // PaymentMethodCardParams is the set of parameters allowed for the `card` hash when creating a // PaymentMethod of type card. type PaymentMethodCardParams struct { - CVC *string `form:"cvc"` - ExpMonth *string `form:"exp_month"` - ExpYear *string `form:"exp_year"` - Number *string `form:"number"` - Token *string `form:"token"` + CVC *string `form:"cvc" json:"cvc"` + ExpMonth *string `form:"exp_month" json:"exp_month"` + ExpYear *string `form:"exp_year" json:"exp_year"` + Number *string `form:"number" json:"number"` + Token *string `form:"token" json:"token"` } // PaymentMethodEPSParams is the set of parameters allowed for the `eps` hash when creating a // PaymentMethod of type EPS. type PaymentMethodEPSParams struct { - Bank *string `form:"bank"` + Bank *string `form:"bank" json:"bank"` } // PaymentMethodFPXParams is the set of parameters allowed for the `fpx` hash when creating a // PaymentMethod of type fpx. type PaymentMethodFPXParams struct { - AccountHolderType *string `form:"account_holder_type"` - Bank *string `form:"bank"` + AccountHolderType *string `form:"account_holder_type" json:"account_holder_type"` + Bank *string `form:"bank" json:"bank"` } // PaymentMethodGiropayParams is the set of parameters allowed for the `giropay` hash when creating a @@ -170,7 +170,7 @@ type PaymentMethodGrabpayParams struct { // PaymentMethodIdealParams is the set of parameters allowed for the `ideal` hash when creating a // PaymentMethod of type ideal. type PaymentMethodIdealParams struct { - Bank *string `form:"bank"` + Bank *string `form:"bank" json:"bank"` } // PaymentMethodInteracPresentParams is the set of parameters allowed for the `interac_present` hash when creating a @@ -186,20 +186,20 @@ type PaymentMethodOXXOParams struct { // PaymentMethodP24Params is the set of parameters allowed for the `p24` hash when creating a // PaymentMethod of type P24. type PaymentMethodP24Params struct { - Bank *string `form:"bank"` - TOSShownAndAccepted *bool `form:"tos_shown_and_accepted"` + Bank *string `form:"bank" json:"bank"` + TOSShownAndAccepted *bool `form:"tos_shown_and_accepted" json:"tos_shown_and_accepted"` } // PaymentMethodSepaDebitParams is the set of parameters allowed for the `sepa_debit` hash when // creating a PaymentMethod of type sepa_debit. type PaymentMethodSepaDebitParams struct { - Iban *string `form:"iban"` + Iban *string `form:"iban" json:"iban"` } // PaymentMethodSofortParams is the set of parameters allowed for the `sofort` hash when // creating a PaymentMethod of type sofort. type PaymentMethodSofortParams struct { - Country *string `form:"country"` + Country *string `form:"country" json:"country"` } // PaymentMethodWechatPayParams is the set of parameters allowed for the `wechat_pay` hash when @@ -209,52 +209,52 @@ type PaymentMethodWechatPayParams struct{} // PaymentMethodParams is the set of parameters that can be used when creating or updating a // PaymentMethod. type PaymentMethodParams struct { - Params `form:"*"` - ACSSDebit *PaymentMethodACSSDebitParams `form:"acss_debit"` - AfterpayClearpay *PaymentMethodAfterpayClearpayParams `form:"afterpay_clearpay"` - Alipay *PaymentMethodAlipayParams `form:"alipay"` - AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit"` - BACSDebit *PaymentMethodBACSDebitParams `form:"bacs_debit"` - Bancontact *PaymentMethodBancontactParams `form:"bancontact"` - Boleto *PaymentMethodBoletoParams `form:"boleto"` - BillingDetails *BillingDetailsParams `form:"billing_details"` - Card *PaymentMethodCardParams `form:"card"` - EPS *PaymentMethodEPSParams `form:"eps"` - FPX *PaymentMethodFPXParams `form:"fpx"` - Giropay *PaymentMethodGiropayParams `form:"giropay"` - Grabpay *PaymentMethodGrabpayParams `form:"grabpay"` - Ideal *PaymentMethodIdealParams `form:"ideal"` - InteracPresent *PaymentMethodInteracPresentParams `form:"interac_present"` - OXXO *PaymentMethodOXXOParams `form:"oxxo"` - P24 *PaymentMethodP24Params `form:"p24"` - SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit"` - Sofort *PaymentMethodSofortParams `form:"sofort"` - WechatPay *PaymentMethodWechatPayParams `form:"wechat_pay"` - Type *string `form:"type"` + Params `form:"*" json:"*"` + ACSSDebit *PaymentMethodACSSDebitParams `form:"acss_debit" json:"acss_debit"` + AfterpayClearpay *PaymentMethodAfterpayClearpayParams `form:"afterpay_clearpay" json:"afterpay_clearpay"` + Alipay *PaymentMethodAlipayParams `form:"alipay" json:"alipay"` + AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit" json:"au_becs_debit"` + BACSDebit *PaymentMethodBACSDebitParams `form:"bacs_debit" json:"bacs_debit"` + Bancontact *PaymentMethodBancontactParams `form:"bancontact" json:"bancontact"` + Boleto *PaymentMethodBoletoParams `form:"boleto" json:"boleto"` + BillingDetails *BillingDetailsParams `form:"billing_details" json:"billing_details"` + Card *PaymentMethodCardParams `form:"card" json:"card"` + EPS *PaymentMethodEPSParams `form:"eps" json:"eps"` + FPX *PaymentMethodFPXParams `form:"fpx" json:"fpx"` + Giropay *PaymentMethodGiropayParams `form:"giropay" json:"giropay"` + Grabpay *PaymentMethodGrabpayParams `form:"grabpay" json:"grabpay"` + Ideal *PaymentMethodIdealParams `form:"ideal" json:"ideal"` + InteracPresent *PaymentMethodInteracPresentParams `form:"interac_present" json:"interac_present"` + OXXO *PaymentMethodOXXOParams `form:"oxxo" json:"oxxo"` + P24 *PaymentMethodP24Params `form:"p24" json:"p24"` + SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit" json:"sepa_debit"` + Sofort *PaymentMethodSofortParams `form:"sofort" json:"sofort"` + WechatPay *PaymentMethodWechatPayParams `form:"wechat_pay" json:"wechat_pay"` + Type *string `form:"type" json:"type"` // The following parameters are used when cloning a PaymentMethod to the connected account - Customer *string `form:"customer"` - PaymentMethod *string `form:"payment_method"` + Customer *string `form:"customer" json:"customer"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` } // PaymentMethodAttachParams is the set of parameters that can be used when attaching a // PaymentMethod to a Customer. type PaymentMethodAttachParams struct { - Params `form:"*"` - Customer *string `form:"customer"` + Params `form:"*" json:"*"` + Customer *string `form:"customer" json:"customer"` } // PaymentMethodDetachParams is the set of parameters that can be used when detaching a // PaymentMethod. type PaymentMethodDetachParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // PaymentMethodListParams is the set of parameters that can be used when listing PaymentMethods. type PaymentMethodListParams struct { - ListParams `form:"*"` - Customer *string `form:"customer"` - Type *string `form:"type"` + ListParams `form:"*" json:"*"` + Customer *string `form:"customer" json:"customer"` + Type *string `form:"type" json:"type"` } // BillingDetails represents the billing details associated with a PaymentMethod. diff --git a/paymentsource.go b/paymentsource.go index 752493903d..7eade8aced 100644 --- a/paymentsource.go +++ b/paymentsource.go @@ -21,8 +21,8 @@ const ( // SourceParams is a union struct used to describe an // arbitrary payment source. type SourceParams struct { - Card *CardParams `form:"-" json:"-"` - Token *string `form:"source" json:"source"` + Card *CardParams `form:"-" json:"-" json:"-" json:"-"` + Token *string `form:"source" json:"source" json:"source" json:"source"` } // AppendTo implements custom encoding logic for SourceParams. @@ -36,18 +36,18 @@ func (p *SourceParams) AppendTo(body *form.Values, keyParts []string) { // Customer object's payment sources. // For more details see https://stripe.com/docs/api#sources type CustomerSourceParams struct { - Params `form:"*" json:"*"` - Customer *string `form:"-" json:"-"` // Goes in the URL - Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" + Params `form:"*" json:"*" json:"*" json:"*"` + Customer *string `form:"-" json:"-" json:"-" json:"-"` // Goes in the URL + Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" } // SourceVerifyParams are used to verify a customer source // For more details see https://stripe.com/docs/guides/ach-beta type SourceVerifyParams struct { - Params `form:"*" json:"*"` - Amounts [2]int64 `form:"amounts" json:"amounts"` // Amounts is used when verifying bank accounts - Customer *string `form:"-" json:"-"` // Goes in the URL - Values []*string `form:"values" json:"values"` // Values is used when verifying sources + Params `form:"*" json:"*" json:"*" json:"*"` + Amounts [2]int64 `form:"amounts" json:"amounts" json:"amounts" json:"amounts"` // Amounts is used when verifying bank accounts + Customer *string `form:"-" json:"-" json:"-" json:"-"` // Goes in the URL + Values []*string `form:"values" json:"values" json:"values" json:"values"` // Values is used when verifying sources } // SetSource adds valid sources to a CustomerSourceParams object, @@ -105,8 +105,8 @@ type SourceList struct { // SourceListParams are used to enumerate the payment sources that are attached // to a Customer. type SourceListParams struct { - ListParams `form:"*" json:"*"` - Customer *string `form:"-" json:"-"` // Handled in URL + ListParams `form:"*" json:"*" json:"*" json:"*"` + Customer *string `form:"-" json:"-" json:"-" json:"-"` // Handled in URL } // UnmarshalJSON handles deserialization of a PaymentSource. diff --git a/payout.go b/payout.go index 8a0e588b16..9063e62dcd 100644 --- a/payout.go +++ b/payout.go @@ -77,31 +77,31 @@ const ( // PayoutParams is the set of parameters that can be used when creating or updating a payout. // For more details see https://stripe.com/docs/api#create_payout and https://stripe.com/docs/api#update_payout. type PayoutParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - Destination *string `form:"destination"` - Method *string `form:"method"` - SourceType *string `form:"source_type"` - StatementDescriptor *string `form:"statement_descriptor"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + Destination *string `form:"destination" json:"destination"` + Method *string `form:"method" json:"method"` + SourceType *string `form:"source_type" json:"source_type"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` } // PayoutListParams is the set of parameters that can be used when listing payouts. // For more details see https://stripe.com/docs/api#list_payouts. type PayoutListParams struct { - ListParams `form:"*"` - ArrivalDate *int64 `form:"arrival_date"` - ArrivalDateRange *RangeQueryParams `form:"arrival_date"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Destination *string `form:"destination"` - Status *string `form:"status"` + ListParams `form:"*" json:"*"` + ArrivalDate *int64 `form:"arrival_date" json:"arrival_date"` + ArrivalDateRange *RangeQueryParams `form:"arrival_date" json:"arrival_date"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Destination *string `form:"destination" json:"destination"` + Status *string `form:"status" json:"status"` } // PayoutReverseParams is the set of parameters that can be used when reversing a payout. type PayoutReverseParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // PayoutDestination describes the destination of a Payout. diff --git a/person.go b/person.go index 93547979e0..3bc0d533fd 100644 --- a/person.go +++ b/person.go @@ -56,94 +56,94 @@ const ( // DOBParams represents a DOB during account creation/updates. type DOBParams struct { - Day *int64 `form:"day"` - Month *int64 `form:"month"` - Year *int64 `form:"year"` + Day *int64 `form:"day" json:"day"` + Month *int64 `form:"month" json:"month"` + Year *int64 `form:"year" json:"year"` } type DocumentsCompanyAuthorizationParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } type DocumentsPassportParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } type DocumentsVisaParams struct { - Files []*string `form:"files"` + Files []*string `form:"files" json:"files"` } type DocumentsParams struct { - CompanyAuthorization *DocumentsCompanyAuthorizationParams `form:"company_authorization"` - Passport *DocumentsPassportParams `form:"passport"` - Visa *DocumentsVisaParams `form:"visa"` + CompanyAuthorization *DocumentsCompanyAuthorizationParams `form:"company_authorization" json:"company_authorization"` + Passport *DocumentsPassportParams `form:"passport" json:"passport"` + Visa *DocumentsVisaParams `form:"visa" json:"visa"` } // RelationshipParams is used to set the relationship between an account and a person. type RelationshipParams struct { - Director *bool `form:"director"` - Executive *bool `form:"executive"` - Owner *bool `form:"owner"` - PercentOwnership *float64 `form:"percent_ownership"` - Representative *bool `form:"representative"` - Title *string `form:"title"` + Director *bool `form:"director" json:"director"` + Executive *bool `form:"executive" json:"executive"` + Owner *bool `form:"owner" json:"owner"` + PercentOwnership *float64 `form:"percent_ownership" json:"percent_ownership"` + Representative *bool `form:"representative" json:"representative"` + Title *string `form:"title" json:"title"` } // PersonVerificationDocumentParams represents the parameters available for the document verifying // a person's identity. type PersonVerificationDocumentParams struct { - Back *string `form:"back"` - Front *string `form:"front"` + Back *string `form:"back" json:"back"` + Front *string `form:"front" json:"front"` } // PersonVerificationParams is used to represent parameters associated with a person's verification // details. type PersonVerificationParams struct { - AdditionalDocument *PersonVerificationDocumentParams `form:"additional_document"` - Document *PersonVerificationDocumentParams `form:"document"` + AdditionalDocument *PersonVerificationDocumentParams `form:"additional_document" json:"additional_document"` + Document *PersonVerificationDocumentParams `form:"document" json:"document"` } // PersonParams is the set of parameters that can be used when creating or updating a person. // For more details see https://stripe.com/docs/api#create_person. type PersonParams struct { - Params `form:"*"` - Account *string `form:"-"` // Included in URL - Address *AccountAddressParams `form:"address"` - AddressKana *AccountAddressParams `form:"address_kana"` - AddressKanji *AccountAddressParams `form:"address_kanji"` - DOB *DOBParams `form:"dob"` - Documents *DocumentsParams `form:"documents"` - Email *string `form:"email"` - FirstName *string `form:"first_name"` - FirstNameKana *string `form:"first_name_kana"` - FirstNameKanji *string `form:"first_name_kanji"` - FullNameAliases []*string `form:"full_name_aliases"` - Gender *string `form:"gender"` - IDNumber *string `form:"id_number"` - LastName *string `form:"last_name"` - LastNameKana *string `form:"last_name_kana"` - LastNameKanji *string `form:"last_name_kanji"` - MaidenName *string `form:"maiden_name"` - Nationality *string `form:"nationality"` - PersonToken *string `form:"person_token"` - Phone *string `form:"phone"` - PoliticalExposure *string `form:"political_exposure"` - Relationship *RelationshipParams `form:"relationship"` - SSNLast4 *string `form:"ssn_last_4"` - Verification *PersonVerificationParams `form:"verification"` + Params `form:"*" json:"*"` + Account *string `form:"-" json:"-"` // Included in URL + Address *AccountAddressParams `form:"address" json:"address"` + AddressKana *AccountAddressParams `form:"address_kana" json:"address_kana"` + AddressKanji *AccountAddressParams `form:"address_kanji" json:"address_kanji"` + DOB *DOBParams `form:"dob" json:"dob"` + Documents *DocumentsParams `form:"documents" json:"documents"` + Email *string `form:"email" json:"email"` + FirstName *string `form:"first_name" json:"first_name"` + FirstNameKana *string `form:"first_name_kana" json:"first_name_kana"` + FirstNameKanji *string `form:"first_name_kanji" json:"first_name_kanji"` + FullNameAliases []*string `form:"full_name_aliases" json:"full_name_aliases"` + Gender *string `form:"gender" json:"gender"` + IDNumber *string `form:"id_number" json:"id_number"` + LastName *string `form:"last_name" json:"last_name"` + LastNameKana *string `form:"last_name_kana" json:"last_name_kana"` + LastNameKanji *string `form:"last_name_kanji" json:"last_name_kanji"` + MaidenName *string `form:"maiden_name" json:"maiden_name"` + Nationality *string `form:"nationality" json:"nationality"` + PersonToken *string `form:"person_token" json:"person_token"` + Phone *string `form:"phone" json:"phone"` + PoliticalExposure *string `form:"political_exposure" json:"political_exposure"` + Relationship *RelationshipParams `form:"relationship" json:"relationship"` + SSNLast4 *string `form:"ssn_last_4" json:"ssn_last_4"` + Verification *PersonVerificationParams `form:"verification" json:"verification"` } // RelationshipListParams is used to filter persons by the relationship type RelationshipListParams struct { - Director *bool `form:"director"` - Executive *bool `form:"executive"` - Owner *bool `form:"owner"` - Representative *bool `form:"representative"` + Director *bool `form:"director" json:"director"` + Executive *bool `form:"executive" json:"executive"` + Owner *bool `form:"owner" json:"owner"` + Representative *bool `form:"representative" json:"representative"` } // PersonListParams is the set of parameters that can be used when listing persons. // For more detail see https://stripe.com/docs/api#list_persons. type PersonListParams struct { - ListParams `form:"*"` - Account *string `form:"-"` // Included in URL - Relationship *RelationshipListParams `form:"relationship"` + ListParams `form:"*" json:"*"` + Account *string `form:"-" json:"-"` // Included in URL + Relationship *RelationshipListParams `form:"relationship" json:"relationship"` } // PersonVerificationDocument represents the documents associated with a Person. diff --git a/plan.go b/plan.go index 51a935eee3..d33490199d 100644 --- a/plan.go +++ b/plan.go @@ -101,34 +101,34 @@ type PlanList struct { // PlanListParams is the set of parameters that can be used when listing plans. // For more details see https://stripe.com/docs/api#list_plans. type PlanListParams struct { - ListParams `form:"*"` - Active *bool `form:"active"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Product *string `form:"product"` + ListParams `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Product *string `form:"product" json:"product"` } // PlanParams is the set of parameters that can be used when creating or updating a plan. // For more details see https://stripe.com/docs/api#create_plan and https://stripe.com/docs/api#update_plan. type PlanParams struct { - Params `form:"*"` - Active *bool `form:"active"` - AggregateUsage *string `form:"aggregate_usage"` - Amount *int64 `form:"amount"` - AmountDecimal *float64 `form:"amount_decimal,high_precision"` - BillingScheme *string `form:"billing_scheme"` - Currency *string `form:"currency"` - ID *string `form:"id"` - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` - Nickname *string `form:"nickname"` - Product *PlanProductParams `form:"product"` - ProductID *string `form:"product"` - Tiers []*PlanTierParams `form:"tiers"` - TiersMode *string `form:"tiers_mode"` - TransformUsage *PlanTransformUsageParams `form:"transform_usage"` - TrialPeriodDays *int64 `form:"trial_period_days"` - UsageType *string `form:"usage_type"` + Params `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + AggregateUsage *string `form:"aggregate_usage" json:"aggregate_usage"` + Amount *int64 `form:"amount" json:"amount"` + AmountDecimal *float64 `form:"amount_decimal,high_precision" json:"amount_decimal,high_precision"` + BillingScheme *string `form:"billing_scheme" json:"billing_scheme"` + Currency *string `form:"currency" json:"currency"` + ID *string `form:"id" json:"id"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` + Nickname *string `form:"nickname" json:"nickname"` + Product *PlanProductParams `form:"product" json:"product"` + ProductID *string `form:"product" json:"product"` + Tiers []*PlanTierParams `form:"tiers" json:"tiers"` + TiersMode *string `form:"tiers_mode" json:"tiers_mode"` + TransformUsage *PlanTransformUsageParams `form:"transform_usage" json:"transform_usage"` + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` + UsageType *string `form:"usage_type" json:"usage_type"` } // PlanTier configures tiered pricing @@ -148,19 +148,19 @@ type PlanTransformUsage struct { // PlanTransformUsageParams represents the bucket billing configuration. type PlanTransformUsageParams struct { - DivideBy *int64 `form:"divide_by"` - Round *string `form:"round"` + DivideBy *int64 `form:"divide_by" json:"divide_by"` + Round *string `form:"round" json:"round"` } // PlanTierParams configures tiered pricing type PlanTierParams struct { - Params `form:"*"` - FlatAmount *int64 `form:"flat_amount"` - FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` - UpTo *int64 `form:"-"` // handled in custom AppendTo - UpToInf *bool `form:"-"` // handled in custom AppendTo + Params `form:"*" json:"*"` + FlatAmount *int64 `form:"flat_amount" json:"flat_amount"` + FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision" json:"flat_amount_decimal,high_precision"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` + UpTo *int64 `form:"-" json:"-"` // handled in custom AppendTo + UpToInf *bool `form:"-" json:"-"` // handled in custom AppendTo } // AppendTo implements custom up_to serialisation logic for tiers configuration @@ -176,13 +176,13 @@ func (p *PlanTierParams) AppendTo(body *form.Values, keyParts []string) { // This can only be used on plan creation and won't work on plan update. // For more details see https://stripe.com/docs/api#create_plan-product and https://stripe.com/docs/api#update_plan-product type PlanProductParams struct { - Active *bool `form:"active"` - ID *string `form:"id"` - Name *string `form:"name"` - Metadata map[string]string `form:"metadata"` - StatementDescriptor *string `form:"statement_descriptor"` - TaxCode *string `form:"tax_code"` - UnitLabel *string `form:"unit_label"` + Active *bool `form:"active" json:"active"` + ID *string `form:"id" json:"id"` + Name *string `form:"name" json:"name"` + Metadata map[string]string `form:"metadata" json:"metadata"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + TaxCode *string `form:"tax_code" json:"tax_code"` + UnitLabel *string `form:"unit_label" json:"unit_label"` } // UnmarshalJSON handles deserialization of a Plan. diff --git a/price.go b/price.go index 8158c29690..ee5b19e605 100644 --- a/price.go +++ b/price.go @@ -87,32 +87,32 @@ const ( // PriceProductDataParams is the set of parameters that can be used when creating a product inside a price. type PriceProductDataParams struct { - Active *bool `form:"active"` - ID *string `form:"id"` - Metadata map[string]string `form:"metadata"` - Name *string `form:"name"` - StatementDescriptor *string `form:"statement_descriptor"` - TaxCode *string `form:"tax_code"` - UnitLabel *string `form:"unit_label"` + Active *bool `form:"active" json:"active"` + ID *string `form:"id" json:"id"` + Metadata map[string]string `form:"metadata" json:"metadata"` + Name *string `form:"name" json:"name"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + TaxCode *string `form:"tax_code" json:"tax_code"` + UnitLabel *string `form:"unit_label" json:"unit_label"` } // PriceRecurringParams is the set of parameters for the recurring components of a price. type PriceRecurringParams struct { - AggregateUsage *string `form:"aggregate_usage"` - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` - TrialPeriodDays *int64 `form:"trial_period_days"` - UsageType *string `form:"usage_type"` + AggregateUsage *string `form:"aggregate_usage" json:"aggregate_usage"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` + UsageType *string `form:"usage_type" json:"usage_type"` } // PriceTierParams configures tiered pricing type PriceTierParams struct { - FlatAmount *int64 `form:"flat_amount"` - FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` - UpTo *int64 `form:"up_to"` - UpToInf *bool `form:"-"` // See custom AppendTo + FlatAmount *int64 `form:"flat_amount" json:"flat_amount"` + FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision" json:"flat_amount_decimal,high_precision"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` + UpTo *int64 `form:"up_to" json:"up_to"` + UpToInf *bool `form:"-" json:"-"` // See custom AppendTo } // AppendTo implements custom encoding logic for PriceTierParams. @@ -124,49 +124,49 @@ func (p *PriceTierParams) AppendTo(body *form.Values, keyParts []string) { // PriceTransformQuantityParams represents the parameter controlling the calculation of the final amount based on the quantity. type PriceTransformQuantityParams struct { - DivideBy *int64 `form:"divide_by"` - Round *string `form:"round"` + DivideBy *int64 `form:"divide_by" json:"divide_by"` + Round *string `form:"round" json:"round"` } // PriceParams is the set of parameters that can be used when creating or updating a price. // For more details see https://stripe.com/docs/api#create_price and https://stripe.com/docs/api#update_price. type PriceParams struct { - Params `form:"*"` - Active *bool `form:"active"` - BillingScheme *string `form:"billing_scheme"` - Currency *string `form:"currency"` - LookupKey *string `form:"lookup_key"` - Nickname *string `form:"nickname"` - Product *string `form:"product"` - ProductData *PriceProductDataParams `form:"product_data"` - Recurring *PriceRecurringParams `form:"recurring"` - TaxBehavior *string `form:"tax_behavior"` - Tiers []*PriceTierParams `form:"tiers"` - TiersMode *string `form:"tiers_mode"` - TransferLookupKey *bool `form:"transfer_lookup_key"` - TransformQuantity *PriceTransformQuantityParams `form:"transform_quantity"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Params `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + BillingScheme *string `form:"billing_scheme" json:"billing_scheme"` + Currency *string `form:"currency" json:"currency"` + LookupKey *string `form:"lookup_key" json:"lookup_key"` + Nickname *string `form:"nickname" json:"nickname"` + Product *string `form:"product" json:"product"` + ProductData *PriceProductDataParams `form:"product_data" json:"product_data"` + Recurring *PriceRecurringParams `form:"recurring" json:"recurring"` + TaxBehavior *string `form:"tax_behavior" json:"tax_behavior"` + Tiers []*PriceTierParams `form:"tiers" json:"tiers"` + TiersMode *string `form:"tiers_mode" json:"tiers_mode"` + TransferLookupKey *bool `form:"transfer_lookup_key" json:"transfer_lookup_key"` + TransformQuantity *PriceTransformQuantityParams `form:"transform_quantity" json:"transform_quantity"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // PriceRecurringListParams is the set of parameters that can be used when listing recurring prices. type PriceRecurringListParams struct { - Interval *string `form:"interval"` - UsageType *string `form:"usage_type"` + Interval *string `form:"interval" json:"interval"` + UsageType *string `form:"usage_type" json:"usage_type"` } // PriceListParams is the set of parameters that can be used when listing prices. // For more details see https://stripe.com/docs/api#list_prices. type PriceListParams struct { - ListParams `form:"*"` - Active *bool `form:"active"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Currency *string `form:"currency"` - LookupKeys []*string `form:"lookup_keys"` - Product *string `form:"product"` - Recurring *PriceRecurringListParams `form:"recurring"` - Type *string `form:"type"` + ListParams `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Currency *string `form:"currency" json:"currency"` + LookupKeys []*string `form:"lookup_keys" json:"lookup_keys"` + Product *string `form:"product" json:"product"` + Recurring *PriceRecurringListParams `form:"recurring" json:"recurring"` + Type *string `form:"type" json:"type"` } // PriceRecurring represents the recurring components of a price. diff --git a/product.go b/product.go index 9dcfd02c38..ae37006ad7 100644 --- a/product.go +++ b/product.go @@ -20,42 +20,42 @@ const ( // PackageDimensionsParams represents the set of parameters for the the dimension of a // product or a SKU from the perspective of shipping . type PackageDimensionsParams struct { - Height *float64 `form:"height"` - Length *float64 `form:"length"` - Weight *float64 `form:"weight"` - Width *float64 `form:"width"` + Height *float64 `form:"height" json:"height"` + Length *float64 `form:"length" json:"length"` + Weight *float64 `form:"weight" json:"weight"` + Width *float64 `form:"width" json:"width"` } // ProductParams is the set of parameters that can be used when creating or updating a product. type ProductParams struct { - Params `form:"*"` - Active *bool `form:"active"` - Attributes []*string `form:"attributes"` - Caption *string `form:"caption"` - DeactivateOn []*string `form:"deactivate_on"` - Description *string `form:"description"` - ID *string `form:"id"` - Images []*string `form:"images"` - Name *string `form:"name"` - PackageDimensions *PackageDimensionsParams `form:"package_dimensions"` - Shippable *bool `form:"shippable"` - StatementDescriptor *string `form:"statement_descriptor"` - TaxCode *string `form:"tax_code"` - Type *string `form:"type"` - UnitLabel *string `form:"unit_label"` - URL *string `form:"url"` + Params `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Attributes []*string `form:"attributes" json:"attributes"` + Caption *string `form:"caption" json:"caption"` + DeactivateOn []*string `form:"deactivate_on" json:"deactivate_on"` + Description *string `form:"description" json:"description"` + ID *string `form:"id" json:"id"` + Images []*string `form:"images" json:"images"` + Name *string `form:"name" json:"name"` + PackageDimensions *PackageDimensionsParams `form:"package_dimensions" json:"package_dimensions"` + Shippable *bool `form:"shippable" json:"shippable"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + TaxCode *string `form:"tax_code" json:"tax_code"` + Type *string `form:"type" json:"type"` + UnitLabel *string `form:"unit_label" json:"unit_label"` + URL *string `form:"url" json:"url"` } // ProductListParams is the set of parameters that can be used when listing products. type ProductListParams struct { - ListParams `form:"*"` - Active *bool `form:"active"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - IDs []*string `form:"ids"` - Shippable *bool `form:"shippable"` - Type *string `form:"type"` - URL *string `form:"url"` + ListParams `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + IDs []*string `form:"ids" json:"ids"` + Shippable *bool `form:"shippable" json:"shippable"` + Type *string `form:"type" json:"type"` + URL *string `form:"url" json:"url"` } // PackageDimensions represents the dimension of a product or a SKU from the diff --git a/promotioncode.go b/promotioncode.go index 070d9b6480..ec61bc6ac9 100644 --- a/promotioncode.go +++ b/promotioncode.go @@ -10,32 +10,32 @@ import "encoding/json" // PromotionCodeRestrictionsParams is the set of parameters for restrictions on a promotion code. type PromotionCodeRestrictionsParams struct { - FirstTimeTransaction *bool `form:"first_time_transaction"` - MinimumAmount *int64 `form:"minimum_amount"` - MinimumAmountCurrency *string `form:"minimum_amount_currency"` + FirstTimeTransaction *bool `form:"first_time_transaction" json:"first_time_transaction"` + MinimumAmount *int64 `form:"minimum_amount" json:"minimum_amount"` + MinimumAmountCurrency *string `form:"minimum_amount_currency" json:"minimum_amount_currency"` } // PromotionCodeParams is the set of parameters that can be used when creating a promotion code. type PromotionCodeParams struct { - Params `form:"*"` - Active *bool `form:"active"` - Code *string `form:"code"` - Coupon *string `form:"coupon"` - Customer *string `form:"customer"` - ExpiresAt *int64 `form:"expires_at"` - MaxRedemptions *int64 `form:"max_redemptions"` - Restrictions *PromotionCodeRestrictionsParams `form:"restrictions"` + Params `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Code *string `form:"code" json:"code"` + Coupon *string `form:"coupon" json:"coupon"` + Customer *string `form:"customer" json:"customer"` + ExpiresAt *int64 `form:"expires_at" json:"expires_at"` + MaxRedemptions *int64 `form:"max_redemptions" json:"max_redemptions"` + Restrictions *PromotionCodeRestrictionsParams `form:"restrictions" json:"restrictions"` } // PromotionCodeListParams is the set of parameters that can be used when listing promotion codes. type PromotionCodeListParams struct { - ListParams `form:"*"` - Active *bool `form:"active"` - Code *string `form:"code"` - Coupon *string `form:"coupon"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` + ListParams `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Code *string `form:"code" json:"code"` + Coupon *string `form:"coupon" json:"coupon"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer *string `form:"customer" json:"customer"` } // PromotionCodeRestrictions is the set of restrictions associated with a promotion code. diff --git a/quote.go b/quote.go index 49d138521b..f1e67cd84d 100644 --- a/quote.go +++ b/quote.go @@ -52,72 +52,72 @@ const ( // Retrieves the quote with the given ID. type QuoteParams struct { - Params `form:"*"` - ApplicationFeeAmount *int64 `form:"application_fee_amount"` - ApplicationFeePercent *float64 `form:"application_fee_percent"` - AutomaticTax *QuoteAutomaticTaxParams `form:"automatic_tax"` - CollectionMethod *string `form:"collection_method"` - Customer *string `form:"customer"` - DefaultTaxRates []*string `form:"default_tax_rates"` - Description *string `form:"description"` - Discounts []*QuoteDiscountParams `form:"discounts"` - ExpiresAt *int64 `form:"expires_at"` - Footer *string `form:"footer"` - FromQuote *QuoteFromQuoteParams `form:"from_quote"` - Header *string `form:"header"` - InvoiceSettings *QuoteInvoiceSettingsParams `form:"invoice_settings"` - LineItems []*QuoteLineItemParams `form:"line_items"` - OnBehalfOf *string `form:"on_behalf_of"` - SubscriptionData *QuoteSubscriptionDataParams `form:"subscription_data"` - TransferData *QuoteTransferDataParams `form:"transfer_data"` + Params `form:"*" json:"*"` + ApplicationFeeAmount *int64 `form:"application_fee_amount" json:"application_fee_amount"` + ApplicationFeePercent *float64 `form:"application_fee_percent" json:"application_fee_percent"` + AutomaticTax *QuoteAutomaticTaxParams `form:"automatic_tax" json:"automatic_tax"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + Customer *string `form:"customer" json:"customer"` + DefaultTaxRates []*string `form:"default_tax_rates" json:"default_tax_rates"` + Description *string `form:"description" json:"description"` + Discounts []*QuoteDiscountParams `form:"discounts" json:"discounts"` + ExpiresAt *int64 `form:"expires_at" json:"expires_at"` + Footer *string `form:"footer" json:"footer"` + FromQuote *QuoteFromQuoteParams `form:"from_quote" json:"from_quote"` + Header *string `form:"header" json:"header"` + InvoiceSettings *QuoteInvoiceSettingsParams `form:"invoice_settings" json:"invoice_settings"` + LineItems []*QuoteLineItemParams `form:"line_items" json:"line_items"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + SubscriptionData *QuoteSubscriptionDataParams `form:"subscription_data" json:"subscription_data"` + TransferData *QuoteTransferDataParams `form:"transfer_data" json:"transfer_data"` } // Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. type QuoteAutomaticTaxParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // The discounts applied to the quote. You can only set up to one discount. type QuoteDiscountParams struct { - Coupon *string `form:"coupon"` - Discount *string `form:"discount"` + Coupon *string `form:"coupon" json:"coupon"` + Discount *string `form:"discount" json:"discount"` } // All invoices will be billed using the specified settings. type QuoteInvoiceSettingsParams struct { - DaysUntilDue *int64 `form:"days_until_due"` + DaysUntilDue *int64 `form:"days_until_due" json:"days_until_due"` } // The recurring components of a price such as `interval` and `usage_type`. type QuoteLineItemPriceDataRecurringParams struct { - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` } // Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. type QuoteLineItemPriceDataParams struct { - Currency *string `form:"currency"` - Product *string `form:"product"` - Recurring *QuoteLineItemPriceDataRecurringParams `form:"recurring"` - TaxBehavior *string `form:"tax_behavior"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Currency *string `form:"currency" json:"currency"` + Product *string `form:"product" json:"product"` + Recurring *QuoteLineItemPriceDataRecurringParams `form:"recurring" json:"recurring"` + TaxBehavior *string `form:"tax_behavior" json:"tax_behavior"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. type QuoteLineItemParams struct { - ID *string `form:"id"` - Price *string `form:"price"` - PriceData *QuoteLineItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + ID *string `form:"id" json:"id"` + Price *string `form:"price" json:"price"` + PriceData *QuoteLineItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } // When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. type QuoteSubscriptionDataParams struct { - EffectiveDate *int64 `form:"effective_date"` - EffectiveDateCurrentPeriodEnd *bool `form:"-"` // See custom AppendTo - TrialPeriodDays *int64 `form:"trial_period_days"` + EffectiveDate *int64 `form:"effective_date" json:"effective_date"` + EffectiveDateCurrentPeriodEnd *bool `form:"-" json:"-"` // See custom AppendTo + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` } // AppendTo implements custom encoding logic for QuoteSubscriptionDataParams. @@ -129,55 +129,55 @@ func (q *QuoteSubscriptionDataParams) AppendTo(body *form.Values, keyParts []str // The data with which to automatically create a Transfer for each of the invoices. type QuoteTransferDataParams struct { - Amount *int64 `form:"amount"` - AmountPercent *float64 `form:"amount_percent"` - Destination *string `form:"destination"` + Amount *int64 `form:"amount" json:"amount"` + AmountPercent *float64 `form:"amount_percent" json:"amount_percent"` + Destination *string `form:"destination" json:"destination"` } // Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`. type QuoteFromQuoteParams struct { - IsRevision *bool `form:"is_revision"` - Quote *string `form:"quote"` + IsRevision *bool `form:"is_revision" json:"is_revision"` + Quote *string `form:"quote" json:"quote"` } // Returns a list of your quotes. type QuoteListParams struct { - ListParams `form:"*"` - Customer *string `form:"customer"` - Status *string `form:"status"` + ListParams `form:"*" json:"*"` + Customer *string `form:"customer" json:"customer"` + Status *string `form:"status" json:"status"` } // Cancels the quote. type QuoteCancelParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // Finalizes the quote. type QuoteFinalizeQuoteParams struct { - Params `form:"*"` - ExpiresAt *int64 `form:"expires_at"` + Params `form:"*" json:"*"` + ExpiresAt *int64 `form:"expires_at" json:"expires_at"` } // Accepts the specified quote. type QuoteAcceptParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. type QuoteListLineItemsParams struct { - ListParams `form:"*"` - Quote *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + Quote *string `form:"-" json:"-"` // Included in URL } // When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. type QuoteListComputedUpfrontLineItemsParams struct { - ListParams `form:"*"` - Quote *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + Quote *string `form:"-" json:"-"` // Included in URL } // Download the PDF for a finalized quote type QuotePDFParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } type QuoteAutomaticTax struct { Enabled bool `json:"enabled"` diff --git a/radar_earlyfraudwarning.go b/radar_earlyfraudwarning.go index df872be3f7..fd31bf1abe 100644 --- a/radar_earlyfraudwarning.go +++ b/radar_earlyfraudwarning.go @@ -24,16 +24,16 @@ const ( // retrieving early fraud warnings. For more details see // https://stripe.com/docs/api/early_fraud_warnings/retrieve. type RadarEarlyFraudWarningParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // RadarEarlyFraudWarningListParams is the set of parameters that can be used when // listing early fraud warnings. For more details see // https://stripe.com/docs/api/early_fraud_warnings/list. type RadarEarlyFraudWarningListParams struct { - ListParams `form:"*"` - Charge *string `form:"charge"` - PaymentIntent *string `form:"payment_intent"` + ListParams `form:"*" json:"*"` + Charge *string `form:"charge" json:"charge"` + PaymentIntent *string `form:"payment_intent" json:"payment_intent"` } // RadarEarlyFraudWarning is the resource representing an early fraud warning. For diff --git a/radar_valuelist.go b/radar_valuelist.go index 55550c1394..4c052ef54f 100644 --- a/radar_valuelist.go +++ b/radar_valuelist.go @@ -22,19 +22,19 @@ const ( // RadarValueListParams is the set of parameters that can be used when creating a value list. type RadarValueListParams struct { - Params `form:"*" json:"*"` - Alias *string `form:"alias" json:"alias"` - ItemType *string `form:"item_type" json:"item_type"` - Name *string `form:"name" json:"name"` + Params `form:"*" json:"*" json:"*" json:"*"` + Alias *string `form:"alias" json:"alias" json:"alias" json:"alias"` + ItemType *string `form:"item_type" json:"item_type" json:"item_type" json:"item_type"` + Name *string `form:"name" json:"name" json:"name" json:"name"` } // RadarValueListListParams is the set of parameters that can be used when listing value lists. type RadarValueListListParams struct { - ListParams `form:"*" json:"*"` - Alias *string `form:"alias" json:"alias"` - Contains *string `form:"contains" json:"contains"` - Created *int64 `form:"created" json:"created"` - CreatedRange *RangeQueryParams `form:"created" json:"created"` + ListParams `form:"*" json:"*" json:"*" json:"*"` + Alias *string `form:"alias" json:"alias" json:"alias" json:"alias"` + Contains *string `form:"contains" json:"contains" json:"contains" json:"contains"` + Created *int64 `form:"created" json:"created" json:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created" json:"created" json:"created"` } // RadarValueList is the resource representing a value list. diff --git a/radar_valuelistitem.go b/radar_valuelistitem.go index e15ea27bc6..895b6a9807 100644 --- a/radar_valuelistitem.go +++ b/radar_valuelistitem.go @@ -8,18 +8,18 @@ package stripe // RadarValueListItemParams is the set of parameters that can be used when creating a value list item. type RadarValueListItemParams struct { - Params `form:"*"` - RadarValueList *string `form:"value_list"` - Value *string `form:"value"` + Params `form:"*" json:"*"` + RadarValueList *string `form:"value_list" json:"value_list"` + Value *string `form:"value" json:"value"` } // RadarValueListItemListParams is the set of parameters that can be used when listing value list items. type RadarValueListItemListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - RadarValueList *string `form:"value_list"` - Value *string `form:"value"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + RadarValueList *string `form:"value_list" json:"value_list"` + Value *string `form:"value" json:"value"` } // RadarValueListItem is the resource representing a value list item. diff --git a/recipient.go b/recipient.go index 3250aa48d6..eeb2bad900 100644 --- a/recipient.go +++ b/recipient.go @@ -18,17 +18,17 @@ const ( // 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:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` - BankAccount *BankAccountParams `form:"-" 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"` - DefaultCard *string `form:"default_card" json:"default_card"` - Description *string `form:"description" json:"description"` - Email *string `form:"email" json:"email"` - Name *string `form:"name" json:"name"` - TaxID *string `form:"tax_id" json:"tax_id"` - Token *string `form:"card" json:"card"` - Type *string `form:"-" json:"-"` // Doesn't seem to be used anywhere + 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. @@ -47,8 +47,8 @@ func (p *RecipientParams) AppendTo(body *form.Values, keyParts []string) { // 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:"*"` - Verified *bool `form:"verified" json:"verified"` + ListParams `form:"*" json:"*" json:"*" json:"*"` + Verified *bool `form:"verified" json:"verified" json:"verified" json:"verified"` } // Recipient is the resource representing a Stripe recipient. diff --git a/refund.go b/refund.go index d8947942a6..279586e1e1 100644 --- a/refund.go +++ b/refund.go @@ -43,23 +43,23 @@ const ( // RefundParams is the set of parameters that can be used when refunding a charge. // For more details see https://stripe.com/docs/api#refund. type RefundParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Charge *string `form:"charge"` - PaymentIntent *string `form:"payment_intent"` - Reason *string `form:"reason"` - RefundApplicationFee *bool `form:"refund_application_fee"` - ReverseTransfer *bool `form:"reverse_transfer"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + Charge *string `form:"charge" json:"charge"` + PaymentIntent *string `form:"payment_intent" json:"payment_intent"` + Reason *string `form:"reason" json:"reason"` + RefundApplicationFee *bool `form:"refund_application_fee" json:"refund_application_fee"` + ReverseTransfer *bool `form:"reverse_transfer" json:"reverse_transfer"` } // RefundListParams is the set of parameters that can be used when listing refunds. // For more details see https://stripe.com/docs/api#list_refunds. type RefundListParams struct { - ListParams `form:"*"` - Charge *string `form:"charge"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - PaymentIntent *string `form:"payment_intent"` + ListParams `form:"*" json:"*"` + Charge *string `form:"charge" json:"charge"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + PaymentIntent *string `form:"payment_intent" json:"payment_intent"` } // Refund is the resource representing a Stripe refund. diff --git a/reporting_reportrun.go b/reporting_reportrun.go index 289350268e..bd4aa1a63b 100644 --- a/reporting_reportrun.go +++ b/reporting_reportrun.go @@ -12,28 +12,28 @@ const ( // ReportRunParametersParams is the set of parameters that can be used when creating a report run. type ReportRunParametersParams struct { - Columns []*string `form:"columns"` - ConnectedAccount *string `form:"connected_account"` - Currency *string `form:"currency"` - IntervalEnd *int64 `form:"interval_end"` - IntervalStart *int64 `form:"interval_start"` - Payout *string `form:"payout"` - ReportingCategory *string `form:"reporting_category"` - Timezone *string `form:"timezone"` + Columns []*string `form:"columns" json:"columns"` + ConnectedAccount *string `form:"connected_account" json:"connected_account"` + Currency *string `form:"currency" json:"currency"` + IntervalEnd *int64 `form:"interval_end" json:"interval_end"` + IntervalStart *int64 `form:"interval_start" json:"interval_start"` + Payout *string `form:"payout" json:"payout"` + ReportingCategory *string `form:"reporting_category" json:"reporting_category"` + Timezone *string `form:"timezone" json:"timezone"` } // ReportRunParams is the set of parameters that can be used when creating a report run. type ReportRunParams struct { - Params `form:"*"` - Parameters *ReportRunParametersParams `form:"parameters"` - ReportType *string `form:"report_type"` + Params `form:"*" json:"*"` + Parameters *ReportRunParametersParams `form:"parameters" json:"parameters"` + ReportType *string `form:"report_type" json:"report_type"` } // ReportRunListParams is the set of parameters that can be used when listing report runs. type ReportRunListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` } // ReportRunParameters describes the parameters hash on a report run. diff --git a/reporting_reporttype.go b/reporting_reporttype.go index 5aeff80176..2833edc988 100644 --- a/reporting_reporttype.go +++ b/reporting_reporttype.go @@ -8,12 +8,12 @@ package stripe // ReportTypeListParams is the set of parameters that can be used when listing report types. type ReportTypeListParams struct { - ListParams `form:"*" json:"*"` + ListParams `form:"*" json:"*" json:"*" json:"*"` } // ReportTypeParams is the set of parameters that can be used when retrieving a report type. type ReportTypeParams struct { - Params `form:"*" json:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` } // ReportType is the resource representing a report type. diff --git a/reversal.go b/reversal.go index df90c537e5..fab798608d 100644 --- a/reversal.go +++ b/reversal.go @@ -4,17 +4,17 @@ import "encoding/json" // ReversalParams is the set of parameters that can be used when reversing a transfer. type ReversalParams struct { - Params `form:"*" json:"*"` - Amount *int64 `form:"amount" json:"amount"` - Description *string `form:"description" json:"description"` - RefundApplicationFee *bool `form:"refund_application_fee" json:"refund_application_fee"` - Transfer *string `form:"-" json:"-"` // Included in URL + Params `form:"*" json:"*" json:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount" json:"amount" json:"amount"` + Description *string `form:"description" json:"description" json:"description" json:"description"` + RefundApplicationFee *bool `form:"refund_application_fee" json:"refund_application_fee" json:"refund_application_fee" json:"refund_application_fee"` + Transfer *string `form:"-" json:"-" json:"-" json:"-"` // Included in URL } // ReversalListParams is the set of parameters that can be used when listing reversals. type ReversalListParams struct { - ListParams `form:"*" json:"*"` - Transfer *string `form:"-" json:"-"` // Included in URL + ListParams `form:"*" json:"*" json:"*" json:"*"` + Transfer *string `form:"-" json:"-" json:"-" json:"-"` // Included in URL } // Reversal represents a transfer reversal. diff --git a/review.go b/review.go index 7cb87d1976..58765e1b5b 100644 --- a/review.go +++ b/review.go @@ -47,19 +47,19 @@ const ( // Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. type ReviewListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` } // Retrieves a Review object. type ReviewParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // Approves a Review object, closing it and removing it from the list of reviews. type ReviewApproveParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. diff --git a/setupattempt.go b/setupattempt.go index cfef8d8292..bbd6b872e5 100644 --- a/setupattempt.go +++ b/setupattempt.go @@ -71,10 +71,10 @@ const ( // SetupAttemptListParams is the set of parameters that can be used when listing setup attempts. type SetupAttemptListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - SetupIntent *string `form:"setup_intent"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + SetupIntent *string `form:"setup_intent" json:"setup_intent"` } // SetupAttemptPaymentMethodDetailsCardThreeDSecure represents details about 3DS associated with the setup attempt's payment method. diff --git a/setupintent.go b/setupintent.go index 2a5f6828f0..eddf0a9b3f 100644 --- a/setupintent.go +++ b/setupintent.go @@ -98,17 +98,17 @@ const ( // SetupIntentCancelParams is the set of parameters that can be used when canceling a setup intent. type SetupIntentCancelParams struct { - Params `form:"*"` - CancellationReason *string `form:"cancellation_reason"` + Params `form:"*" json:"*"` + CancellationReason *string `form:"cancellation_reason" json:"cancellation_reason"` } // SetupIntentConfirmParams is the set of parameters that can be used when confirming a setup intent. type SetupIntentConfirmParams struct { - Params `form:"*"` - MandateData *SetupIntentMandateDataParams `form:"mandate_data"` - PaymentMethod *string `form:"payment_method"` - PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"` - ReturnURL *string `form:"return_url"` + Params `form:"*" json:"*"` + MandateData *SetupIntentMandateDataParams `form:"mandate_data" json:"mandate_data"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` + PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + ReturnURL *string `form:"return_url" json:"return_url"` } // SetupIntentMandateDataCustomerAcceptanceOfflineParams is the set of parameters for the customer @@ -119,87 +119,87 @@ type SetupIntentMandateDataCustomerAcceptanceOfflineParams struct { // SetupIntentMandateDataCustomerAcceptanceOnlineParams is the set of parameters for the customer // acceptance of an online mandate. type SetupIntentMandateDataCustomerAcceptanceOnlineParams struct { - IPAddress *string `form:"ip_address"` - UserAgent *string `form:"user_agent"` + IPAddress *string `form:"ip_address" json:"ip_address"` + UserAgent *string `form:"user_agent" json:"user_agent"` } // SetupIntentMandateDataCustomerAcceptanceParams is the set of parameters for the customer // acceptance of a mandate. type SetupIntentMandateDataCustomerAcceptanceParams struct { - AcceptedAt int64 `form:"accepted_at"` - Offline *SetupIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline"` - Online *SetupIntentMandateDataCustomerAcceptanceOnlineParams `form:"online"` - Type MandateCustomerAcceptanceType `form:"type"` + AcceptedAt int64 `form:"accepted_at" json:"accepted_at"` + Offline *SetupIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline" json:"offline"` + Online *SetupIntentMandateDataCustomerAcceptanceOnlineParams `form:"online" json:"online"` + Type MandateCustomerAcceptanceType `form:"type" json:"type"` } // SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams is the set of parameters for // mandate_options on acss_debit. type SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams struct { - CustomMandateURL *string `form:"custom_mandate_url"` - DefaultFor []*string `form:"default_for"` - IntervalDescription *string `form:"interval_description"` - PaymentSchedule *string `form:"payment_schedule"` - TransactionType *string `form:"transaction_type"` + CustomMandateURL *string `form:"custom_mandate_url" json:"custom_mandate_url"` + DefaultFor []*string `form:"default_for" json:"default_for"` + IntervalDescription *string `form:"interval_description" json:"interval_description"` + PaymentSchedule *string `form:"payment_schedule" json:"payment_schedule"` + TransactionType *string `form:"transaction_type" json:"transaction_type"` } // SetupIntentPaymentMethodOptionsACSSDebitParams is the set of parameters for acss debit on // payment_method_options. type SetupIntentPaymentMethodOptionsACSSDebitParams struct { - Currency *string `form:"currency"` - MandateOptions *SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"` - VerificationMethod *string `form:"verification_method"` + Currency *string `form:"currency" json:"currency"` + MandateOptions *SetupIntentPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options" json:"mandate_options"` + VerificationMethod *string `form:"verification_method" json:"verification_method"` } // SetupIntentMandateDataParams is the set of parameters controlling the creation of the mandate // associated with this SetupIntent. type SetupIntentMandateDataParams struct { - CustomerAcceptance *SetupIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"` + CustomerAcceptance *SetupIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance" json:"customer_acceptance"` } // SetupIntentPaymentMethodOptionsCardParams represents the card-specific options applied to a // SetupIntent. type SetupIntentPaymentMethodOptionsCardParams struct { - MOTO *bool `form:"moto"` - RequestThreeDSecure *string `form:"request_three_d_secure"` + MOTO *bool `form:"moto" json:"moto"` + RequestThreeDSecure *string `form:"request_three_d_secure" json:"request_three_d_secure"` } // SetupIntentPaymentMethodOptionsParams represents the type-specific payment method options // applied to a SetupIntent. type SetupIntentPaymentMethodOptionsParams struct { - ACSSDebit *SetupIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit"` - Card *SetupIntentPaymentMethodOptionsCardParams `form:"card"` + ACSSDebit *SetupIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit" json:"acss_debit"` + Card *SetupIntentPaymentMethodOptionsCardParams `form:"card" json:"card"` } // SetupIntentSingleUseParams represents the single-use mandate-specific parameters. type SetupIntentSingleUseParams struct { - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` } // SetupIntentParams is the set of parameters that can be used when handling a setup intent. type SetupIntentParams struct { - Params `form:"*"` - Confirm *bool `form:"confirm"` - Customer *string `form:"customer"` - Description *string `form:"description"` - MandateData *SetupIntentMandateDataParams `form:"mandate_data"` - OnBehalfOf *string `form:"on_behalf_of"` - PaymentMethod *string `form:"payment_method"` - PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"` - PaymentMethodTypes []*string `form:"payment_method_types"` - ReturnURL *string `form:"return_url"` - SingleUse *SetupIntentSingleUseParams `form:"single_use"` - Usage *string `form:"usage"` + Params `form:"*" json:"*"` + Confirm *bool `form:"confirm" json:"confirm"` + Customer *string `form:"customer" json:"customer"` + Description *string `form:"description" json:"description"` + MandateData *SetupIntentMandateDataParams `form:"mandate_data" json:"mandate_data"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` + PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + PaymentMethodTypes []*string `form:"payment_method_types" json:"payment_method_types"` + ReturnURL *string `form:"return_url" json:"return_url"` + SingleUse *SetupIntentSingleUseParams `form:"single_use" json:"single_use"` + Usage *string `form:"usage" json:"usage"` } // SetupIntentListParams is the set of parameters that can be used when listing setup intents. // For more details see https://stripe.com/docs/api#list_payouts. type SetupIntentListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer *string `form:"customer"` - PaymentMethod *string `form:"payment_method"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer *string `form:"customer" json:"customer"` + PaymentMethod *string `form:"payment_method" json:"payment_method"` } // SetupIntentNextActionRedirectToURL represents the resource for the next action of type diff --git a/sigma_scheduledqueryrun.go b/sigma_scheduledqueryrun.go index 510e184573..7b84dc439a 100644 --- a/sigma_scheduledqueryrun.go +++ b/sigma_scheduledqueryrun.go @@ -15,12 +15,12 @@ const ( // SigmaScheduledQueryRunParams is the set of parameters that can be used when updating a scheduled query run. type SigmaScheduledQueryRunParams struct { - Params `form:"*" json:"*"` + Params `form:"*" json:"*" json:"*" json:"*"` } // SigmaScheduledQueryRunListParams is the set of parameters that can be used when listing scheduled query runs. type SigmaScheduledQueryRunListParams struct { - ListParams `form:"*" json:"*"` + ListParams `form:"*" json:"*" json:"*" json:"*"` } // SigmaScheduledQueryRunError is the resource representing an error on a scheduled query run. diff --git a/sku.go b/sku.go index e6e9f424ec..7f73c333bc 100644 --- a/sku.go +++ b/sku.go @@ -24,24 +24,24 @@ const ( // InventoryParams is the set of parameters allowed as inventory on a SKU. type InventoryParams struct { - Quantity *int64 `form:"quantity" json:"quantity"` - Type *string `form:"type" json:"type"` - Value *string `form:"value" json:"value"` + Quantity *int64 `form:"quantity" json:"quantity" json:"quantity" json:"quantity"` + Type *string `form:"type" json:"type" json:"type" json:"type"` + Value *string `form:"value" json:"value" json:"value" json:"value"` } // SKUParams is the set of parameters allowed on SKU creation or update. type SKUParams struct { - Params `form:"*" json:"*"` - Active *bool `form:"active" json:"active"` - Attributes map[string]string `form:"attributes" json:"attributes"` - Currency *string `form:"currency" json:"currency"` - Description *string `form:"description" json:"description"` - ID *string `form:"id" json:"id"` - Image *string `form:"image" json:"image"` - Inventory *InventoryParams `form:"inventory" json:"inventory"` - PackageDimensions *PackageDimensionsParams `form:"package_dimensions" json:"package_dimensions"` - Price *int64 `form:"price" json:"price"` - Product *string `form:"product" json:"product"` + Params `form:"*" json:"*" json:"*" json:"*"` + Active *bool `form:"active" json:"active" json:"active" json:"active"` + Attributes map[string]string `form:"attributes" json:"attributes" json:"attributes" json:"attributes"` + Currency *string `form:"currency" json:"currency" json:"currency" json:"currency"` + Description *string `form:"description" json:"description" json:"description" json:"description"` + ID *string `form:"id" json:"id" json:"id" json:"id"` + Image *string `form:"image" json:"image" json:"image" json:"image"` + Inventory *InventoryParams `form:"inventory" json:"inventory" json:"inventory" json:"inventory"` + PackageDimensions *PackageDimensionsParams `form:"package_dimensions" json:"package_dimensions" json:"package_dimensions" json:"package_dimensions"` + Price *int64 `form:"price" json:"price" json:"price" json:"price"` + Product *string `form:"product" json:"product" json:"product" json:"product"` } // Inventory represents the inventory options of a SKU. @@ -80,12 +80,12 @@ type SKUList struct { // SKUListParams is the set of parameters that can be used when listing SKUs. type SKUListParams struct { - ListParams `form:"*" json:"*"` - Active *bool `form:"active" json:"active"` - Attributes map[string]string `form:"attributes" json:"attributes"` - IDs []*string `form:"ids" json:"ids"` - InStock *bool `form:"in_stock" json:"in_stock"` - Product *string `form:"product" json:"product"` + ListParams `form:"*" json:"*" json:"*" json:"*"` + Active *bool `form:"active" json:"active" json:"active" json:"active"` + Attributes map[string]string `form:"attributes" json:"attributes" json:"attributes" json:"attributes"` + IDs []*string `form:"ids" json:"ids" json:"ids" json:"ids"` + InStock *bool `form:"in_stock" json:"in_stock" json:"in_stock" json:"in_stock"` + Product *string `form:"product" json:"product" json:"product" json:"product"` } // UnmarshalJSON handles deserialization of a SKU. diff --git a/source.go b/source.go index 0206424e94..9b22c32982 100644 --- a/source.go +++ b/source.go @@ -122,101 +122,101 @@ const ( // SourceOwnerParams is the set of parameters allowed for the owner hash on // source creation or update. type SourceOwnerParams struct { - Address *AddressParams `form:"address"` - Email *string `form:"email"` - Name *string `form:"name"` - Phone *string `form:"phone"` + Address *AddressParams `form:"address" json:"address"` + Email *string `form:"email" json:"email"` + Name *string `form:"name" json:"name"` + Phone *string `form:"phone" json:"phone"` } // RedirectParams is the set of parameters allowed for the redirect hash on // source creation or update. type RedirectParams struct { - ReturnURL *string `form:"return_url"` + ReturnURL *string `form:"return_url" json:"return_url"` } // SourceOrderItemsParams is the set of parameters allowed for the items on a // source order for a source. type SourceOrderItemsParams struct { - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - Parent *string `form:"parent"` - Quantity *int64 `form:"quantity"` - Type *string `form:"type"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + Parent *string `form:"parent" json:"parent"` + Quantity *int64 `form:"quantity" json:"quantity"` + Type *string `form:"type" json:"type"` } // SourceOrderParams is the set of parameters allowed for the source order of a // source. type SourceOrderParams struct { - Items []*SourceOrderItemsParams `form:"items"` - Shipping *ShippingDetailsParams `form:"shipping"` + Items []*SourceOrderItemsParams `form:"items" json:"items"` + Shipping *ShippingDetailsParams `form:"shipping" json:"shipping"` } // SourceObjectParams is the set of parameters allowed on source creation or update. type SourceObjectParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Customer *string `form:"customer"` - Flow *string `form:"flow"` - Mandate *SourceMandateParams `form:"mandate"` - OriginalSource *string `form:"original_source"` - Owner *SourceOwnerParams `form:"owner"` - Receiver *SourceReceiverParams `form:"receiver"` - Redirect *RedirectParams `form:"redirect"` - SourceOrder *SourceOrderParams `form:"source_order"` - StatementDescriptor *string `form:"statement_descriptor"` - Token *string `form:"token"` - Type *string `form:"type"` - TypeData map[string]string `form:"-"` - Usage *string `form:"usage"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Customer *string `form:"customer" json:"customer"` + Flow *string `form:"flow" json:"flow"` + Mandate *SourceMandateParams `form:"mandate" json:"mandate"` + OriginalSource *string `form:"original_source" json:"original_source"` + Owner *SourceOwnerParams `form:"owner" json:"owner"` + Receiver *SourceReceiverParams `form:"receiver" json:"receiver"` + Redirect *RedirectParams `form:"redirect" json:"redirect"` + SourceOrder *SourceOrderParams `form:"source_order" json:"source_order"` + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + Token *string `form:"token" json:"token"` + Type *string `form:"type" json:"type"` + TypeData map[string]string `form:"-" json:"-"` + Usage *string `form:"usage" json:"usage"` } // SourceMandateAcceptanceParams describes the set of parameters allowed for the `acceptance` // hash on source creation or update. type SourceMandateAcceptanceParams struct { - Date *int64 `form:"date"` - IP *string `form:"ip"` - Offline *SourceMandateAcceptanceOfflineParams `form:"offline"` - Online *SourceMandateAcceptanceOnlineParams `form:"online"` - Status *string `form:"status"` - Type *string `form:"type"` - UserAgent *string `form:"user_agent"` + Date *int64 `form:"date" json:"date"` + IP *string `form:"ip" json:"ip"` + Offline *SourceMandateAcceptanceOfflineParams `form:"offline" json:"offline"` + Online *SourceMandateAcceptanceOnlineParams `form:"online" json:"online"` + Status *string `form:"status" json:"status"` + Type *string `form:"type" json:"type"` + UserAgent *string `form:"user_agent" json:"user_agent"` } // SourceMandateAcceptanceOnlineParams describes the set of parameters for online accepted mandate type SourceMandateAcceptanceOnlineParams struct { - Date *int64 `form:"date"` - IP *string `form:"ip"` - UserAgent *string `form:"user_agent"` + Date *int64 `form:"date" json:"date"` + IP *string `form:"ip" json:"ip"` + UserAgent *string `form:"user_agent" json:"user_agent"` } // SourceMandateAcceptanceOfflineParams describes the set of parameters for offline accepted mandate type SourceMandateAcceptanceOfflineParams struct { - ContactEmail *string `form:"contact_email"` + ContactEmail *string `form:"contact_email" json:"contact_email"` } // SourceMandateParams describes the set of parameters allowed for the `mandate` hash on // source creation or update. type SourceMandateParams struct { - Amount *int64 `form:"amount"` - Acceptance *SourceMandateAcceptanceParams `form:"acceptance"` - Currency *string `form:"currency"` - Interval *string `form:"interval"` - NotificationMethod *string `form:"notification_method"` + Amount *int64 `form:"amount" json:"amount"` + Acceptance *SourceMandateAcceptanceParams `form:"acceptance" json:"acceptance"` + Currency *string `form:"currency" json:"currency"` + Interval *string `form:"interval" json:"interval"` + NotificationMethod *string `form:"notification_method" json:"notification_method"` } // SourceReceiverParams is the set of parameters allowed for the `receiver` hash on // source creation or update. type SourceReceiverParams struct { - RefundAttributesMethod *string `form:"refund_attributes_method"` + RefundAttributesMethod *string `form:"refund_attributes_method" json:"refund_attributes_method"` } // SourceObjectDetachParams is the set of parameters that can be used when detaching // a source from a customer. type SourceObjectDetachParams struct { - Params `form:"*"` - Customer *string `form:"-"` + Params `form:"*" json:"*"` + Customer *string `form:"-" json:"-"` } // SourceOwner describes the owner hash on a source. diff --git a/sourcetransaction.go b/sourcetransaction.go index f60e53099c..6537bddf3e 100644 --- a/sourcetransaction.go +++ b/sourcetransaction.go @@ -4,8 +4,8 @@ import "encoding/json" // SourceTransactionListParams is the set of parameters that can be used when listing SourceTransactions. type SourceTransactionListParams struct { - ListParams `form:"*" json:"*"` - Source *string `form:"-" json:"-"` // Sent in with the URL + ListParams `form:"*" json:"*" json:"*" json:"*"` + Source *string `form:"-" json:"-" json:"-" json:"-"` // Sent in with the URL } // SourceTransactionList is a list object for SourceTransactions. diff --git a/sub.go b/sub.go index a9832ab8ac..577cf1ce49 100644 --- a/sub.go +++ b/sub.go @@ -126,122 +126,122 @@ const ( // SubscriptionAddInvoiceItemParams is a structure representing the parameters allowed to control // the invoice items to add at to a subscription's first invoice. type SubscriptionAddInvoiceItemParams struct { - Price *string `form:"price"` - PriceData *InvoiceItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + Price *string `form:"price" json:"price"` + PriceData *InvoiceItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } // SubscriptionPauseCollectionParams is the set of parameters allowed for the pause_collection hash. type SubscriptionPauseCollectionParams struct { - Behavior *string `form:"behavior"` - ResumesAt *int64 `form:"resumes_at"` + Behavior *string `form:"behavior" json:"behavior"` + ResumesAt *int64 `form:"resumes_at" json:"resumes_at"` } // Additional fields for Mandate creation type SubscriptionPaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams struct { - TransactionType *string `form:"transaction_type"` + TransactionType *string `form:"transaction_type" json:"transaction_type"` } // This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. type SubscriptionPaymentSettingsPaymentMethodOptionsACSSDebitParams struct { - MandateOptions *SubscriptionPaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"` - VerificationMethod *string `form:"verification_method"` + MandateOptions *SubscriptionPaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options" json:"mandate_options"` + VerificationMethod *string `form:"verification_method" json:"verification_method"` } // This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. type SubscriptionPaymentSettingsPaymentMethodOptionsBancontactParams struct { - PreferredLanguage *string `form:"preferred_language"` + PreferredLanguage *string `form:"preferred_language" json:"preferred_language"` } // This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. type SubscriptionPaymentSettingsPaymentMethodOptionsCardParams struct { - RequestThreeDSecure *string `form:"request_three_d_secure"` + RequestThreeDSecure *string `form:"request_three_d_secure" json:"request_three_d_secure"` } // Payment-method-specific configuration to provide to invoices created by the subscription. type SubscriptionPaymentSettingsPaymentMethodOptionsParams struct { - ACSSDebit *SubscriptionPaymentSettingsPaymentMethodOptionsACSSDebitParams `form:"acss_debit"` - Bancontact *SubscriptionPaymentSettingsPaymentMethodOptionsBancontactParams `form:"bancontact"` - Card *SubscriptionPaymentSettingsPaymentMethodOptionsCardParams `form:"card"` + ACSSDebit *SubscriptionPaymentSettingsPaymentMethodOptionsACSSDebitParams `form:"acss_debit" json:"acss_debit"` + Bancontact *SubscriptionPaymentSettingsPaymentMethodOptionsBancontactParams `form:"bancontact" json:"bancontact"` + Card *SubscriptionPaymentSettingsPaymentMethodOptionsCardParams `form:"card" json:"card"` } // Payment settings to pass to invoices created by the subscription. type SubscriptionPaymentSettingsParams struct { - PaymentMethodOptions *SubscriptionPaymentSettingsPaymentMethodOptionsParams `form:"payment_method_options"` - PaymentMethodTypes []*string `form:"payment_method_types"` + PaymentMethodOptions *SubscriptionPaymentSettingsPaymentMethodOptionsParams `form:"payment_method_options" json:"payment_method_options"` + PaymentMethodTypes []*string `form:"payment_method_types" json:"payment_method_types"` } // SubscriptionPendingInvoiceItemIntervalParams is the set of parameters allowed for the transfer_data hash. type SubscriptionPendingInvoiceItemIntervalParams struct { - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` } // SubscriptionTransferDataParams is the set of parameters allowed for the transfer_data hash. type SubscriptionTransferDataParams struct { - AmountPercent *float64 `form:"amount_percent"` - Destination *string `form:"destination"` + AmountPercent *float64 `form:"amount_percent" json:"amount_percent"` + Destination *string `form:"destination" json:"destination"` } // SubscriptionParams is the set of parameters that can be used when creating or updating a subscription. // For more details see https://stripe.com/docs/api#create_subscription and https://stripe.com/docs/api#update_subscription. type SubscriptionParams struct { - Params `form:"*"` - AddInvoiceItems []*SubscriptionAddInvoiceItemParams `form:"add_invoice_items"` - ApplicationFeePercent *float64 `form:"application_fee_percent"` - AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax"` - BackdateStartDate *int64 `form:"backdate_start_date"` - BillingCycleAnchor *int64 `form:"billing_cycle_anchor"` - BillingCycleAnchorNow *bool `form:"-"` // See custom AppendTo - BillingCycleAnchorUnchanged *bool `form:"-"` // See custom AppendTo - BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds"` - CancelAt *int64 `form:"cancel_at"` - CancelAtPeriodEnd *bool `form:"cancel_at_period_end"` - Card *CardParams `form:"card"` - CollectionMethod *string `form:"collection_method"` - Coupon *string `form:"coupon"` - Customer *string `form:"customer"` - DaysUntilDue *int64 `form:"days_until_due"` - DefaultPaymentMethod *string `form:"default_payment_method"` - DefaultSource *string `form:"default_source"` - DefaultTaxRates []*string `form:"default_tax_rates"` - Items []*SubscriptionItemsParams `form:"items"` - OffSession *bool `form:"off_session"` - OnBehalfOf *string `form:"on_behalf_of"` - PauseCollection *SubscriptionPauseCollectionParams `form:"pause_collection"` - PaymentBehavior *string `form:"payment_behavior"` - PaymentSettings *SubscriptionPaymentSettingsParams `form:"payment_settings"` - PendingInvoiceItemInterval *SubscriptionPendingInvoiceItemIntervalParams `form:"pending_invoice_item_interval"` - Plan *string `form:"plan"` - PromotionCode *string `form:"promotion_code"` - ProrationBehavior *string `form:"proration_behavior"` - ProrationDate *int64 `form:"proration_date"` - Quantity *int64 `form:"quantity"` - TrialEnd *int64 `form:"trial_end"` - TransferData *SubscriptionTransferDataParams `form:"transfer_data"` - TrialEndNow *bool `form:"-"` // See custom AppendTo - TrialFromPlan *bool `form:"trial_from_plan"` - TrialPeriodDays *int64 `form:"trial_period_days"` + Params `form:"*" json:"*"` + AddInvoiceItems []*SubscriptionAddInvoiceItemParams `form:"add_invoice_items" json:"add_invoice_items"` + ApplicationFeePercent *float64 `form:"application_fee_percent" json:"application_fee_percent"` + AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax" json:"automatic_tax"` + BackdateStartDate *int64 `form:"backdate_start_date" json:"backdate_start_date"` + BillingCycleAnchor *int64 `form:"billing_cycle_anchor" json:"billing_cycle_anchor"` + BillingCycleAnchorNow *bool `form:"-" json:"-"` // See custom AppendTo + BillingCycleAnchorUnchanged *bool `form:"-" json:"-"` // See custom AppendTo + BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds" json:"billing_thresholds"` + CancelAt *int64 `form:"cancel_at" json:"cancel_at"` + CancelAtPeriodEnd *bool `form:"cancel_at_period_end" json:"cancel_at_period_end"` + Card *CardParams `form:"card" json:"card"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + Coupon *string `form:"coupon" json:"coupon"` + Customer *string `form:"customer" json:"customer"` + DaysUntilDue *int64 `form:"days_until_due" json:"days_until_due"` + DefaultPaymentMethod *string `form:"default_payment_method" json:"default_payment_method"` + DefaultSource *string `form:"default_source" json:"default_source"` + DefaultTaxRates []*string `form:"default_tax_rates" json:"default_tax_rates"` + Items []*SubscriptionItemsParams `form:"items" json:"items"` + OffSession *bool `form:"off_session" json:"off_session"` + OnBehalfOf *string `form:"on_behalf_of" json:"on_behalf_of"` + PauseCollection *SubscriptionPauseCollectionParams `form:"pause_collection" json:"pause_collection"` + PaymentBehavior *string `form:"payment_behavior" json:"payment_behavior"` + PaymentSettings *SubscriptionPaymentSettingsParams `form:"payment_settings" json:"payment_settings"` + PendingInvoiceItemInterval *SubscriptionPendingInvoiceItemIntervalParams `form:"pending_invoice_item_interval" json:"pending_invoice_item_interval"` + Plan *string `form:"plan" json:"plan"` + PromotionCode *string `form:"promotion_code" json:"promotion_code"` + ProrationBehavior *string `form:"proration_behavior" json:"proration_behavior"` + ProrationDate *int64 `form:"proration_date" json:"proration_date"` + Quantity *int64 `form:"quantity" json:"quantity"` + TrialEnd *int64 `form:"trial_end" json:"trial_end"` + TransferData *SubscriptionTransferDataParams `form:"transfer_data" json:"transfer_data"` + TrialEndNow *bool `form:"-" json:"-"` // See custom AppendTo + TrialFromPlan *bool `form:"trial_from_plan" json:"trial_from_plan"` + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` } type SubscriptionAutomaticTaxParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // SubscriptionBillingThresholdsParams is a structure representing the parameters allowed to control // billing thresholds for a subscription. type SubscriptionBillingThresholdsParams struct { - AmountGTE *int64 `form:"amount_gte"` - ResetBillingCycleAnchor *bool `form:"reset_billing_cycle_anchor"` + AmountGTE *int64 `form:"amount_gte" json:"amount_gte"` + ResetBillingCycleAnchor *bool `form:"reset_billing_cycle_anchor" json:"reset_billing_cycle_anchor"` } // SubscriptionCancelParams is the set of parameters that can be used when canceling a subscription. // For more details see https://stripe.com/docs/api#cancel_subscription type SubscriptionCancelParams struct { - Params `form:"*"` - InvoiceNow *bool `form:"invoice_now"` - Prorate *bool `form:"prorate"` + Params `form:"*" json:"*"` + InvoiceNow *bool `form:"invoice_now" json:"invoice_now"` + Prorate *bool `form:"prorate" json:"prorate"` } // AppendTo implements custom encoding logic for SubscriptionParams so that the special @@ -264,33 +264,33 @@ func (p *SubscriptionParams) AppendTo(body *form.Values, keyParts []string) { // SubscriptionItemsParams is the set of parameters that can be used when creating or updating a subscription item on a subscription // For more details see https://stripe.com/docs/api#create_subscription and https://stripe.com/docs/api#update_subscription. type SubscriptionItemsParams struct { - Params `form:"*"` - BillingThresholds *SubscriptionItemBillingThresholdsParams `form:"billing_thresholds"` - ClearUsage *bool `form:"clear_usage"` - Deleted *bool `form:"deleted"` - ID *string `form:"id"` - Plan *string `form:"plan"` - Price *string `form:"price"` - PriceData *SubscriptionItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + Params `form:"*" json:"*"` + BillingThresholds *SubscriptionItemBillingThresholdsParams `form:"billing_thresholds" json:"billing_thresholds"` + ClearUsage *bool `form:"clear_usage" json:"clear_usage"` + Deleted *bool `form:"deleted" json:"deleted"` + ID *string `form:"id" json:"id"` + Plan *string `form:"plan" json:"plan"` + Price *string `form:"price" json:"price"` + PriceData *SubscriptionItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } // SubscriptionListParams is the set of parameters that can be used when listing active subscriptions. // For more details see https://stripe.com/docs/api#list_subscriptions. type SubscriptionListParams struct { - ListParams `form:"*"` - CollectionMethod *string `form:"collection_method"` - Created int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - CurrentPeriodEnd *int64 `form:"current_period_end"` - CurrentPeriodEndRange *RangeQueryParams `form:"current_period_end"` - CurrentPeriodStart *int64 `form:"current_period_start"` - CurrentPeriodStartRange *RangeQueryParams `form:"current_period_start"` - Customer string `form:"customer"` - Plan string `form:"plan"` - Price string `form:"price"` - Status string `form:"status"` + ListParams `form:"*" json:"*"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + Created int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + CurrentPeriodEnd *int64 `form:"current_period_end" json:"current_period_end"` + CurrentPeriodEndRange *RangeQueryParams `form:"current_period_end" json:"current_period_end"` + CurrentPeriodStart *int64 `form:"current_period_start" json:"current_period_start"` + CurrentPeriodStartRange *RangeQueryParams `form:"current_period_start" json:"current_period_start"` + Customer string `form:"customer" json:"customer"` + Plan string `form:"plan" json:"plan"` + Price string `form:"price" json:"price"` + Status string `form:"status" json:"status"` } // SubscriptionPauseCollection if specified, payment collection for this subscription will be paused. diff --git a/subitem.go b/subitem.go index 850b3d1ab3..565dfdfffe 100644 --- a/subitem.go +++ b/subitem.go @@ -9,52 +9,52 @@ package stripe // SubscriptionItemPriceDataRecurringParams is a structure representing the parameters to create // an inline recurring price for a subscription item. type SubscriptionItemPriceDataRecurringParams struct { - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` } // SubscriptionItemPriceDataParams is a structure representing the parameters to create an inline // price for a subscription item. type SubscriptionItemPriceDataParams struct { - Currency *string `form:"currency"` - Product *string `form:"product"` - Recurring *SubscriptionItemPriceDataRecurringParams `form:"recurring"` - TaxBehavior *string `form:"tax_behavior"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Currency *string `form:"currency" json:"currency"` + Product *string `form:"product" json:"product"` + Recurring *SubscriptionItemPriceDataRecurringParams `form:"recurring" json:"recurring"` + TaxBehavior *string `form:"tax_behavior" json:"tax_behavior"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // SubscriptionItemParams is the set of parameters that can be used when creating or updating a subscription item. // For more details see https://stripe.com/docs/api#create_subscription_item and https://stripe.com/docs/api#update_subscription_item. type SubscriptionItemParams struct { - Params `form:"*"` - BillingThresholds *SubscriptionItemBillingThresholdsParams `form:"billing_thresholds"` - ClearUsage *bool `form:"clear_usage"` - OffSession *bool `form:"off_session"` // Only supported on update - PaymentBehavior *string `form:"payment_behavior"` - Plan *string `form:"plan"` - Price *string `form:"price"` - PriceData *SubscriptionItemPriceDataParams `form:"price_data"` - ProrationBehavior *string `form:"proration_behavior"` - ProrationDate *int64 `form:"proration_date"` - Quantity *int64 `form:"quantity"` - Subscription *string `form:"subscription"` - TaxRates []*string `form:"tax_rates"` + Params `form:"*" json:"*"` + BillingThresholds *SubscriptionItemBillingThresholdsParams `form:"billing_thresholds" json:"billing_thresholds"` + ClearUsage *bool `form:"clear_usage" json:"clear_usage"` + OffSession *bool `form:"off_session" json:"off_session"` // Only supported on update + PaymentBehavior *string `form:"payment_behavior" json:"payment_behavior"` + Plan *string `form:"plan" json:"plan"` + Price *string `form:"price" json:"price"` + PriceData *SubscriptionItemPriceDataParams `form:"price_data" json:"price_data"` + ProrationBehavior *string `form:"proration_behavior" json:"proration_behavior"` + ProrationDate *int64 `form:"proration_date" json:"proration_date"` + Quantity *int64 `form:"quantity" json:"quantity"` + Subscription *string `form:"subscription" json:"subscription"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` - ID *string `form:"-"` // Deprecated + ID *string `form:"-" json:"-"` // Deprecated } // SubscriptionItemBillingThresholdsParams is a structure representing the parameters allowed to // control billing thresholds for a subscription item. type SubscriptionItemBillingThresholdsParams struct { - UsageGTE *int64 `form:"usage_gte"` + UsageGTE *int64 `form:"usage_gte" json:"usage_gte"` } // SubscriptionItemListParams is the set of parameters that can be used when listing invoice items. // For more details see https://stripe.com/docs/api#list_invoiceitems. type SubscriptionItemListParams struct { - ListParams `form:"*"` - Subscription *string `form:"subscription"` + ListParams `form:"*" json:"*"` + Subscription *string `form:"subscription" json:"subscription"` } // SubscriptionItem is the resource representing a Stripe subscription item. @@ -77,7 +77,7 @@ type SubscriptionItem struct { // SubscriptionItemBillingThresholds is a structure representing the billing thresholds for a // subscription item. type SubscriptionItemBillingThresholds struct { - UsageGTE int64 `form:"usage_gte"` + UsageGTE int64 `form:"usage_gte" json:"usage_gte"` } // SubscriptionItemList is a list of invoice items as retrieved from a list endpoint. diff --git a/subschedule.go b/subschedule.go index d4c656769a..eae0b8aef5 100644 --- a/subschedule.go +++ b/subschedule.go @@ -40,103 +40,103 @@ const ( // SubscriptionScheduleInvoiceSettingsParams is a structure representing the parameters allowed to // control invoice settings on invoices associated with a subscription schedule. type SubscriptionScheduleInvoiceSettingsParams struct { - DaysUntilDue *int64 `form:"days_until_due"` + DaysUntilDue *int64 `form:"days_until_due" json:"days_until_due"` } // SubscriptionScheduleDefaultSettingsParams is the set of parameters // representing the subscription schedule’s default settings. type SubscriptionScheduleDefaultSettingsParams struct { - Params `form:"*"` - ApplicationFeePercent *float64 `form:"application_fee_percent,high_precision"` - AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax"` - BillingCycleAnchor *string `form:"billing_cycle_anchor"` - BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds"` - CollectionMethod *string `form:"collection_method"` - DefaultPaymentMethod *string `form:"default_payment_method"` - InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"` - TransferData *SubscriptionTransferDataParams `form:"transfer_data"` + Params `form:"*" json:"*"` + ApplicationFeePercent *float64 `form:"application_fee_percent,high_precision" json:"application_fee_percent,high_precision"` + AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax" json:"automatic_tax"` + BillingCycleAnchor *string `form:"billing_cycle_anchor" json:"billing_cycle_anchor"` + BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds" json:"billing_thresholds"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + DefaultPaymentMethod *string `form:"default_payment_method" json:"default_payment_method"` + InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings" json:"invoice_settings"` + TransferData *SubscriptionTransferDataParams `form:"transfer_data" json:"transfer_data"` } // SubscriptionSchedulePhaseAddInvoiceItemPriceDataRecurringParams is a structure representing the // parameters to create an inline recurring price for a given invoice item. type SubscriptionSchedulePhaseAddInvoiceItemPriceDataRecurringParams struct { - AggregateUsage *string `form:"aggregate_usage"` - Interval *string `form:"interval"` - IntervalCount *int64 `form:"interval_count"` - TrialPeriodDays *int64 `form:"trial_period_days"` - UsageType *string `form:"usage_type"` + AggregateUsage *string `form:"aggregate_usage" json:"aggregate_usage"` + Interval *string `form:"interval" json:"interval"` + IntervalCount *int64 `form:"interval_count" json:"interval_count"` + TrialPeriodDays *int64 `form:"trial_period_days" json:"trial_period_days"` + UsageType *string `form:"usage_type" json:"usage_type"` } // SubscriptionSchedulePhaseAddInvoiceItemPriceDataParams is a structure representing the parameters // to create an inline price for a given invoice item. type SubscriptionSchedulePhaseAddInvoiceItemPriceDataParams struct { - Currency *string `form:"currency"` - Product *string `form:"product"` - Recurring *SubscriptionSchedulePhaseAddInvoiceItemPriceDataRecurringParams `form:"recurring"` - TaxBehavior *string `form:"tax_behavior"` - UnitAmount *int64 `form:"unit_amount"` - UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + Currency *string `form:"currency" json:"currency"` + Product *string `form:"product" json:"product"` + Recurring *SubscriptionSchedulePhaseAddInvoiceItemPriceDataRecurringParams `form:"recurring" json:"recurring"` + TaxBehavior *string `form:"tax_behavior" json:"tax_behavior"` + UnitAmount *int64 `form:"unit_amount" json:"unit_amount"` + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision" json:"unit_amount_decimal,high_precision"` } // SubscriptionSchedulePhaseAddInvoiceItemParams is a structure representing the parameters allowed to control // the invoice items to add at the start of a phase. type SubscriptionSchedulePhaseAddInvoiceItemParams struct { - Price *string `form:"price"` - PriceData *InvoiceItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + Price *string `form:"price" json:"price"` + PriceData *InvoiceItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } type SubscriptionSchedulePhaseAutomaticTaxParams struct { - Enabled *bool `form:"enabled"` + Enabled *bool `form:"enabled" json:"enabled"` } // SubscriptionSchedulePhaseItemParams is a structure representing the parameters allowed to control // a specic plan on a phase on a subscription schedule. type SubscriptionSchedulePhaseItemParams struct { - BillingThresholds *SubscriptionItemBillingThresholdsParams `form:"billing_thresholds"` - Plan *string `form:"plan"` - Price *string `form:"price"` - PriceData *SubscriptionItemPriceDataParams `form:"price_data"` - Quantity *int64 `form:"quantity"` - TaxRates []*string `form:"tax_rates"` + BillingThresholds *SubscriptionItemBillingThresholdsParams `form:"billing_thresholds" json:"billing_thresholds"` + Plan *string `form:"plan" json:"plan"` + Price *string `form:"price" json:"price"` + PriceData *SubscriptionItemPriceDataParams `form:"price_data" json:"price_data"` + Quantity *int64 `form:"quantity" json:"quantity"` + TaxRates []*string `form:"tax_rates" json:"tax_rates"` } // SubscriptionSchedulePhaseParams is a structure representing the parameters allowed to control // a phase on a subscription schedule. type SubscriptionSchedulePhaseParams struct { - AddInvoiceItems []*SubscriptionSchedulePhaseAddInvoiceItemParams `form:"add_invoice_items"` - ApplicationFeePercent *float64 `form:"application_fee_percent"` - AutomaticTax *SubscriptionSchedulePhaseAutomaticTaxParams `form:"automatic_tax"` - BillingCycleAnchor *string `form:"billing_cycle_anchor"` - BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds"` - CollectionMethod *string `form:"collection_method"` - Coupon *string `form:"coupon"` - DefaultPaymentMethod *string `form:"default_payment_method"` - DefaultTaxRates []*string `form:"default_tax_rates"` - EndDate *int64 `form:"end_date"` - InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"` - Iterations *int64 `form:"iterations"` - Items []*SubscriptionSchedulePhaseItemParams `form:"items"` - ProrationBehavior *string `form:"proration_behavior"` - StartDate *int64 `form:"start_date"` - TransferData *SubscriptionTransferDataParams `form:"transfer_data"` - Trial *bool `form:"trial"` - TrialEnd *int64 `form:"trial_end"` + AddInvoiceItems []*SubscriptionSchedulePhaseAddInvoiceItemParams `form:"add_invoice_items" json:"add_invoice_items"` + ApplicationFeePercent *float64 `form:"application_fee_percent" json:"application_fee_percent"` + AutomaticTax *SubscriptionSchedulePhaseAutomaticTaxParams `form:"automatic_tax" json:"automatic_tax"` + BillingCycleAnchor *string `form:"billing_cycle_anchor" json:"billing_cycle_anchor"` + BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds" json:"billing_thresholds"` + CollectionMethod *string `form:"collection_method" json:"collection_method"` + Coupon *string `form:"coupon" json:"coupon"` + DefaultPaymentMethod *string `form:"default_payment_method" json:"default_payment_method"` + DefaultTaxRates []*string `form:"default_tax_rates" json:"default_tax_rates"` + EndDate *int64 `form:"end_date" json:"end_date"` + InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings" json:"invoice_settings"` + Iterations *int64 `form:"iterations" json:"iterations"` + Items []*SubscriptionSchedulePhaseItemParams `form:"items" json:"items"` + ProrationBehavior *string `form:"proration_behavior" json:"proration_behavior"` + StartDate *int64 `form:"start_date" json:"start_date"` + TransferData *SubscriptionTransferDataParams `form:"transfer_data" json:"transfer_data"` + Trial *bool `form:"trial" json:"trial"` + TrialEnd *int64 `form:"trial_end" json:"trial_end"` } // SubscriptionScheduleParams is the set of parameters that can be used when creating or updating a // subscription schedule. type SubscriptionScheduleParams struct { - Params `form:"*"` - Customer *string `form:"customer"` - DefaultSettings *SubscriptionScheduleDefaultSettingsParams `form:"default_settings"` - EndBehavior *string `form:"end_behavior"` - FromSubscription *string `form:"from_subscription"` - ProrationBehavior *string `form:"proration_behavior"` - Phases []*SubscriptionSchedulePhaseParams `form:"phases"` - StartDate *int64 `form:"start_date"` - StartDateNow *bool `form:"-"` // See custom AppendTo + Params `form:"*" json:"*"` + Customer *string `form:"customer" json:"customer"` + DefaultSettings *SubscriptionScheduleDefaultSettingsParams `form:"default_settings" json:"default_settings"` + EndBehavior *string `form:"end_behavior" json:"end_behavior"` + FromSubscription *string `form:"from_subscription" json:"from_subscription"` + ProrationBehavior *string `form:"proration_behavior" json:"proration_behavior"` + Phases []*SubscriptionSchedulePhaseParams `form:"phases" json:"phases"` + StartDate *int64 `form:"start_date" json:"start_date"` + StartDateNow *bool `form:"-" json:"-"` // See custom AppendTo } // AppendTo implements custom encoding logic for SubscriptionScheduleParams so that the special @@ -150,32 +150,32 @@ func (p *SubscriptionScheduleParams) AppendTo(body *form.Values, keyParts []stri // SubscriptionScheduleCancelParams is the set of parameters that can be used when canceling a // subscription schedule. type SubscriptionScheduleCancelParams struct { - Params `form:"*"` - InvoiceNow *bool `form:"invoice_now"` - Prorate *bool `form:"prorate"` + Params `form:"*" json:"*"` + InvoiceNow *bool `form:"invoice_now" json:"invoice_now"` + Prorate *bool `form:"prorate" json:"prorate"` } // SubscriptionScheduleReleaseParams is the set of parameters that can be used when releasing a // subscription schedule. type SubscriptionScheduleReleaseParams struct { - Params `form:"*"` - PreserveCancelDate *bool `form:"preserve_cancel_date"` + Params `form:"*" json:"*"` + PreserveCancelDate *bool `form:"preserve_cancel_date" json:"preserve_cancel_date"` } // SubscriptionScheduleListParams is the set of parameters that can be used when listing // subscription schedules. type SubscriptionScheduleListParams struct { - ListParams `form:"*"` - CanceledAt int64 `form:"canceled_at"` - CanceledAtRange *RangeQueryParams `form:"canceled_at"` - CompletedAt int64 `form:"completed_at"` - CompletedAtRange *RangeQueryParams `form:"completed_at"` - Created int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Customer string `form:"customer"` - ReleasedAt int64 `form:"released_at"` - ReleasedAtRange *RangeQueryParams `form:"released_at"` - Scheduled *bool `form:"scheduled"` + ListParams `form:"*" json:"*"` + CanceledAt int64 `form:"canceled_at" json:"canceled_at"` + CanceledAtRange *RangeQueryParams `form:"canceled_at" json:"canceled_at"` + CompletedAt int64 `form:"completed_at" json:"completed_at"` + CompletedAtRange *RangeQueryParams `form:"completed_at" json:"completed_at"` + Created int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Customer string `form:"customer" json:"customer"` + ReleasedAt int64 `form:"released_at" json:"released_at"` + ReleasedAtRange *RangeQueryParams `form:"released_at" json:"released_at"` + Scheduled *bool `form:"scheduled" json:"scheduled"` } // SubscriptionScheduleCurrentPhase is a structure the current phase's period. diff --git a/taxcode.go b/taxcode.go index 552a41b108..61a51db878 100644 --- a/taxcode.go +++ b/taxcode.go @@ -10,12 +10,12 @@ import "encoding/json" // A list of [all tax codes available](https://stripe.com/docs/tax/tax-codes) to add to Products in order to allow specific tax calculations. type TaxCodeListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` } // Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. type TaxCodeParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // [Tax codes](https://stripe.com/docs/tax/tax-codes) classify goods and services for tax purposes. diff --git a/taxid.go b/taxid.go index d061d82419..c6bd6d9e27 100644 --- a/taxid.go +++ b/taxid.go @@ -69,17 +69,17 @@ const ( // TaxIDParams is the set of parameters that can be used when creating a tax id. // For more details see https://stripe.com/docs/api/customers/create_tax_id type TaxIDParams struct { - Params `form:"*"` - Customer *string `form:"-"` // Included in URL - Type *string `form:"type"` - Value *string `form:"value"` + Params `form:"*" json:"*"` + Customer *string `form:"-" json:"-"` // Included in URL + Type *string `form:"type" json:"type"` + Value *string `form:"value" json:"value"` } // TaxIDListParams is the set of parameters that can be used when listing tax ids. // For more detail see https://stripe.com/docs/api/customers/tax_ids type TaxIDListParams struct { - ListParams `form:"*"` - Customer *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + Customer *string `form:"-" json:"-"` // Included in URL } // TaxIDVerification represents the verification details of a customer's tax id. diff --git a/taxrate.go b/taxrate.go index 1c84da01d0..357069860d 100644 --- a/taxrate.go +++ b/taxrate.go @@ -24,26 +24,26 @@ const ( // TaxRateParams is the set of parameters that can be used when creating a tax rate. // For more details see https://stripe.com/docs/api/tax_rates/create. type TaxRateParams struct { - Params `form:"*"` - Active *bool `form:"active"` - Country *string `form:"country"` - Description *string `form:"description"` - DisplayName *string `form:"display_name"` - Inclusive *bool `form:"inclusive"` - Jurisdiction *string `form:"jurisdiction"` - Percentage *float64 `form:"percentage"` - State *string `form:"state"` - TaxType *string `form:"tax_type"` + Params `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Country *string `form:"country" json:"country"` + Description *string `form:"description" json:"description"` + DisplayName *string `form:"display_name" json:"display_name"` + Inclusive *bool `form:"inclusive" json:"inclusive"` + Jurisdiction *string `form:"jurisdiction" json:"jurisdiction"` + Percentage *float64 `form:"percentage" json:"percentage"` + State *string `form:"state" json:"state"` + TaxType *string `form:"tax_type" json:"tax_type"` } // TaxRateListParams is the set of parameters that can be used when listing tax rates. // For more detail see https://stripe.com/docs/api/tax_rates/list. type TaxRateListParams struct { - ListParams `form:"*"` - Active *bool `form:"active"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Inclusive *bool `form:"inclusive"` + ListParams `form:"*" json:"*"` + Active *bool `form:"active" json:"active"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Inclusive *bool `form:"inclusive" json:"inclusive"` } // TaxRate is the resource representing a Stripe tax rate. diff --git a/terminal_connectiontoken.go b/terminal_connectiontoken.go index c4c7ec5005..b334573983 100644 --- a/terminal_connectiontoken.go +++ b/terminal_connectiontoken.go @@ -8,8 +8,8 @@ package stripe // TerminalConnectionTokenParams is the set of parameters that can be used when creating a terminal connection token. type TerminalConnectionTokenParams struct { - Params `form:"*"` - Location string `form:"location"` + Params `form:"*" json:"*"` + Location string `form:"location" json:"location"` } // TerminalConnectionToken is the resource representing a Stripe terminal connection token. diff --git a/terminal_location.go b/terminal_location.go index 319994d91c..1e91be2f37 100644 --- a/terminal_location.go +++ b/terminal_location.go @@ -8,14 +8,14 @@ package stripe // TerminalLocationParams is the set of parameters that can be used when creating or updating a terminal location. type TerminalLocationParams struct { - Params `form:"*"` - Address *AccountAddressParams `form:"address"` - DisplayName *string `form:"display_name"` + Params `form:"*" json:"*"` + Address *AccountAddressParams `form:"address" json:"address"` + DisplayName *string `form:"display_name" json:"display_name"` } // TerminalLocationListParams is the set of parameters that can be used when listing temrinal locations. type TerminalLocationListParams struct { - ListParams `form:"*"` + ListParams `form:"*" json:"*"` } // TerminalLocation is the resource representing a Stripe terminal location. diff --git a/terminal_reader.go b/terminal_reader.go index 4627bd6c88..ea81afe048 100644 --- a/terminal_reader.go +++ b/terminal_reader.go @@ -17,23 +17,23 @@ const ( // TerminalReaderParams is the set of parameters that can be used for creating or updating a terminal reader. type TerminalReaderParams struct { - Params `form:"*"` - Label *string `form:"label"` - Location *string `form:"location"` - RegistrationCode *string `form:"registration_code"` + Params `form:"*" json:"*"` + Label *string `form:"label" json:"label"` + Location *string `form:"location" json:"location"` + RegistrationCode *string `form:"registration_code" json:"registration_code"` } // TerminalReaderGetParams is the set of parameters that can be used to get a terminal reader. type TerminalReaderGetParams struct { - Params `form:"*"` + Params `form:"*" json:"*"` } // TerminalReaderListParams is the set of parameters that can be used when listing temrinal readers. type TerminalReaderListParams struct { - ListParams `form:"*"` - DeviceType *string `form:"device_type"` - Location *string `form:"location"` - Status *string `form:"status"` + ListParams `form:"*" json:"*"` + DeviceType *string `form:"device_type" json:"device_type"` + Location *string `form:"location" json:"location"` + Status *string `form:"status" json:"status"` } // TerminalReader is the resource representing a Stripe terminal reader. diff --git a/threedsecure.go b/threedsecure.go index 6be0195777..684fa414b4 100644 --- a/threedsecure.go +++ b/threedsecure.go @@ -5,12 +5,12 @@ type ThreeDSecureStatus string // ThreeDSecureParams is the set of parameters that can be used when creating a 3DS object. type ThreeDSecureParams struct { - Params `form:"*" json:"*"` - Amount *int64 `form:"amount" json:"amount"` - Card *string `form:"card" json:"card"` - Currency *string `form:"currency" json:"currency"` - Customer *string `form:"customer" json:"customer"` - ReturnURL *string `form:"return_url" json:"return_url"` + 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 diff --git a/token.go b/token.go index 3a3f23e13a..4a9d683aee 100644 --- a/token.go +++ b/token.go @@ -14,15 +14,15 @@ const ( // TokenCVCUpdateParams is the set of parameters that can be used when creating a CVC token. type TokenCVCUpdateParams struct { - CVC *string `form:"cvc"` + CVC *string `form:"cvc" json:"cvc"` } // TokenAccountParams is the set of parameters that can be used when creating a Account token. type TokenAccountParams struct { - BusinessType *string `form:"business_type"` - Company *AccountCompanyParams `form:"company"` - Individual *PersonParams `form:"individual"` - TOSShownAndAccepted *bool `form:"tos_shown_and_accepted"` + BusinessType *string `form:"business_type" json:"business_type"` + Company *AccountCompanyParams `form:"company" json:"company"` + Individual *PersonParams `form:"individual" json:"individual"` + TOSShownAndAccepted *bool `form:"tos_shown_and_accepted" json:"tos_shown_and_accepted"` } // TokenParams is the set of parameters that can be used when creating a token. @@ -32,19 +32,19 @@ type TokenAccountParams struct { // - https://stripe.com/docs/api/tokens/create_account // - https://stripe.com/docs/api/tokens/create_person type TokenParams struct { - Params `form:"*"` - Account *TokenAccountParams `form:"account"` - BankAccount *BankAccountParams `form:"bank_account"` - Card *CardParams `form:"card"` - Customer *string `form:"customer"` - CVCUpdate *TokenCVCUpdateParams `form:"cvc_update"` - Person *PersonParams `form:"person"` + Params `form:"*" json:"*"` + Account *TokenAccountParams `form:"account" json:"account"` + BankAccount *BankAccountParams `form:"bank_account" json:"bank_account"` + Card *CardParams `form:"card" json:"card"` + Customer *string `form:"customer" json:"customer"` + CVCUpdate *TokenCVCUpdateParams `form:"cvc_update" json:"cvc_update"` + Person *PersonParams `form:"person" json:"person"` // Email is an undocumented parameter used by Stripe Checkout // It may be removed from the API without notice. - Email *string `form:"email"` + Email *string `form:"email" json:"email"` - PII *PIIParams `form:"pii"` + PII *PIIParams `form:"pii" json:"pii"` } // Token is the resource representing a Stripe token. @@ -69,6 +69,6 @@ type Token struct { // PIIParams are parameters for personal identifiable information (PII). type PIIParams struct { - Params `form:"*"` - IDNumber *string `form:"id_number"` + Params `form:"*" json:"*"` + IDNumber *string `form:"id_number" json:"id_number"` } diff --git a/topup.go b/topup.go index 72d3bde616..c1deba32cb 100644 --- a/topup.go +++ b/topup.go @@ -23,13 +23,13 @@ const ( // TopupParams is the set of parameters that can be used when creating or updating a top-up. // For more details see https://stripe.com/docs/api#create_topup and https://stripe.com/docs/api#update_topup. type TopupParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" - StatementDescriptor *string `form:"statement_descriptor"` - TransferGroup *string `form:"transfer_group"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + Source *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*" json:"*"` // SourceParams has custom encoding so brought to top level with "*" + StatementDescriptor *string `form:"statement_descriptor" json:"statement_descriptor"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // SetSource adds valid sources to a TopupParams object, @@ -43,12 +43,12 @@ func (p *TopupParams) SetSource(sp interface{}) error { // TopupListParams is the set of parameters that can be used when listing top-ups. // For more details see https://stripe.com/docs/api#list_topups. type TopupListParams struct { - ListParams `form:"*"` - Amount *int64 `form:"amount"` - AmountRange *RangeQueryParams `form:"amount"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Status *string `form:"status"` + ListParams `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + AmountRange *RangeQueryParams `form:"amount" json:"amount"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Status *string `form:"status" json:"status"` } // Topup is the resource representing a Stripe top-up. diff --git a/transfer.go b/transfer.go index bdce009add..194e4cee90 100644 --- a/transfer.go +++ b/transfer.go @@ -21,24 +21,24 @@ const ( // TransferParams is the set of parameters that can be used when creating or updating a transfer. // For more details see https://stripe.com/docs/api#create_transfer and https://stripe.com/docs/api#update_transfer. type TransferParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - Destination *string `form:"destination"` - SourceTransaction *string `form:"source_transaction"` - SourceType *string `form:"source_type"` - TransferGroup *string `form:"transfer_group"` + Params `form:"*" json:"*"` + Amount *int64 `form:"amount" json:"amount"` + Currency *string `form:"currency" json:"currency"` + Description *string `form:"description" json:"description"` + Destination *string `form:"destination" json:"destination"` + SourceTransaction *string `form:"source_transaction" json:"source_transaction"` + SourceType *string `form:"source_type" json:"source_type"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // TransferListParams is the set of parameters that can be used when listing transfers. // For more details see https://stripe.com/docs/api#list_transfers. type TransferListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - Destination *string `form:"destination"` - TransferGroup *string `form:"transfer_group"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` + Destination *string `form:"destination" json:"destination"` + TransferGroup *string `form:"transfer_group" json:"transfer_group"` } // TransferDestination describes the destination of a Transfer. diff --git a/usagerecord.go b/usagerecord.go index 550a82da20..82d486dfc9 100644 --- a/usagerecord.go +++ b/usagerecord.go @@ -15,11 +15,11 @@ const ( // UsageRecordParams create a usage record for a specified subscription item // and date, and fills it with a quantity. type UsageRecordParams struct { - Params `form:"*"` - SubscriptionItem *string `form:"-"` // Included in URL - Action *string `form:"action"` - Quantity *int64 `form:"quantity"` - Timestamp *int64 `form:"timestamp"` + Params `form:"*" json:"*"` + SubscriptionItem *string `form:"-" json:"-"` // Included in URL + Action *string `form:"action" json:"action"` + Quantity *int64 `form:"quantity" json:"quantity"` + Timestamp *int64 `form:"timestamp" json:"timestamp"` } // UsageRecord represents a usage record. diff --git a/usagerecordsummary.go b/usagerecordsummary.go index 3cbcb081c5..4dcc48aaa5 100644 --- a/usagerecordsummary.go +++ b/usagerecordsummary.go @@ -8,8 +8,8 @@ package stripe // UsageRecordSummaryListParams is the set of parameters that can be used when listing charges. type UsageRecordSummaryListParams struct { - ListParams `form:"*"` - SubscriptionItem *string `form:"-"` // Included in URL + ListParams `form:"*" json:"*"` + SubscriptionItem *string `form:"-" json:"-"` // Included in URL } // UsageRecordSummary represents a usage record summary. diff --git a/v32_migration_guide.md b/v32_migration_guide.md index dd3d8e74c6..eb3fad2b2f 100644 --- a/v32_migration_guide.md +++ b/v32_migration_guide.md @@ -10,7 +10,7 @@ like this: ``` go type UsageRecordParams struct { - Quantity uint64 `form:"quantity" json:"quantity"` + Quantity uint64 `form:"quantity" json:"quantity" json:"quantity" json:"quantity"` } ``` @@ -34,8 +34,8 @@ that the zero value was intended, which was quite unintuitive for users: ``` go type UsageRecordParams struct { - Quantity uint64 `form:"quantity" json:"quantity"` - QuantityZero bool `form:"quantity,zero" json:"quantity,zero"` + Quantity uint64 `form:"quantity" json:"quantity" json:"quantity" json:"quantity"` + QuantityZero bool `form:"quantity,zero" json:"quantity,zero" json:"quantity,zero" json:"quantity,zero"` } UsageRecord { @@ -48,7 +48,7 @@ instead. So the above becomes: ``` go type UsageRecordParams struct { - Quantity *int64 `form:"quantity" json:"quantity"` + Quantity *int64 `form:"quantity" json:"quantity" json:"quantity" json:"quantity"` } ``` diff --git a/webhookendpoint.go b/webhookendpoint.go index 76ee06e470..f627c913a6 100644 --- a/webhookendpoint.go +++ b/webhookendpoint.go @@ -11,24 +11,24 @@ import "encoding/json" // WebhookEndpointParams is the set of parameters that can be used when creating a webhook endpoint. // For more details see https://stripe.com/docs/api#create_webhook_endpoint. type WebhookEndpointParams struct { - Params `form:"*"` - Connect *bool `form:"connect"` - Description *string `form:"description"` - Disabled *bool `form:"disabled"` - EnabledEvents []*string `form:"enabled_events"` - URL *string `form:"url"` + Params `form:"*" json:"*"` + Connect *bool `form:"connect" json:"connect"` + Description *string `form:"description" json:"description"` + Disabled *bool `form:"disabled" json:"disabled"` + EnabledEvents []*string `form:"enabled_events" json:"enabled_events"` + URL *string `form:"url" json:"url"` // This parameter is only available on creation. // We recommend setting the API version that the library is pinned to. See apiversion in stripe.go - APIVersion *string `form:"api_version"` + APIVersion *string `form:"api_version" json:"api_version"` } // WebhookEndpointListParams is the set of parameters that can be used when listing webhook endpoints. // For more detail see https://stripe.com/docs/api#list_webhook_endpoints. type WebhookEndpointListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` + ListParams `form:"*" json:"*"` + Created *int64 `form:"created" json:"created"` + CreatedRange *RangeQueryParams `form:"created" json:"created"` } // WebhookEndpoint is the resource representing a Stripe webhook endpoint.