From a7ef3526ead8aa20ae0dc95bb57af3678f566adc Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 14 Jan 2021 18:44:59 -0500 Subject: [PATCH 1/6] checkout.Session customer_details + dynamic_tax_rates --- checkout_session.go | 87 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 9 deletions(-) diff --git a/checkout_session.go b/checkout_session.go index 6bf75bc2be..0133645005 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -4,6 +4,58 @@ import ( "encoding/json" ) +// CheckoutSessionCustomerDetailsTaxIdsType is the list of allowed values for type +// on the tax_ids inside customer_details of a checkout session. +type CheckoutSessionCustomerDetailsTaxIdsType string + +// List of values that CheckoutSessionCustomerDetailsTaxIdsType can take. +const ( + CheckoutSessionCustomerDetailsTaxIdsTypeAETRN CheckoutSessionCustomerDetailsTaxIdsType = "ae_trn" + CheckoutSessionCustomerDetailsTaxIdsTypeAUABN CheckoutSessionCustomerDetailsTaxIdsType = "au_abn" + CheckoutSessionCustomerDetailsTaxIdsTypeBRCNPJ CheckoutSessionCustomerDetailsTaxIdsType = "br_cnpj" + CheckoutSessionCustomerDetailsTaxIdsTypeBRCPF CheckoutSessionCustomerDetailsTaxIdsType = "br_cpf" + CheckoutSessionCustomerDetailsTaxIdsTypeCABN CheckoutSessionCustomerDetailsTaxIdsType = "ca_bn" + CheckoutSessionCustomerDetailsTaxIdsTypeCAQST CheckoutSessionCustomerDetailsTaxIdsType = "ca_qst" + CheckoutSessionCustomerDetailsTaxIdsTypeCHVAT CheckoutSessionCustomerDetailsTaxIdsType = "ch_vat" + CheckoutSessionCustomerDetailsTaxIdsTypeCLTIN CheckoutSessionCustomerDetailsTaxIdsType = "cl_tin" + CheckoutSessionCustomerDetailsTaxIdsTypeESCIF CheckoutSessionCustomerDetailsTaxIdsType = "es_cif" + CheckoutSessionCustomerDetailsTaxIdsTypeEUVAT CheckoutSessionCustomerDetailsTaxIdsType = "eu_vat" + CheckoutSessionCustomerDetailsTaxIdsTypeHKBR CheckoutSessionCustomerDetailsTaxIdsType = "hk_br" + CheckoutSessionCustomerDetailsTaxIdsTypeIDNPWP CheckoutSessionCustomerDetailsTaxIdsType = "id_npwp" + CheckoutSessionCustomerDetailsTaxIdsTypeINGST CheckoutSessionCustomerDetailsTaxIdsType = "in_gst" + CheckoutSessionCustomerDetailsTaxIdsTypeJPCN CheckoutSessionCustomerDetailsTaxIdsType = "jp_cn" + CheckoutSessionCustomerDetailsTaxIdsTypeJPRN CheckoutSessionCustomerDetailsTaxIdsType = "jp_rn" + CheckoutSessionCustomerDetailsTaxIdsTypeKRBRN CheckoutSessionCustomerDetailsTaxIdsType = "kr_brn" + CheckoutSessionCustomerDetailsTaxIdsTypeLIUID CheckoutSessionCustomerDetailsTaxIdsType = "li_uid" + CheckoutSessionCustomerDetailsTaxIdsTypeMXRFC CheckoutSessionCustomerDetailsTaxIdsType = "mx_rfc" + CheckoutSessionCustomerDetailsTaxIdsTypeMYFRP CheckoutSessionCustomerDetailsTaxIdsType = "my_frp" + CheckoutSessionCustomerDetailsTaxIdsTypeMYITN CheckoutSessionCustomerDetailsTaxIdsType = "my_itn" + CheckoutSessionCustomerDetailsTaxIdsTypeMYSST CheckoutSessionCustomerDetailsTaxIdsType = "my_sst" + CheckoutSessionCustomerDetailsTaxIdsTypeNOVAT CheckoutSessionCustomerDetailsTaxIdsType = "no_vat" + CheckoutSessionCustomerDetailsTaxIdsTypeNZGST CheckoutSessionCustomerDetailsTaxIdsType = "nz_gst" + CheckoutSessionCustomerDetailsTaxIdsTypeRUINN CheckoutSessionCustomerDetailsTaxIdsType = "ru_inn" + CheckoutSessionCustomerDetailsTaxIdsTypeRUKPP CheckoutSessionCustomerDetailsTaxIdsType = "ru_kpp" + CheckoutSessionCustomerDetailsTaxIdsTypeSAVAT CheckoutSessionCustomerDetailsTaxIdsType = "sa_vat" + CheckoutSessionCustomerDetailsTaxIdsTypeSGGST CheckoutSessionCustomerDetailsTaxIdsType = "sg_gst" + CheckoutSessionCustomerDetailsTaxIdsTypeSGUEN CheckoutSessionCustomerDetailsTaxIdsType = "sg_uen" + CheckoutSessionCustomerDetailsTaxIdsTypeTHVAT CheckoutSessionCustomerDetailsTaxIdsType = "th_vat" + CheckoutSessionCustomerDetailsTaxIdsTypeTWVAT CheckoutSessionCustomerDetailsTaxIdsType = "tw_vat" + CheckoutSessionCustomerDetailsTaxIdsTypeUnknown CheckoutSessionCustomerDetailsTaxIdsType = "unknown" + CheckoutSessionCustomerDetailsTaxIdsTypeUSEIN CheckoutSessionCustomerDetailsTaxIdsType = "us_ein" + CheckoutSessionCustomerDetailsTaxIdsTypeZAVAT CheckoutSessionCustomerDetailsTaxIdsType = "za_vat" +) + +// CheckoutSessionCustomerDetailsTaxExempt is the list of allowed values for +// tax_exempt inside customer_details of a checkout session. +type CheckoutSessionCustomerDetailsTaxExempt string + +// List of values that CheckoutSessionCustomerDetailsTaxExempt can take. +const ( + CheckoutSessionCustomerDetailsTaxExemptExempt CheckoutSessionCustomerDetailsTaxExempt = "exempt" + CheckoutSessionCustomerDetailsTaxExemptNone CheckoutSessionCustomerDetailsTaxExempt = "none" + CheckoutSessionCustomerDetailsTaxExemptReverse CheckoutSessionCustomerDetailsTaxExempt = "reverse" +) + // CheckoutSessionMode is the list of allowed values for the mode on a Session. type CheckoutSessionMode string @@ -75,15 +127,16 @@ type CheckoutSessionDiscountParams struct { // CheckoutSessionLineItemParams is the set of parameters allowed for a line item // on a checkout session. type CheckoutSessionLineItemParams struct { - Amount *int64 `form:"amount"` - Currency *string `form:"currency"` - Description *string `form:"description"` - 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"` + 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"` } // CheckoutSessionPaymentIntentDataTransferDataParams is the set of parameters allowed for the @@ -187,6 +240,21 @@ type CheckoutSessionListParams struct { Subscription *string `form:"subscription"` } +// CheckoutSessionCustomerDetailsTaxIds represent customer's tax IDs at the +// time of checkout. +type CheckoutSessionCustomerDetailsTaxIds struct { + Type CheckoutSessionCustomerDetailsTaxIdsType `json:"type"` + Value string `json:"value"` +} + +// CheckoutSessionCustomerDetails represent the customer details including +// the tax exempt status and the customer's tax IDs. +type CheckoutSessionCustomerDetails struct { + Email string `json:"email"` + TaxExempt CheckoutSessionCustomerDetailsTaxExempt `json:"tax_exempt"` + TaxIds *[]CheckoutSessionCustomerDetailsTaxIds `json:"tax_ids"` +} + // CheckoutSessionShippingAddressCollection is the set of parameters allowed for the // shipping address collection. type CheckoutSessionShippingAddressCollection struct { @@ -224,6 +292,7 @@ type CheckoutSession struct { APIResource AllowPromotionCodes bool `json:"allow_promotion_codes"` CancelURL string `json:"cancel_url"` + CustomerDetails *CheckoutSessionCustomerDetails `json:"customer_details"` AmountSubtotal int64 `json:"amount_subtotal"` AmountTotal int64 `json:"amount_total"` ClientReferenceID string `json:"client_reference_id"` From c351596accd318000c7830ec06bf147b987c67ac Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 14 Jan 2021 18:45:46 -0500 Subject: [PATCH 2/6] add Issuing.Transaction#List.type --- issuing_transaction.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/issuing_transaction.go b/issuing_transaction.go index 3af2603728..f081dcc8dd 100644 --- a/issuing_transaction.go +++ b/issuing_transaction.go @@ -32,6 +32,16 @@ const ( IssuingTransactionPurchaseDetailsFuelUnitUSGallon IssuingTransactionPurchaseDetailsFuelUnit = "us_gallon" ) +// IssuingTransactionListType is the possible values for type when +// listing issuing transactions. +type IssuingTransactionListType string + +// List of values that IssuingTransactionListType can take. +const ( + IssuingTransactionListTypeCapture IssuingTransactionListType = "capture" + IssuingTransactionListTypeRefund IssuingTransactionListType = "refund" +) + // IssuingTransactionParams is the set of parameters that can be used when creating or updating an issuing transaction. type IssuingTransactionParams struct { Params `form:"*"` @@ -40,10 +50,11 @@ type IssuingTransactionParams struct { // 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"` + Card *string `form:"card"` + Cardholder *string `form:"cardholder"` + Created *int64 `form:"created"` + CreatedRange *RangeQueryParams `form:"created"` + Type *IssuingTransactionListType `form:"type"` } // IssuingTransactionAmountDetails is the resource representing the breakdown of the amount. From c88f8f3f3ca870c99b65405401f5b437228a8ae2 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 14 Jan 2021 18:46:49 -0500 Subject: [PATCH 3/6] add country and state to TaxRate --- taxrate.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/taxrate.go b/taxrate.go index 0048170b2e..089a7536d6 100644 --- a/taxrate.go +++ b/taxrate.go @@ -7,11 +7,13 @@ import "encoding/json" 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"` } // TaxRateListParams is the set of parameters that can be used when listing tax rates. @@ -29,6 +31,7 @@ type TaxRateListParams struct { type TaxRate struct { APIResource Active bool `json:"active"` + Country string `json:"country"` Created int64 `json:"created"` Description string `json:"description"` DisplayName string `json:"display_name"` @@ -39,6 +42,7 @@ type TaxRate struct { Metadata map[string]string `json:"metadata"` Object string `json:"object"` Percentage float64 `json:"percentage"` + State string `json:"state"` } // TaxRateList is a list of tax rates as retrieved from a list endpoint. From f072ad38464bf52d4e006dc0fe2bc0e91e01b11d Mon Sep 17 00:00:00 2001 From: richardm-stripe <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 14 Jan 2021 19:07:19 -0500 Subject: [PATCH 4/6] Not a pointer --- checkout_session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkout_session.go b/checkout_session.go index 0133645005..fa4cd281b9 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -252,7 +252,7 @@ type CheckoutSessionCustomerDetailsTaxIds struct { type CheckoutSessionCustomerDetails struct { Email string `json:"email"` TaxExempt CheckoutSessionCustomerDetailsTaxExempt `json:"tax_exempt"` - TaxIds *[]CheckoutSessionCustomerDetailsTaxIds `json:"tax_ids"` + TaxIds []CheckoutSessionCustomerDetailsTaxIds `json:"tax_ids"` } // CheckoutSessionShippingAddressCollection is the set of parameters allowed for the From 0512556892205a30363ff61ee76fac034861b311 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 14 Jan 2021 19:08:52 -0500 Subject: [PATCH 5/6] Fix TaxID case --- checkout_session.go | 80 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/checkout_session.go b/checkout_session.go index fa4cd281b9..bbb557616f 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -4,45 +4,45 @@ import ( "encoding/json" ) -// CheckoutSessionCustomerDetailsTaxIdsType is the list of allowed values for type +// CheckoutSessionCustomerDetailsTaxIDsType is the list of allowed values for type // on the tax_ids inside customer_details of a checkout session. -type CheckoutSessionCustomerDetailsTaxIdsType string +type CheckoutSessionCustomerDetailsTaxIDsType string -// List of values that CheckoutSessionCustomerDetailsTaxIdsType can take. +// List of values that CheckoutSessionCustomerDetailsTaxIDsType can take. const ( - CheckoutSessionCustomerDetailsTaxIdsTypeAETRN CheckoutSessionCustomerDetailsTaxIdsType = "ae_trn" - CheckoutSessionCustomerDetailsTaxIdsTypeAUABN CheckoutSessionCustomerDetailsTaxIdsType = "au_abn" - CheckoutSessionCustomerDetailsTaxIdsTypeBRCNPJ CheckoutSessionCustomerDetailsTaxIdsType = "br_cnpj" - CheckoutSessionCustomerDetailsTaxIdsTypeBRCPF CheckoutSessionCustomerDetailsTaxIdsType = "br_cpf" - CheckoutSessionCustomerDetailsTaxIdsTypeCABN CheckoutSessionCustomerDetailsTaxIdsType = "ca_bn" - CheckoutSessionCustomerDetailsTaxIdsTypeCAQST CheckoutSessionCustomerDetailsTaxIdsType = "ca_qst" - CheckoutSessionCustomerDetailsTaxIdsTypeCHVAT CheckoutSessionCustomerDetailsTaxIdsType = "ch_vat" - CheckoutSessionCustomerDetailsTaxIdsTypeCLTIN CheckoutSessionCustomerDetailsTaxIdsType = "cl_tin" - CheckoutSessionCustomerDetailsTaxIdsTypeESCIF CheckoutSessionCustomerDetailsTaxIdsType = "es_cif" - CheckoutSessionCustomerDetailsTaxIdsTypeEUVAT CheckoutSessionCustomerDetailsTaxIdsType = "eu_vat" - CheckoutSessionCustomerDetailsTaxIdsTypeHKBR CheckoutSessionCustomerDetailsTaxIdsType = "hk_br" - CheckoutSessionCustomerDetailsTaxIdsTypeIDNPWP CheckoutSessionCustomerDetailsTaxIdsType = "id_npwp" - CheckoutSessionCustomerDetailsTaxIdsTypeINGST CheckoutSessionCustomerDetailsTaxIdsType = "in_gst" - CheckoutSessionCustomerDetailsTaxIdsTypeJPCN CheckoutSessionCustomerDetailsTaxIdsType = "jp_cn" - CheckoutSessionCustomerDetailsTaxIdsTypeJPRN CheckoutSessionCustomerDetailsTaxIdsType = "jp_rn" - CheckoutSessionCustomerDetailsTaxIdsTypeKRBRN CheckoutSessionCustomerDetailsTaxIdsType = "kr_brn" - CheckoutSessionCustomerDetailsTaxIdsTypeLIUID CheckoutSessionCustomerDetailsTaxIdsType = "li_uid" - CheckoutSessionCustomerDetailsTaxIdsTypeMXRFC CheckoutSessionCustomerDetailsTaxIdsType = "mx_rfc" - CheckoutSessionCustomerDetailsTaxIdsTypeMYFRP CheckoutSessionCustomerDetailsTaxIdsType = "my_frp" - CheckoutSessionCustomerDetailsTaxIdsTypeMYITN CheckoutSessionCustomerDetailsTaxIdsType = "my_itn" - CheckoutSessionCustomerDetailsTaxIdsTypeMYSST CheckoutSessionCustomerDetailsTaxIdsType = "my_sst" - CheckoutSessionCustomerDetailsTaxIdsTypeNOVAT CheckoutSessionCustomerDetailsTaxIdsType = "no_vat" - CheckoutSessionCustomerDetailsTaxIdsTypeNZGST CheckoutSessionCustomerDetailsTaxIdsType = "nz_gst" - CheckoutSessionCustomerDetailsTaxIdsTypeRUINN CheckoutSessionCustomerDetailsTaxIdsType = "ru_inn" - CheckoutSessionCustomerDetailsTaxIdsTypeRUKPP CheckoutSessionCustomerDetailsTaxIdsType = "ru_kpp" - CheckoutSessionCustomerDetailsTaxIdsTypeSAVAT CheckoutSessionCustomerDetailsTaxIdsType = "sa_vat" - CheckoutSessionCustomerDetailsTaxIdsTypeSGGST CheckoutSessionCustomerDetailsTaxIdsType = "sg_gst" - CheckoutSessionCustomerDetailsTaxIdsTypeSGUEN CheckoutSessionCustomerDetailsTaxIdsType = "sg_uen" - CheckoutSessionCustomerDetailsTaxIdsTypeTHVAT CheckoutSessionCustomerDetailsTaxIdsType = "th_vat" - CheckoutSessionCustomerDetailsTaxIdsTypeTWVAT CheckoutSessionCustomerDetailsTaxIdsType = "tw_vat" - CheckoutSessionCustomerDetailsTaxIdsTypeUnknown CheckoutSessionCustomerDetailsTaxIdsType = "unknown" - CheckoutSessionCustomerDetailsTaxIdsTypeUSEIN CheckoutSessionCustomerDetailsTaxIdsType = "us_ein" - CheckoutSessionCustomerDetailsTaxIdsTypeZAVAT CheckoutSessionCustomerDetailsTaxIdsType = "za_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeAETRN CheckoutSessionCustomerDetailsTaxIDsType = "ae_trn" + CheckoutSessionCustomerDetailsTaxIDsTypeAUABN CheckoutSessionCustomerDetailsTaxIDsType = "au_abn" + CheckoutSessionCustomerDetailsTaxIDsTypeBRCNPJ CheckoutSessionCustomerDetailsTaxIDsType = "br_cnpj" + CheckoutSessionCustomerDetailsTaxIDsTypeBRCPF CheckoutSessionCustomerDetailsTaxIDsType = "br_cpf" + CheckoutSessionCustomerDetailsTaxIDsTypeCABN CheckoutSessionCustomerDetailsTaxIDsType = "ca_bn" + CheckoutSessionCustomerDetailsTaxIDsTypeCAQST CheckoutSessionCustomerDetailsTaxIDsType = "ca_qst" + CheckoutSessionCustomerDetailsTaxIDsTypeCHVAT CheckoutSessionCustomerDetailsTaxIDsType = "ch_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeCLTIN CheckoutSessionCustomerDetailsTaxIDsType = "cl_tin" + CheckoutSessionCustomerDetailsTaxIDsTypeESCIF CheckoutSessionCustomerDetailsTaxIDsType = "es_cif" + CheckoutSessionCustomerDetailsTaxIDsTypeEUVAT CheckoutSessionCustomerDetailsTaxIDsType = "eu_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeHKBR CheckoutSessionCustomerDetailsTaxIDsType = "hk_br" + CheckoutSessionCustomerDetailsTaxIDsTypeIDNPWP CheckoutSessionCustomerDetailsTaxIDsType = "id_npwp" + CheckoutSessionCustomerDetailsTaxIDsTypeINGST CheckoutSessionCustomerDetailsTaxIDsType = "in_gst" + CheckoutSessionCustomerDetailsTaxIDsTypeJPCN CheckoutSessionCustomerDetailsTaxIDsType = "jp_cn" + CheckoutSessionCustomerDetailsTaxIDsTypeJPRN CheckoutSessionCustomerDetailsTaxIDsType = "jp_rn" + CheckoutSessionCustomerDetailsTaxIDsTypeKRBRN CheckoutSessionCustomerDetailsTaxIDsType = "kr_brn" + CheckoutSessionCustomerDetailsTaxIDsTypeLIUID CheckoutSessionCustomerDetailsTaxIDsType = "li_uid" + CheckoutSessionCustomerDetailsTaxIDsTypeMXRFC CheckoutSessionCustomerDetailsTaxIDsType = "mx_rfc" + CheckoutSessionCustomerDetailsTaxIDsTypeMYFRP CheckoutSessionCustomerDetailsTaxIDsType = "my_frp" + CheckoutSessionCustomerDetailsTaxIDsTypeMYITN CheckoutSessionCustomerDetailsTaxIDsType = "my_itn" + CheckoutSessionCustomerDetailsTaxIDsTypeMYSST CheckoutSessionCustomerDetailsTaxIDsType = "my_sst" + CheckoutSessionCustomerDetailsTaxIDsTypeNOVAT CheckoutSessionCustomerDetailsTaxIDsType = "no_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeNZGST CheckoutSessionCustomerDetailsTaxIDsType = "nz_gst" + CheckoutSessionCustomerDetailsTaxIDsTypeRUINN CheckoutSessionCustomerDetailsTaxIDsType = "ru_inn" + CheckoutSessionCustomerDetailsTaxIDsTypeRUKPP CheckoutSessionCustomerDetailsTaxIDsType = "ru_kpp" + CheckoutSessionCustomerDetailsTaxIDsTypeSAVAT CheckoutSessionCustomerDetailsTaxIDsType = "sa_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeSGGST CheckoutSessionCustomerDetailsTaxIDsType = "sg_gst" + CheckoutSessionCustomerDetailsTaxIDsTypeSGUEN CheckoutSessionCustomerDetailsTaxIDsType = "sg_uen" + CheckoutSessionCustomerDetailsTaxIDsTypeTHVAT CheckoutSessionCustomerDetailsTaxIDsType = "th_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeTWVAT CheckoutSessionCustomerDetailsTaxIDsType = "tw_vat" + CheckoutSessionCustomerDetailsTaxIDsTypeUnknown CheckoutSessionCustomerDetailsTaxIDsType = "unknown" + CheckoutSessionCustomerDetailsTaxIDsTypeUSEIN CheckoutSessionCustomerDetailsTaxIDsType = "us_ein" + CheckoutSessionCustomerDetailsTaxIDsTypeZAVAT CheckoutSessionCustomerDetailsTaxIDsType = "za_vat" ) // CheckoutSessionCustomerDetailsTaxExempt is the list of allowed values for @@ -240,10 +240,10 @@ type CheckoutSessionListParams struct { Subscription *string `form:"subscription"` } -// CheckoutSessionCustomerDetailsTaxIds represent customer's tax IDs at the +// CheckoutSessionCustomerDetailsTaxIDs represent customer's tax IDs at the // time of checkout. -type CheckoutSessionCustomerDetailsTaxIds struct { - Type CheckoutSessionCustomerDetailsTaxIdsType `json:"type"` +type CheckoutSessionCustomerDetailsTaxIDs struct { + Type CheckoutSessionCustomerDetailsTaxIDsType `json:"type"` Value string `json:"value"` } @@ -252,7 +252,7 @@ type CheckoutSessionCustomerDetailsTaxIds struct { type CheckoutSessionCustomerDetails struct { Email string `json:"email"` TaxExempt CheckoutSessionCustomerDetailsTaxExempt `json:"tax_exempt"` - TaxIds []CheckoutSessionCustomerDetailsTaxIds `json:"tax_ids"` + TaxIDs []CheckoutSessionCustomerDetailsTaxIDs `json:"tax_ids"` } // CheckoutSessionShippingAddressCollection is the set of parameters allowed for the From 7081c7944754bd5c136ab2ad944335db8c40a8c4 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 14 Jan 2021 19:56:27 -0500 Subject: [PATCH 6/6] fixups --- checkout_session.go | 2 +- issuing_transaction.go | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/checkout_session.go b/checkout_session.go index bbb557616f..07dd839752 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -252,7 +252,7 @@ type CheckoutSessionCustomerDetailsTaxIDs struct { type CheckoutSessionCustomerDetails struct { Email string `json:"email"` TaxExempt CheckoutSessionCustomerDetailsTaxExempt `json:"tax_exempt"` - TaxIDs []CheckoutSessionCustomerDetailsTaxIDs `json:"tax_ids"` + TaxIDs []*CheckoutSessionCustomerDetailsTaxIDs `json:"tax_ids"` } // CheckoutSessionShippingAddressCollection is the set of parameters allowed for the diff --git a/issuing_transaction.go b/issuing_transaction.go index f081dcc8dd..00395a2e81 100644 --- a/issuing_transaction.go +++ b/issuing_transaction.go @@ -32,16 +32,6 @@ const ( IssuingTransactionPurchaseDetailsFuelUnitUSGallon IssuingTransactionPurchaseDetailsFuelUnit = "us_gallon" ) -// IssuingTransactionListType is the possible values for type when -// listing issuing transactions. -type IssuingTransactionListType string - -// List of values that IssuingTransactionListType can take. -const ( - IssuingTransactionListTypeCapture IssuingTransactionListType = "capture" - IssuingTransactionListTypeRefund IssuingTransactionListType = "refund" -) - // IssuingTransactionParams is the set of parameters that can be used when creating or updating an issuing transaction. type IssuingTransactionParams struct { Params `form:"*"` @@ -50,11 +40,11 @@ type IssuingTransactionParams struct { // 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 *IssuingTransactionListType `form:"type"` + Card *string `form:"card"` + Cardholder *string `form:"cardholder"` + Created *int64 `form:"created"` + CreatedRange *RangeQueryParams `form:"created"` + Type *string `form:"type"` } // IssuingTransactionAmountDetails is the resource representing the breakdown of the amount.