Skip to content

Commit

Permalink
Merge branch 'master' into sdk-release/next-major
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe committed Jul 18, 2022
2 parents 310319f + cea6514 commit a7b19af
Show file tree
Hide file tree
Showing 25 changed files with 1,903 additions and 1,425 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ on:
branches:
- master
- beta
- sdk-release/**
- feature/**
pull_request:
branches:
- master
- beta
- sdk-release/**
- feature/**

jobs:
lint:
Expand Down
45 changes: 34 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
# Changelog

## 72.119.0 - 2022-07-12
* [#1494](https://github.com/stripe/stripe-go/pull/1494) API Updates
* Add support for `CustomerDetails` on `CheckoutSessionListParams`

## 72.118.0 - 2022-07-07
* [#1492](https://github.com/stripe/stripe-go/pull/1492) API Updates
* Add support for `Currency` on `CheckoutSessionParams`, `InvoiceUpcomingLinesParams`, `InvoiceUpcomingParams`, `PaymentLinkParams`, `SubscriptionParams`, `SubscriptionSchedulePhasesParams`, `SubscriptionSchedulePhases`, and `Subscription`
* Add support for `CurrencyOptions` on `CheckoutSessionShippingOptionsShippingRateDataFixedAmountParams`, `CouponParams`, `Coupon`, `OrderShippingCostShippingRateDataFixedAmountParams`, `PriceParams`, `Price`, `ProductDefaultPriceDataParams`, `PromotionCodeRestrictionsParams`, `PromotionCodeRestrictions`, `ShippingRateFixedAmountParams`, and `ShippingRateFixedAmount`
* Add support for `Restrictions` on `PromotionCodeParams`
* Add support for `FixedAmount` and `TaxBehavior` on `ShippingRateParams`
* [#1491](https://github.com/stripe/stripe-go/pull/1491) API Updates
* Add support for `Customer` on `CheckoutSessionListParams` and `RefundParams`
* Add support for `Currency` and `Origin` on `RefundParams`


## 72.117.0 - 2022-06-29
* [#1487](https://github.com/stripe/stripe-go/pull/1487) API Updates
* Add support for `DeliverCard`, `FailCard`, `ReturnCard`, and `ShipCard` test helper methods on resource `Issuing.Card`
* Change type of `PaymentLinkPaymentMethodTypesParams` and `PaymentLinkPaymentMethodTypes` from `literal('card')` to `enum`
* Add support for `HostedRegulatoryReceiptURL` on `TreasuryReceivedCredit` and `TreasuryReceivedDebit`

* [#1483](https://github.com/stripe/stripe-go/pull/1483) Document use of undocumented parameters/properties

## 72.116.0 - 2022-06-23
* [#1484](https://github.com/stripe/stripe-go/pull/1484) API Updates
* Add support for `CaptureMethod` on `PaymentIntentConfirmParams` and `PaymentIntentParams`
* [#1481](https://github.com/stripe/stripe-go/pull/1481) API Updates
* Add support for `PromptPayPayments` on `AccountCapabilitiesParams` and `AccountCapabilities`
* Add support for `PromptPay` on `ChargePaymentMethodDetails`, `PaymentIntentConfirmPaymentMethodDataParams`, `PaymentIntentConfirmPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodDataParams`, `PaymentIntentPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodOptions`, `PaymentMethodParams`, `PaymentMethod`, `SetupIntentConfirmPaymentMethodDataParams`, and `SetupIntentPaymentMethodDataParams`
* Add support for `SubtotalExcludingTax` on `CreditNote` and `Invoice`
* Add support for `AmountExcludingTax` and `UnitAmountExcludingTax` on `CreditNoteLineItem` and `InvoiceLineItem`
* Add support for `RenderingOptions` on `InvoiceParams`
* Add support for `TotalExcludingTax` on `Invoice`
* Add support for new value `promptpay` on enums `InvoicePaymentSettingsPaymentMethodTypes` and `SubscriptionPaymentSettingsPaymentMethodTypes`
* Add support for `AutomaticPaymentMethods` on `OrderPaymentSettings`
* Add support for `PromptPayDisplayQRCode` on `PaymentIntentNextAction`
* Add support for new value `promptpay` on enum `PaymentMethodType`

* Add support for `PromptPayPayments` on `AccountCapabilitiesParams` and `AccountCapabilities`
* Add support for `PromptPay` on `ChargePaymentMethodDetails`, `PaymentIntentConfirmPaymentMethodDataParams`, `PaymentIntentConfirmPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodDataParams`, `PaymentIntentPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodOptions`, `PaymentMethodParams`, `PaymentMethod`, `SetupIntentConfirmPaymentMethodDataParams`, and `SetupIntentPaymentMethodDataParams`
* Add support for `SubtotalExcludingTax` on `CreditNote` and `Invoice`
* Add support for `AmountExcludingTax` and `UnitAmountExcludingTax` on `CreditNoteLineItem` and `InvoiceLineItem`
* Add support for `RenderingOptions` on `InvoiceParams`
* Add support for `TotalExcludingTax` on `Invoice`
* Add support for new value `promptpay` on enums `InvoicePaymentSettingsPaymentMethodTypes` and `SubscriptionPaymentSettingsPaymentMethodTypes`
* Add support for `AutomaticPaymentMethods` on `OrderPaymentSettings`
* Add support for `PromptPayDisplayQRCode` on `PaymentIntentNextAction`
* Add support for new value `promptpay` on enum `PaymentMethodType`

* [#1482](https://github.com/stripe/stripe-go/pull/1482) Use the generated API version

## 72.115.0 - 2022-06-17
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v160
v164
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
72.116.0
72.119.0
16 changes: 6 additions & 10 deletions cashbalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ const (

// Retrieves a customer's cash balance.
type CashBalanceParams struct {
Params `form:"*"`
Params `form:"*"`
// A hash of settings for this cash balance.
Settings *CashBalanceSettingsParams `form:"settings"`
Customer *string `form:"-"` // Included in URL
}

// A hash of settings for this cash balance.
type CashBalanceSettingsParams struct {
// Method for using the customer balance to pay outstanding
// `customer_balance` PaymentIntents. If set to `automatic`, all available
// funds will automatically be used to pay any outstanding PaymentIntent.
// If set to `manual`, only customer balance funds from bank transfers
// with a reference code matching
// `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will
// automatically be used to pay the corresponding outstanding
// PaymentIntent.
// Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
ReconciliationMode *string `form:"reconciliation_mode"`
}
type CashBalanceSettings struct {
Expand All @@ -40,7 +36,7 @@ type CashBalanceSettings struct {
// A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.
type CashBalance struct {
APIResource
// A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0.
// A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
Available map[string]int64 `json:"available"`
// The ID of the customer whose cash balance this object represents.
Customer string `json:"customer"`
Expand Down
42 changes: 32 additions & 10 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const (
CheckoutSessionCustomerCreationIfRequired CheckoutSessionCustomerCreation = "if_required"
)

// The customer's tax exempt status at time of checkout.
// The customer's tax exempt status after a completed Checkout Session.
type CheckoutSessionCustomerDetailsTaxExempt string

// List of values that CheckoutSessionCustomerDetailsTaxExempt can take
Expand Down Expand Up @@ -501,9 +501,19 @@ const (
CheckoutSessionSubmitTypePay CheckoutSessionSubmitType = "pay"
)

// Only return the Checkout Sessions for the Customer details specified.
type CheckoutSessionListCustomerDetailsParams struct {
// Customer's email address.
Email *string `form:"email"`
}

// Returns a list of Checkout Sessions.
type CheckoutSessionListParams struct {
ListParams `form:"*"`
// Only return the Checkout Sessions for the Customer specified.
Customer *string `form:"customer"`
// Only return the Checkout Sessions for the Customer details specified.
CustomerDetails *CheckoutSessionListCustomerDetailsParams `form:"customer_details"`
// Only return the Checkout Session for the PaymentIntent specified.
PaymentIntent *string `form:"payment_intent"`
// Only return the Checkout Session for the subscription specified.
Expand Down Expand Up @@ -1088,12 +1098,22 @@ type CheckoutSessionShippingOptionShippingRateDataDeliveryEstimateParams struct
Minimum *CheckoutSessionShippingOptionShippingRateDataDeliveryEstimateMinimumParams `form:"minimum"`
}

// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
type CheckoutSessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsParams struct {
// A non-negative integer in cents representing how much to charge.
Amount *int64 `form:"amount"`
// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
TaxBehavior *string `form:"tax_behavior"`
}

// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
type CheckoutSessionShippingOptionShippingRateDataFixedAmountParams struct {
// A non-negative integer in cents representing how much to charge.
Amount *int64 `form:"amount"`
// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Currency *string `form:"currency"`
// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
CurrencyOptions map[string]*CheckoutSessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsParams `form:"currency_options"`
}

// Parameters to be passed to Shipping Rate creation for this shipping option
Expand Down Expand Up @@ -1198,6 +1218,8 @@ type CheckoutSessionParams struct {
ClientReferenceID *string `form:"client_reference_id"`
// Configure fields for the Checkout Session to gather active consent from customers.
ConsentCollection *CheckoutSessionConsentCollectionParams `form:"consent_collection"`
// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Currency *string `form:"currency"`
// ID of an existing Customer, if one exists. In `payment` mode, the customer's most recent card
// payment method will be used to prefill the email, name, card details, and billing address
// on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method)
Expand Down Expand Up @@ -1340,28 +1362,28 @@ type CheckoutSessionConsentCollection struct {
Promotions CheckoutSessionConsentCollectionPromotions `json:"promotions"`
}

// The customer's tax IDs at time of checkout.
// The customer's tax IDs after a completed Checkout Session.
type CheckoutSessionCustomerDetailsTaxIDs struct {
// The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown`
Type CheckoutSessionCustomerDetailsTaxIDsType `json:"type"`
// The value of the tax ID.
Value string `json:"value"`
}

// The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode.
// The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in `setup` mode.
type CheckoutSessionCustomerDetails struct {
// The customer's address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022.
// The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022.
Address *Address `json:"address"`
// The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry.
// The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry.
// Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form.
Email string `json:"email"`
// The customer's name at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022.
// The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022.
Name string `json:"name"`
// The customer's phone number at the time of checkout
// The customer's phone number after a completed Checkout Session.
Phone string `json:"phone"`
// The customer's tax exempt status at time of checkout.
// The customer's tax exempt status after a completed Checkout Session.
TaxExempt CheckoutSessionCustomerDetailsTaxExempt `json:"tax_exempt"`
// The customer's tax IDs at time of checkout.
// The customer's tax IDs after a completed Checkout Session.
TaxIDs []*CheckoutSessionCustomerDetailsTaxIDs `json:"tax_ids"`
}
type CheckoutSessionPaymentMethodOptionsACSSDebitMandateOptions struct {
Expand Down Expand Up @@ -1711,7 +1733,7 @@ type CheckoutSession struct {
Customer *Customer `json:"customer"`
// Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
CustomerCreation CheckoutSessionCustomerCreation `json:"customer_creation"`
// The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode.
// The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in `setup` mode.
CustomerDetails *CheckoutSessionCustomerDetails `json:"customer_details"`
// If provided, this value will be used when the Customer object is created.
// If not provided, customers will be asked to enter their email address.
Expand Down
4 changes: 4 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import (
terminallocation "github.com/stripe/stripe-go/v72/terminal/location"
terminalreader "github.com/stripe/stripe-go/v72/terminal/reader"
testhelperscustomer "github.com/stripe/stripe-go/v72/testhelpers/customer"
testhelpersissuingcard "github.com/stripe/stripe-go/v72/testhelpers/issuing/card"
testhelpersrefund "github.com/stripe/stripe-go/v72/testhelpers/refund"
testhelpersterminalreader "github.com/stripe/stripe-go/v72/testhelpers/terminal/reader"
testhelperstestclock "github.com/stripe/stripe-go/v72/testhelpers/testclock"
Expand Down Expand Up @@ -277,6 +278,8 @@ type API struct {
TerminalReaders *terminalreader.Client
// TestHelpersCustomers is the client used to invoke /customers APIs.
TestHelpersCustomers *testhelperscustomer.Client
// TestHelpersIssuingCards is the client used to invoke /issuing/cards APIs.
TestHelpersIssuingCards *testhelpersissuingcard.Client
// TestHelpersRefunds is the client used to invoke /refunds APIs.
TestHelpersRefunds *testhelpersrefund.Client
// TestHelpersTerminalReaders is the client used to invoke /terminal/readers APIs.
Expand Down Expand Up @@ -417,6 +420,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key}
a.TerminalReaders = &terminalreader.Client{B: backends.API, Key: key}
a.TestHelpersCustomers = &testhelperscustomer.Client{B: backends.API, Key: key}
a.TestHelpersIssuingCards = &testhelpersissuingcard.Client{B: backends.API, Key: key}
a.TestHelpersRefunds = &testhelpersrefund.Client{B: backends.API, Key: key}
a.TestHelpersTerminalReaders = &testhelpersterminalreader.Client{B: backends.API, Key: key}
a.TestHelpersTestClocks = &testhelperstestclock.Client{B: backends.API, Key: key}
Expand Down
Loading

0 comments on commit a7b19af

Please sign in to comment.