Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates for beta branch #1610

Merged
merged 12 commits into from
Feb 24, 2023
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 74.9.0 - 2023-02-23
* [#1609](https://github.com/stripe/stripe-go/pull/1609) API Updates
* Add support for new value `yoursafe` on enums `ChargePaymentMethodDetailsIdealBank`, `PaymentMethodIdealBank`, and `SetupAttemptPaymentMethodDetailsIdealBank`
* Add support for new value `BITSNL2A` on enums `ChargePaymentMethodDetailsIdealBic`, `PaymentMethodIdealBic`, and `SetupAttemptPaymentMethodDetailsIdealBic`
* Add support for new value `igst` on enum `TaxRateTaxType`

## 74.9.0-beta.1 - 2023-02-16
* [#1608](https://github.com/stripe/stripe-go/pull/1608) API Updates for beta branch
* Updated stable APIs to the latest version
Expand All @@ -11,6 +17,19 @@
* Remove support for `Reference` on `TaxCalculationParams` and `TaxCalculation`
* Add support for `Reference` on `TaxTransactionParams`

## 74.8.0 - 2023-02-16
* [#1605](https://github.com/stripe/stripe-go/pull/1605) API Updates
* Add support for `RefundPayment` method on resource `Terminal.Reader`
* Add support for new value `name` on enum `BillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates`
* Add support for `CustomFields` on `CheckoutSessionParams`, `CheckoutSession`, `PaymentLinkParams`, and `PaymentLink`
* Add support for `InteracPresent` on `TestHelpersTerminalReaderPresentPaymentMethodParams`
* Change type of `TestHelpersTerminalReaderPresentPaymentMethodTypeParams` from `literal('card_present')` to `enum('card_present'|'interac_present')`
* Add support for `RefundPayment` on `TerminalReaderAction`
* Add support for new value `refund_payment` on enum `TerminalReaderActionType`
* [#1607](https://github.com/stripe/stripe-go/pull/1607) fix: deterministic encoding
* [#1603](https://github.com/stripe/stripe-go/pull/1603) Add an example of client mocking
* [#1604](https://github.com/stripe/stripe-go/pull/1604) Run lint on go 1.19

## 74.8.0-beta.1 - 2023-02-02
* [#1601](https://github.com/stripe/stripe-go/pull/1601) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v226
v232
2 changes: 1 addition & 1 deletion charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ type ChargePaymentMethodDetailsGrabpay struct {
TransactionID string `json:"transaction_id"`
}
type ChargePaymentMethodDetailsIDEAL struct {
// The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.
// The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
Bank string `json:"bank"`
// The Bank Identifier Code of the customer's bank.
BIC string `json:"bic"`
Expand Down
14 changes: 14 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,15 @@ const (
CheckoutSessionPaymentMethodOptionsSofortSetupFutureUsageNone CheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage = "none"
)

// Settings for configuring manual entry of account details.
type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode string

// List of values that CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode can take
const (
CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryModeAutomatic CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode = "automatic"
CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryModeCustom CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode = "custom"
)

// The list of permissions to request. The `payment_method` permission must be included.
type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission string

Expand Down Expand Up @@ -1996,7 +2005,12 @@ type CheckoutSessionPaymentMethodOptionsSofort struct {
// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
SetupFutureUsage CheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage `json:"setup_future_usage"`
}
type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntry struct {
// Settings for configuring manual entry of account details.
Mode CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode `json:"mode"`
}
type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnections struct {
ManualEntry *CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntry `json:"manual_entry"`
// The list of permissions to request. The `payment_method` permission must be included.
Permissions []CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"`
// Data features requested to be retrieved upon account creation.
Expand Down
7 changes: 7 additions & 0 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,13 @@ func TestInvoiceRetrieve(t *testing.T) {
assert.NotNil(t, result)
}

func TestInvoiceRetrieve2(t *testing.T) {
params := &stripe.InvoiceParams{}
params.AddExpand("customer")
result, _ := invoice.Get("in_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestInvoiceUpdate(t *testing.T) {
params := &stripe.InvoiceParams{}
params.AddMetadata("order_id", "6735")
Expand Down
8 changes: 4 additions & 4 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,9 @@ type InvoiceUpcomingDiscountDiscountEndDurationParams struct {

// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
type InvoiceUpcomingInvoiceItemPeriodParams struct {
// The end of the period, which must be greater than or equal to the start.
// The end of the period, which must be greater than or equal to the start. This value is inclusive.
End *int64 `form:"end"`
// The start of the period.
// The start of the period. This value is inclusive.
Start *int64 `form:"start"`
}

Expand Down Expand Up @@ -808,9 +808,9 @@ type InvoiceUpcomingLinesInvoiceItemDiscountParams struct {

// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
type InvoiceUpcomingLinesInvoiceItemPeriodParams struct {
// The end of the period, which must be greater than or equal to the start.
// The end of the period, which must be greater than or equal to the start. This value is inclusive.
End *int64 `form:"end"`
// The start of the period.
// The start of the period. This value is inclusive.
Start *int64 `form:"start"`
}

Expand Down
4 changes: 2 additions & 2 deletions invoiceitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ type InvoiceItemDiscountParams struct {

// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
type InvoiceItemPeriodParams struct {
// The end of the period, which must be greater than or equal to the start.
// The end of the period, which must be greater than or equal to the start. This value is inclusive.
End *int64 `form:"end"`
// The start of the period.
// The start of the period. This value is inclusive.
Start *int64 `form:"start"`
}

Expand Down
6 changes: 3 additions & 3 deletions issuing_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const (
IssuingCardSpendingControlsSpendingLimitIntervalYearly IssuingCardSpendingControlsSpendingLimitInterval = "yearly"
)

// Whether authorizations can be approved on this card.
// Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`.
type IssuingCardStatus string

// List of values that IssuingCardStatus can take
Expand Down Expand Up @@ -207,7 +207,7 @@ type IssuingCardParams struct {
Shipping *IssuingCardShippingParams `form:"shipping"`
// Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details.
SpendingControls *IssuingCardSpendingControlsParams `form:"spending_controls"`
// Dictates whether authorizations can be approved on this card. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`.
// Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`.
Status *string `form:"status"`
// The type of card to issue. Possible values are `physical` or `virtual`.
Type *string `form:"type"`
Expand Down Expand Up @@ -339,7 +339,7 @@ type IssuingCard struct {
// Where and how the card will be shipped.
Shipping *IssuingCardShipping `json:"shipping"`
SpendingControls *IssuingCardSpendingControls `json:"spending_controls"`
// Whether authorizations can be approved on this card.
// Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`.
Status IssuingCardStatus `json:"status"`
// The type of the card.
Type IssuingCardType `json:"type"`
Expand Down
17 changes: 10 additions & 7 deletions issuing_cardholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ type IssuingCardholderIndividualVerificationParams struct {
type IssuingCardholderIndividualParams struct {
// The date of birth of this cardholder.
DOB *IssuingCardholderIndividualDOBParams `form:"dob"`
// The first name of this cardholder. This field cannot contain any special characters or numbers.
// The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters.
FirstName *string `form:"first_name"`
// The last name of this cardholder. This field cannot contain any special characters or numbers.
// The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters.
LastName *string `form:"last_name"`
// Government-issued ID document for this cardholder.
Verification *IssuingCardholderIndividualVerificationParams `form:"verification"`
Expand Down Expand Up @@ -157,7 +157,7 @@ type IssuingCardholderParams struct {
SpendingControls *IssuingCardholderSpendingControlsParams `form:"spending_controls"`
// Specifies whether to permit authorizations on this cardholder's cards.
Status *string `form:"status"`
// One of `individual` or `company`.
// One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details.
Type *string `form:"type"`
}
type IssuingCardholderBilling struct {
Expand All @@ -172,13 +172,15 @@ type IssuingCardholderCompany struct {

// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
type IssuingCardholderIndividualCardIssuingUserTermsAcceptance struct {
// The Unix timestamp marking when the cardholder accepted the Authorized User Terms.
// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users.
Date int64 `json:"date"`
// The IP address from which the cardholder accepted the Authorized User Terms.
// The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users.
IP string `json:"ip"`
// The user agent of the browser from which the cardholder accepted the Authorized User Terms.
UserAgent string `json:"user_agent"`
}

// Information related to the card_issuing program for this cardholder.
type IssuingCardholderIndividualCardIssuing struct {
// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
UserTermsAcceptance *IssuingCardholderIndividualCardIssuingUserTermsAcceptance `json:"user_terms_acceptance"`
Expand Down Expand Up @@ -210,12 +212,13 @@ type IssuingCardholderIndividualVerification struct {

// Additional information about an `individual` cardholder.
type IssuingCardholderIndividual struct {
// Information related to the card_issuing program for this cardholder.
CardIssuing *IssuingCardholderIndividualCardIssuing `json:"card_issuing"`
// The date of birth of this cardholder.
DOB *IssuingCardholderIndividualDOB `json:"dob"`
// The first name of this cardholder. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters.
// The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters.
FirstName string `json:"first_name"`
// The last name of this cardholder. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters.
// The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters.
LastName string `json:"last_name"`
// Government-issued ID document for this cardholder.
Verification *IssuingCardholderIndividualVerification `json:"verification"`
Expand Down
22 changes: 22 additions & 0 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,15 @@ const (
PaymentIntentPaymentMethodOptionsSofortSetupFutureUsageOffSession PaymentIntentPaymentMethodOptionsSofortSetupFutureUsage = "off_session"
)

// Settings for configuring manual entry of account details.
type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode string

// List of values that PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode can take
const (
PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryModeAutomatic PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode = "automatic"
PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryModeCustom PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode = "custom"
)

// The list of permissions to request. The `payment_method` permission must be included.
type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission string

Expand Down Expand Up @@ -1427,8 +1436,16 @@ type PaymentIntentPaymentMethodOptionsSofortParams struct {
SetupFutureUsage *string `form:"setup_future_usage"`
}

// Customize manual entry behavior
type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryParams struct {
// Settings for configuring manual entry of account details.
Mode *string `form:"mode"`
}

// Additional fields for Financial Connections Session creation
type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct {
// Customize manual entry behavior
ManualEntry *PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryParams `form:"manual_entry"`
// The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
Permissions []*string `form:"permissions"`
// List of data features that you would like to retrieve upon account creation.
Expand Down Expand Up @@ -2480,7 +2497,12 @@ type PaymentIntentPaymentMethodOptionsSofort struct {
// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
SetupFutureUsage PaymentIntentPaymentMethodOptionsSofortSetupFutureUsage `json:"setup_future_usage"`
}
type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntry struct {
// Settings for configuring manual entry of account details.
Mode PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntryMode `json:"mode"`
}
type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnections struct {
ManualEntry *PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsManualEntry `json:"manual_entry"`
// The list of permissions to request. The `payment_method` permission must be included.
Permissions []PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"`
// Data features requested to be retrieved upon account creation.
Expand Down
2 changes: 1 addition & 1 deletion paymentmethod.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ type PaymentMethodFPX struct {
type PaymentMethodGiropay struct{}
type PaymentMethodGrabpay struct{}
type PaymentMethodIDEAL struct {
// The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.
// The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
Bank string `json:"bank"`
// The Bank Identifier Code of the customer's bank, if the bank was provided.
BIC string `json:"bic"`
Expand Down
2 changes: 1 addition & 1 deletion setupattempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type SetupAttemptPaymentMethodDetailsCardPresent struct {
GeneratedCard *PaymentMethod `json:"generated_card"`
}
type SetupAttemptPaymentMethodDetailsIDEAL struct {
// The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.
// The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
Bank string `json:"bank"`
// The Bank Identifier Code of the customer's bank.
BIC string `json:"bic"`
Expand Down
Loading