diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38c594702c..5419c123bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,10 @@ jobs: lint: name: Lint - runs-on: ubuntu-latest + runs-on: "ubuntu-24.04" steps: + - uses: extractions/setup-just@v2 - uses: actions/checkout@master - name: Setup go @@ -34,42 +35,33 @@ jobs: - name: lint run: | - go install honnef.co/go/tools/cmd/staticcheck@v0.4.7 && - go install golang.org/x/tools/cmd/goimports@v0.24.0 && - $HOME/go/bin/staticcheck && - make vet && - make check-gofmt + just lint format-check test: - runs-on: ubuntu-latest - strategy: - matrix: - go: - - "1.23" - - "1.22" - - "1.21" - - "1.20" - - "1.19" - - "1.18" - - "1.17" - - "1.16" - - "1.15" - name: "Test: go v${{ matrix.go }}" - steps: - - uses: actions/checkout@v2 - - name: Setup go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go }} - - uses: stripe/openapi/actions/stripe-mock@master - - name: Test - run: make ci-test - - name: Coveralls - run: make coverage && make coveralls - if: matrix.go == '1.16' - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: Go-${{ matrix.go }} + runs-on: "ubuntu-24.04" + strategy: + matrix: + go: + - "1.23" + - "1.22" + - "1.21" + - "1.20" + - "1.19" + - "1.18" + - "1.17" + - "1.16" + - "1.15" + name: "Test: go v${{ matrix.go }}" + steps: + - uses: extractions/setup-just@v2 + - uses: actions/checkout@v2 + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + - uses: stripe/openapi/actions/stripe-mock@master + - name: Test + run: just ci-test publish: name: Publish @@ -77,7 +69,7 @@ jobs: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && startsWith(github.ref, 'refs/tags/v') && endsWith(github.actor, '-stripe') - runs-on: ubuntu-latest + runs-on: "ubuntu-24.04" steps: - uses: actions/checkout@v2 - uses: stripe/openapi/actions/notify-release@master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..dae96696bd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ + +# Contributing + +We welcome bug reports, feature requests, and code contributions in a pull request. + +For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-go/issues/new/choose). + +## Contributor License Agreement + +All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant. + +## Generated code + +This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution. + +To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`. + +## Compatibility with supported language and runtime versions + +This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward. + +## Set up your dev environment + +Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment. + diff --git a/Makefile b/Makefile index f99cf995fd..1c3f0a3849 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands. + all: test bench vet lint check-api-clients check-gofmt ci-test bench: @@ -43,7 +45,7 @@ codegen-format: normalize-imports go install golang.org/x/tools/cmd/goimports@v0.24.0 && goimports -w example/generated_examples_test.go CURRENT_MAJOR_VERSION := $(shell cat VERSION | sed 's/\..*//') -normalize-imports: +normalize-imports: @perl -pi -e 's|github.com/stripe/stripe-go/v\d+|github.com/stripe/stripe-go/v$(CURRENT_MAJOR_VERSION)|' go.mod @find . -name '*.go' -exec perl -pi -e 's|github.com/stripe/stripe-go/(v\d+\|\[MAJOR_VERSION\])|github.com/stripe/stripe-go/v$(CURRENT_MAJOR_VERSION)|' {} + diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index fbfcb52824..4624c15fbd 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1435 \ No newline at end of file +v1454 \ No newline at end of file diff --git a/README.md b/README.md index 398d891e93..b574488204 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/stripe/stripe-go)](https://pkg.go.dev/github.com/stripe/stripe-go/v81) [![Build Status](https://github.com/stripe/stripe-go/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-go/actions/workflows/ci.yml?query=branch%3Amaster) -[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-go/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-go?branch=master) The official [Stripe][stripe] Go client library. @@ -628,6 +627,7 @@ func make_raw_request() error { } ``` + See more examples in the [/example/v2 folder](example/v2). ## Support @@ -641,19 +641,15 @@ the following guidelines in mind: 1. Code must be `go fmt` compliant. 2. All types, structs and funcs should be documented. -3. Ensure that `make test` succeeds. - -## Test +3. Ensure that `just test` succeeds. -The test suite needs testify's `require` package to run: +[Other contribution guidelines for this project](CONTRIBUTING.md) - github.com/stretchr/testify/require - -Before running the tests, make sure to grab all of the package's dependencies: +## Test - go get -t -v +We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`. -It also depends on [stripe-mock][stripe-mock], so make sure to fetch and run it from a +This package depends on [stripe-mock][stripe-mock], so make sure to fetch and run it from a background terminal ([stripe-mock's README][stripe-mock-usage] also contains instructions for installing via Homebrew and other methods): @@ -662,15 +658,24 @@ instructions for installing via Homebrew and other methods): Run all tests: - make test +```sh +just test +# or: go test ./... +``` Run tests for one package: - go test ./invoice +```sh +just test ./invoice +# or: go test ./invoice +``` Run a single test: - go test ./invoice -run TestInvoiceGet +```sh +just test ./invoice -run TestInvoiceGet +# or: go test ./invoice -run TestInvoiceGet +``` For any requests, bug or comments, please [open an issue][issues] or [submit a pull request][pulls]. diff --git a/account.go b/account.go index 755c27fb3c..4fb2ef3a2c 100644 --- a/account.go +++ b/account.go @@ -595,6 +595,12 @@ type AccountCapabilitiesP24PaymentsParams struct { Requested *bool `form:"requested"` } +// The pay_by_bank_payments capability. +type AccountCapabilitiesPayByBankPaymentsParams struct { + // Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + Requested *bool `form:"requested"` +} + // The payco_payments capability. type AccountCapabilitiesPaycoPaymentsParams struct { // Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. @@ -836,6 +842,8 @@ type AccountCapabilitiesParams struct { OXXOPayments *AccountCapabilitiesOXXOPaymentsParams `form:"oxxo_payments"` // The p24_payments capability. P24Payments *AccountCapabilitiesP24PaymentsParams `form:"p24_payments"` + // The pay_by_bank_payments capability. + PayByBankPayments *AccountCapabilitiesPayByBankPaymentsParams `form:"pay_by_bank_payments"` // The payco_payments capability. PaycoPayments *AccountCapabilitiesPaycoPaymentsParams `form:"payco_payments"` // The paynow_payments capability. @@ -924,6 +932,16 @@ type AccountCompanyAddressKanjiParams struct { Town *string `form:"town"` } +// This hash is used to attest that the directors information provided to Stripe is both current and correct. +type AccountCompanyDirectorshipDeclarationParams struct { + // The Unix timestamp marking when the directorship declaration attestation was made. + Date *int64 `form:"date"` + // The IP address from which the directorship declaration attestation was made. + IP *string `form:"ip"` + // The user agent of the browser from which the directorship declaration attestation was made. + UserAgent *string `form:"user_agent"` +} + // This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. type AccountCompanyOwnershipDeclarationParams struct { // The Unix timestamp marking when the beneficial owner attestation was made. @@ -956,6 +974,8 @@ type AccountCompanyParams struct { AddressKana *AccountCompanyAddressKanaParams `form:"address_kana"` // The Kanji variation of the company's primary address (Japan only). AddressKanji *AccountCompanyAddressKanjiParams `form:"address_kanji"` + // This hash is used to attest that the directors information provided to Stripe is both current and correct. + DirectorshipDeclaration *AccountCompanyDirectorshipDeclarationParams `form:"directorship_declaration"` // Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. DirectorsProvided *bool `form:"directors_provided"` // Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -1035,6 +1055,12 @@ type AccountDocumentsProofOfRegistrationParams struct { Files []*string `form:"files"` } +// One or more documents that demonstrate proof of ultimate beneficial ownership. +type AccountDocumentsProofOfUltimateBeneficialOwnershipParams struct { + // One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + Files []*string `form:"files"` +} + // Documents that may be submitted to satisfy various informational requests. type AccountDocumentsParams struct { // One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. @@ -1051,6 +1077,8 @@ type AccountDocumentsParams struct { CompanyTaxIDVerification *AccountDocumentsCompanyTaxIDVerificationParams `form:"company_tax_id_verification"` // One or more documents showing the company's proof of registration with the national business registry. ProofOfRegistration *AccountDocumentsProofOfRegistrationParams `form:"proof_of_registration"` + // One or more documents that demonstrate proof of ultimate beneficial ownership. + ProofOfUltimateBeneficialOwnership *AccountDocumentsProofOfUltimateBeneficialOwnershipParams `form:"proof_of_ultimate_beneficial_ownership"` } // AccountExternalAccountParams are the parameters allowed to reference an @@ -1496,6 +1524,8 @@ type AccountCapabilities struct { OXXOPayments AccountCapabilityStatus `json:"oxxo_payments"` // The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. P24Payments AccountCapabilityStatus `json:"p24_payments"` + // The status of the pay_by_bank payments capability of the account, or whether the account can directly process pay_by_bank charges. + PayByBankPayments AccountCapabilityStatus `json:"pay_by_bank_payments"` // The status of the Payco capability of the account, or whether the account can directly process Payco payments. PaycoPayments AccountCapabilityStatus `json:"payco_payments"` // The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. diff --git a/accountsession.go b/accountsession.go index c4718e22a9..1bc965406d 100644 --- a/accountsession.go +++ b/accountsession.go @@ -155,7 +155,7 @@ type AccountSessionComponentsFinancialAccountFeaturesParams struct { TransferBalance *bool `form:"transfer_balance"` } -// Configuration for the financial account component. +// Configuration for the financial account embedded component. type AccountSessionComponentsFinancialAccountParams struct { // Whether the embedded component is enabled. Enabled *bool `form:"enabled"` @@ -169,7 +169,7 @@ type AccountSessionComponentsFinancialAccountTransactionsFeaturesParams struct { CardSpendDisputeManagement *bool `form:"card_spend_dispute_management"` } -// Configuration for the financial account transactions component. +// Configuration for the financial account transactions embedded component. type AccountSessionComponentsFinancialAccountTransactionsParams struct { // Whether the embedded component is enabled. Enabled *bool `form:"enabled"` @@ -189,7 +189,7 @@ type AccountSessionComponentsIssuingCardFeaturesParams struct { SpendControlManagement *bool `form:"spend_control_management"` } -// Configuration for the issuing card component. +// Configuration for the issuing card embedded component. type AccountSessionComponentsIssuingCardParams struct { // Whether the embedded component is enabled. Enabled *bool `form:"enabled"` @@ -211,7 +211,7 @@ type AccountSessionComponentsIssuingCardsListFeaturesParams struct { SpendControlManagement *bool `form:"spend_control_management"` } -// Configuration for the issuing cards list component. +// Configuration for the issuing cards list embedded component. type AccountSessionComponentsIssuingCardsListParams struct { // Whether the embedded component is enabled. Enabled *bool `form:"enabled"` @@ -363,6 +363,17 @@ type AccountSessionComponentsTaxSettingsParams struct { Features *AccountSessionComponentsTaxSettingsFeaturesParams `form:"features"` } +// The list of features enabled in the embedded component. +type AccountSessionComponentsTaxThresholdMonitoringFeaturesParams struct{} + +// Configuration for the tax threshold monitoring embedded component. +type AccountSessionComponentsTaxThresholdMonitoringParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsTaxThresholdMonitoringFeaturesParams `form:"features"` +} + // Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). type AccountSessionComponentsParams struct { // Configuration for the account management embedded component. @@ -385,13 +396,13 @@ type AccountSessionComponentsParams struct { CapitalOverview *AccountSessionComponentsCapitalOverviewParams `form:"capital_overview"` // Configuration for the documents embedded component. Documents *AccountSessionComponentsDocumentsParams `form:"documents"` - // Configuration for the financial account component. + // Configuration for the financial account embedded component. FinancialAccount *AccountSessionComponentsFinancialAccountParams `form:"financial_account"` - // Configuration for the financial account transactions component. + // Configuration for the financial account transactions embedded component. FinancialAccountTransactions *AccountSessionComponentsFinancialAccountTransactionsParams `form:"financial_account_transactions"` - // Configuration for the issuing card component. + // Configuration for the issuing card embedded component. IssuingCard *AccountSessionComponentsIssuingCardParams `form:"issuing_card"` - // Configuration for the issuing cards list component. + // Configuration for the issuing cards list embedded component. IssuingCardsList *AccountSessionComponentsIssuingCardsListParams `form:"issuing_cards_list"` // Configuration for the notification banner embedded component. NotificationBanner *AccountSessionComponentsNotificationBannerParams `form:"notification_banner"` @@ -413,6 +424,8 @@ type AccountSessionComponentsParams struct { TaxRegistrations *AccountSessionComponentsTaxRegistrationsParams `form:"tax_registrations"` // Configuration for the tax settings embedded component. TaxSettings *AccountSessionComponentsTaxSettingsParams `form:"tax_settings"` + // Configuration for the tax threshold monitoring embedded component. + TaxThresholdMonitoring *AccountSessionComponentsTaxThresholdMonitoringParams `form:"tax_threshold_monitoring"` } // Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. @@ -494,6 +507,62 @@ type AccountSessionComponentsDocuments struct { Enabled bool `json:"enabled"` Features *AccountSessionComponentsDocumentsFeatures `json:"features"` } +type AccountSessionComponentsFinancialAccountFeatures struct { + // Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + DisableStripeUserAuthentication bool `json:"disable_stripe_user_authentication"` + // Whether to allow external accounts to be linked for money transfer. + ExternalAccountCollection bool `json:"external_account_collection"` + // Whether to allow sending money. + SendMoney bool `json:"send_money"` + // Whether to allow transferring balance. + TransferBalance bool `json:"transfer_balance"` +} +type AccountSessionComponentsFinancialAccount struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsFinancialAccountFeatures `json:"features"` +} +type AccountSessionComponentsFinancialAccountTransactionsFeatures struct { + // Whether to allow card spend dispute management features. + CardSpendDisputeManagement bool `json:"card_spend_dispute_management"` +} +type AccountSessionComponentsFinancialAccountTransactions struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsFinancialAccountTransactionsFeatures `json:"features"` +} +type AccountSessionComponentsIssuingCardFeatures struct { + // Whether to allow cardholder management features. + CardholderManagement bool `json:"cardholder_management"` + // Whether to allow card management features. + CardManagement bool `json:"card_management"` + // Whether to allow card spend dispute management features. + CardSpendDisputeManagement bool `json:"card_spend_dispute_management"` + // Whether to allow spend control management features. + SpendControlManagement bool `json:"spend_control_management"` +} +type AccountSessionComponentsIssuingCard struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsIssuingCardFeatures `json:"features"` +} +type AccountSessionComponentsIssuingCardsListFeatures struct { + // Whether to allow cardholder management features. + CardholderManagement bool `json:"cardholder_management"` + // Whether to allow card management features. + CardManagement bool `json:"card_management"` + // Whether to allow card spend dispute management features. + CardSpendDisputeManagement bool `json:"card_spend_dispute_management"` + // Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + DisableStripeUserAuthentication bool `json:"disable_stripe_user_authentication"` + // Whether to allow spend control management features. + SpendControlManagement bool `json:"spend_control_management"` +} +type AccountSessionComponentsIssuingCardsList struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsIssuingCardsListFeatures `json:"features"` +} type AccountSessionComponentsNotificationBannerFeatures struct { // Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. DisableStripeUserAuthentication bool `json:"disable_stripe_user_authentication"` @@ -571,20 +640,24 @@ type AccountSessionComponentsTaxSettings struct { Features *AccountSessionComponentsTaxSettingsFeatures `json:"features"` } type AccountSessionComponents struct { - AccountManagement *AccountSessionComponentsAccountManagement `json:"account_management"` - AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"` - Balances *AccountSessionComponentsBalances `json:"balances"` - CapitalFinancing *AccountSessionComponentsCapitalFinancing `json:"capital_financing"` - CapitalFinancingApplication *AccountSessionComponentsCapitalFinancingApplication `json:"capital_financing_application"` - CapitalFinancingPromotion *AccountSessionComponentsCapitalFinancingPromotion `json:"capital_financing_promotion"` - Documents *AccountSessionComponentsDocuments `json:"documents"` - NotificationBanner *AccountSessionComponentsNotificationBanner `json:"notification_banner"` - PaymentDetails *AccountSessionComponentsPaymentDetails `json:"payment_details"` - Payments *AccountSessionComponentsPayments `json:"payments"` - Payouts *AccountSessionComponentsPayouts `json:"payouts"` - PayoutsList *AccountSessionComponentsPayoutsList `json:"payouts_list"` - TaxRegistrations *AccountSessionComponentsTaxRegistrations `json:"tax_registrations"` - TaxSettings *AccountSessionComponentsTaxSettings `json:"tax_settings"` + AccountManagement *AccountSessionComponentsAccountManagement `json:"account_management"` + AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"` + Balances *AccountSessionComponentsBalances `json:"balances"` + CapitalFinancing *AccountSessionComponentsCapitalFinancing `json:"capital_financing"` + CapitalFinancingApplication *AccountSessionComponentsCapitalFinancingApplication `json:"capital_financing_application"` + CapitalFinancingPromotion *AccountSessionComponentsCapitalFinancingPromotion `json:"capital_financing_promotion"` + Documents *AccountSessionComponentsDocuments `json:"documents"` + FinancialAccount *AccountSessionComponentsFinancialAccount `json:"financial_account"` + FinancialAccountTransactions *AccountSessionComponentsFinancialAccountTransactions `json:"financial_account_transactions"` + IssuingCard *AccountSessionComponentsIssuingCard `json:"issuing_card"` + IssuingCardsList *AccountSessionComponentsIssuingCardsList `json:"issuing_cards_list"` + NotificationBanner *AccountSessionComponentsNotificationBanner `json:"notification_banner"` + PaymentDetails *AccountSessionComponentsPaymentDetails `json:"payment_details"` + Payments *AccountSessionComponentsPayments `json:"payments"` + Payouts *AccountSessionComponentsPayouts `json:"payouts"` + PayoutsList *AccountSessionComponentsPayoutsList `json:"payouts_list"` + TaxRegistrations *AccountSessionComponentsTaxRegistrations `json:"tax_registrations"` + TaxSettings *AccountSessionComponentsTaxSettings `json:"tax_settings"` } // An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. diff --git a/api_version.go b/api_version.go index 1906349c36..29858e550b 100644 --- a/api_version.go +++ b/api_version.go @@ -7,5 +7,5 @@ package stripe const ( - apiVersion string = "2024-12-18.acacia" + apiVersion string = "2025-01-27.acacia" ) diff --git a/billingportal_configuration.go b/billingportal_configuration.go index 364c292540..7c3db0f08c 100644 --- a/billingportal_configuration.go +++ b/billingportal_configuration.go @@ -50,6 +50,7 @@ type BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior strin // List of values that BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior can take const ( + BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehaviorAlwaysInvoice BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior = "always_invoice" BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehaviorCreateProrations BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior = "create_prorations" BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehaviorNone BillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior = "none" ) @@ -145,7 +146,7 @@ type BillingPortalConfigurationFeaturesSubscriptionCancelParams struct { Enabled *bool `form:"enabled"` // Whether to cancel subscriptions immediately or at the end of the billing period. Mode *string `form:"mode"` - // Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + // Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. ProrationBehavior *string `form:"proration_behavior"` } diff --git a/charge.go b/charge.go index 6cda37c180..c5b17c5fa8 100644 --- a/charge.go +++ b/charge.go @@ -1936,6 +1936,7 @@ type ChargePaymentMethodDetailsP24 struct { // Przelewy24 rarely provides this information so the attribute is usually empty. VerifiedName string `json:"verified_name"` } +type ChargePaymentMethodDetailsPayByBank struct{} type ChargePaymentMethodDetailsPayco struct { // A unique identifier for the buyer as determined by the local payment processor. BuyerID string `json:"buyer_id"` @@ -2148,6 +2149,7 @@ type ChargePaymentMethodDetails struct { NaverPay *ChargePaymentMethodDetailsNaverPay `json:"naver_pay"` OXXO *ChargePaymentMethodDetailsOXXO `json:"oxxo"` P24 *ChargePaymentMethodDetailsP24 `json:"p24"` + PayByBank *ChargePaymentMethodDetailsPayByBank `json:"pay_by_bank"` Payco *ChargePaymentMethodDetailsPayco `json:"payco"` PayNow *ChargePaymentMethodDetailsPayNow `json:"paynow"` Paypal *ChargePaymentMethodDetailsPaypal `json:"paypal"` diff --git a/checkout_session.go b/checkout_session.go index 6a14c036b2..6409706b8f 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -2132,6 +2132,9 @@ type CheckoutSessionPaymentMethodOptionsP24Params struct { TOSShownAndAccepted *bool `form:"tos_shown_and_accepted"` } +// contains details about the Pay By Bank payment method options. +type CheckoutSessionPaymentMethodOptionsPayByBankParams struct{} + // contains details about the PAYCO payment method options. type CheckoutSessionPaymentMethodOptionsPaycoParams struct { // Controls when the funds will be captured from the customer's account. @@ -2366,6 +2369,8 @@ type CheckoutSessionPaymentMethodOptionsParams struct { OXXO *CheckoutSessionPaymentMethodOptionsOXXOParams `form:"oxxo"` // contains details about the P24 payment method options. P24 *CheckoutSessionPaymentMethodOptionsP24Params `form:"p24"` + // contains details about the Pay By Bank payment method options. + PayByBank *CheckoutSessionPaymentMethodOptionsPayByBankParams `form:"pay_by_bank"` // contains details about the PAYCO payment method options. Payco *CheckoutSessionPaymentMethodOptionsPaycoParams `form:"payco"` // contains details about the PayNow payment method options. @@ -3054,6 +3059,14 @@ type CheckoutSessionCustomerDetails struct { TaxIDs []*CheckoutSessionCustomerDetailsTaxID `json:"tax_ids"` } +// List of coupons and promotion codes attached to the Checkout Session. +type CheckoutSessionDiscount struct { + // Coupon attached to the Checkout Session. + Coupon *Coupon `json:"coupon"` + // Promotion code attached to the Checkout Session. + PromotionCode *PromotionCode `json:"promotion_code"` +} + // Custom fields displayed on the invoice. type CheckoutSessionInvoiceCreationInvoiceDataCustomField struct { // The name of the custom field. @@ -3661,7 +3674,7 @@ type CheckoutSessionSavedPaymentMethodOptions struct { // When set, provides configuration for Checkout to collect a shipping address from a customer. type CheckoutSessionShippingAddressCollection struct { // An array of two-letter ISO country codes representing which countries Checkout should provide as options for - // shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + // shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SY, UM, VI`. AllowedCountries []string `json:"allowed_countries"` } @@ -3817,6 +3830,8 @@ type CheckoutSession struct { // Collect additional information from your customer using custom fields. Up to 3 fields are supported. CustomFields []*CheckoutSessionCustomField `json:"custom_fields"` CustomText *CheckoutSessionCustomText `json:"custom_text"` + // List of coupons and promotion codes attached to the Checkout Session. + Discounts []*CheckoutSessionDiscount `json:"discounts"` // The timestamp at which the Checkout Session will expire. ExpiresAt int64 `json:"expires_at"` // Unique identifier for the object. diff --git a/confirmationtoken.go b/confirmationtoken.go index 195b3fbb37..0f9f728683 100644 --- a/confirmationtoken.go +++ b/confirmationtoken.go @@ -365,6 +365,7 @@ const ( ConfirmationTokenPaymentMethodPreviewTypeNaverPay ConfirmationTokenPaymentMethodPreviewType = "naver_pay" ConfirmationTokenPaymentMethodPreviewTypeOXXO ConfirmationTokenPaymentMethodPreviewType = "oxxo" ConfirmationTokenPaymentMethodPreviewTypeP24 ConfirmationTokenPaymentMethodPreviewType = "p24" + ConfirmationTokenPaymentMethodPreviewTypePayByBank ConfirmationTokenPaymentMethodPreviewType = "pay_by_bank" ConfirmationTokenPaymentMethodPreviewTypePayco ConfirmationTokenPaymentMethodPreviewType = "payco" ConfirmationTokenPaymentMethodPreviewTypePayNow ConfirmationTokenPaymentMethodPreviewType = "paynow" ConfirmationTokenPaymentMethodPreviewTypePaypal ConfirmationTokenPaymentMethodPreviewType = "paypal" @@ -925,6 +926,7 @@ type ConfirmationTokenPaymentMethodPreviewP24 struct { // The customer's bank, if provided. Bank ConfirmationTokenPaymentMethodPreviewP24Bank `json:"bank"` } +type ConfirmationTokenPaymentMethodPreviewPayByBank struct{} type ConfirmationTokenPaymentMethodPreviewPayco struct{} type ConfirmationTokenPaymentMethodPreviewPayNow struct{} type ConfirmationTokenPaymentMethodPreviewPaypal struct { @@ -1079,6 +1081,7 @@ type ConfirmationTokenPaymentMethodPreview struct { NaverPay *ConfirmationTokenPaymentMethodPreviewNaverPay `json:"naver_pay"` OXXO *ConfirmationTokenPaymentMethodPreviewOXXO `json:"oxxo"` P24 *ConfirmationTokenPaymentMethodPreviewP24 `json:"p24"` + PayByBank *ConfirmationTokenPaymentMethodPreviewPayByBank `json:"pay_by_bank"` Payco *ConfirmationTokenPaymentMethodPreviewPayco `json:"payco"` PayNow *ConfirmationTokenPaymentMethodPreviewPayNow `json:"paynow"` Paypal *ConfirmationTokenPaymentMethodPreviewPaypal `json:"paypal"` diff --git a/example/generated_examples_test.go b/example/generated_examples_test.go index 056edb2138..bba7a25dbf 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -3088,6 +3088,19 @@ func TestTerminalReadersProcessPaymentIntentPost(t *testing.T) { assert.Nil(t, err) } +func TestTerminalReadersProcessSetupIntentPost(t *testing.T) { + params := &stripe.TerminalReaderProcessSetupIntentParams{ + SetupIntent: stripe.String("seti_xxxxxxxxxxxxx"), + AllowRedisplay: stripe.String("always"), + } + result, err := terminal_reader.ProcessSetupIntent( + "tmr_xxxxxxxxxxxxx", + params, + ) + assert.NotNil(t, result) + assert.Nil(t, err) +} + func TestTestHelpersCustomersFundCashBalancePost(t *testing.T) { params := &stripe.TestHelpersCustomerFundCashBalanceParams{ Amount: stripe.Int64(30), diff --git a/financialconnections_transaction.go b/financialconnections_transaction.go index d44f22d276..6c0ae205d4 100644 --- a/financialconnections_transaction.go +++ b/financialconnections_transaction.go @@ -25,7 +25,7 @@ type FinancialConnectionsTransactionListTransactionRefreshParams struct { // Returns a list of Financial Connections Transaction objects. type FinancialConnectionsTransactionListParams struct { ListParams `form:"*"` - // The ID of the Stripe account whose transactions will be retrieved. + // The ID of the Financial Connections Account whose transactions will be retrieved. Account *string `form:"account"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` diff --git a/justfile b/justfile new file mode 100644 index 0000000000..5b17ac3d24 --- /dev/null +++ b/justfile @@ -0,0 +1,66 @@ +set quiet + +import? '../sdk-codegen/utils.just' + +# ensure tools installed with `go install` are available to call +export PATH := home_directory() + "/go/bin:" + env('PATH') + +_default: + just --list --unsorted + +# ⭐ run all unit tests, or pass a package name (./invoice) to only run those tests +test *args="./...": + go run scripts/test_with_stripe_mock/main.go -race {{ args }} + +# check for potential mistakes (slow) +lint: install + go vet ./... + staticcheck + +# don't depend on `install` in this step! Before formatting, our `go` code isn't syntactically valid +# ⭐ format all files +format: _normalize-imports install + scripts/gofmt.sh + goimports -w example/generated_examples_test.go + +# verify, but don't modify, the formatting of the files +format-check: + scripts/gofmt.sh check + +# ensures all client structs are properly registered +check-api-clients: + go run scripts/check_api_clients/main.go + +ci-test: test bench check-api-clients + +# compile the project +build: + go build ./... + +# install dependencies (including those needed for development). Mostly called by other recipes +install: + go get -t + go install honnef.co/go/tools/cmd/staticcheck@v0.4.7 + go install golang.org/x/tools/cmd/goimports@v0.24.0 + +# run benchmarking to check for performance regressions +bench: + go test -race -bench . -run "Benchmark" ./form + +# called by tooling. It updates the package version in the `VERSION` file and `stripe.go` +[private] +update-version version: && _normalize-imports + echo "{{ version }}" > VERSION + perl -pi -e 's|const clientversion = "[.\d\-\w]+"|const clientversion = "{{ version }}"|' stripe.go + +# go imports use the package's major version in the path, so we need to update them +# we also generate files with a placeholder `[MAJOR_VERSION]` that we need to replace +# we can pull the major version out of the `VERSION` file +# NOTE: because we run this _after_ other recipes that modify `VERSION`, it's important that we only read the file in the argument evaluation +# (if it's a top-level variable, it's read when the file is parsed, which is too early) +# arguments are only evaluated when the recipe starts +# so, setting it as the default means we get both the variable and the lazy evaluation we need +_normalize-imports major_version=replace_regex(`cat VERSION`, '\..*', ""): + perl -pi -e 's|github.com/stripe/stripe-go/v\d+|github.com/stripe/stripe-go/v{{ major_version }}|' README.md + perl -pi -e 's|github.com/stripe/stripe-go/v\d+|github.com/stripe/stripe-go/v{{ major_version }}|' go.mod + find . -name '*.go' -exec perl -pi -e 's|github.com/stripe/stripe-go/(v\d+\|\[MAJOR_VERSION\])|github.com/stripe/stripe-go/v{{ major_version }}|' {} + diff --git a/paymentintent.go b/paymentintent.go index 2d9c1c6c87..9bb221c84d 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1818,6 +1818,8 @@ type PaymentIntentPaymentMethodDataParams struct { OXXO *PaymentMethodOXXOParams `form:"oxxo"` // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. P24 *PaymentMethodP24Params `form:"p24"` + // If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + PayByBank *PaymentMethodPayByBankParams `form:"pay_by_bank"` // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. Payco *PaymentMethodPaycoParams `form:"payco"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @@ -2609,6 +2611,9 @@ type PaymentIntentPaymentMethodOptionsP24Params struct { TOSShownAndAccepted *bool `form:"tos_shown_and_accepted"` } +// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. +type PaymentIntentPaymentMethodOptionsPayByBankParams struct{} + // If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. type PaymentIntentPaymentMethodOptionsPaycoParams struct { // Controls when the funds are captured from the customer's account. @@ -3046,6 +3051,8 @@ type PaymentIntentPaymentMethodOptionsParams struct { OXXO *PaymentIntentPaymentMethodOptionsOXXOParams `form:"oxxo"` // If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. P24 *PaymentIntentPaymentMethodOptionsP24Params `form:"p24"` + // If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + PayByBank *PaymentIntentPaymentMethodOptionsPayByBankParams `form:"pay_by_bank"` // If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. Payco *PaymentIntentPaymentMethodOptionsPaycoParams `form:"payco"` // If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. @@ -5282,6 +5289,7 @@ type PaymentIntentPaymentMethodOptionsP24 struct { // When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). SetupFutureUsage PaymentIntentPaymentMethodOptionsP24SetupFutureUsage `json:"setup_future_usage"` } +type PaymentIntentPaymentMethodOptionsPayByBank struct{} type PaymentIntentPaymentMethodOptionsPayco struct { // Controls when the funds will be captured from the customer's account. CaptureMethod PaymentIntentPaymentMethodOptionsPaycoCaptureMethod `json:"capture_method"` @@ -5579,6 +5587,7 @@ type PaymentIntentPaymentMethodOptions struct { NaverPay *PaymentIntentPaymentMethodOptionsNaverPay `json:"naver_pay"` OXXO *PaymentIntentPaymentMethodOptionsOXXO `json:"oxxo"` P24 *PaymentIntentPaymentMethodOptionsP24 `json:"p24"` + PayByBank *PaymentIntentPaymentMethodOptionsPayByBank `json:"pay_by_bank"` Payco *PaymentIntentPaymentMethodOptionsPayco `json:"payco"` PayNow *PaymentIntentPaymentMethodOptionsPayNow `json:"paynow"` Paypal *PaymentIntentPaymentMethodOptionsPaypal `json:"paypal"` diff --git a/paymentlink.go b/paymentlink.go index 8cde30ef43..1af5d5fe29 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -158,6 +158,7 @@ const ( PaymentLinkPaymentMethodTypeMultibanco PaymentLinkPaymentMethodType = "multibanco" PaymentLinkPaymentMethodTypeOXXO PaymentLinkPaymentMethodType = "oxxo" PaymentLinkPaymentMethodTypeP24 PaymentLinkPaymentMethodType = "p24" + PaymentLinkPaymentMethodTypePayByBank PaymentLinkPaymentMethodType = "pay_by_bank" PaymentLinkPaymentMethodTypePayNow PaymentLinkPaymentMethodType = "paynow" PaymentLinkPaymentMethodTypePaypal PaymentLinkPaymentMethodType = "paypal" PaymentLinkPaymentMethodTypePayto PaymentLinkPaymentMethodType = "payto" diff --git a/paymentmethod.go b/paymentmethod.go index 65ccec6bfe..6cd0a064aa 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -305,6 +305,7 @@ const ( PaymentMethodTypeNaverPay PaymentMethodType = "naver_pay" PaymentMethodTypeOXXO PaymentMethodType = "oxxo" PaymentMethodTypeP24 PaymentMethodType = "p24" + PaymentMethodTypePayByBank PaymentMethodType = "pay_by_bank" PaymentMethodTypePayco PaymentMethodType = "payco" PaymentMethodTypePayNow PaymentMethodType = "paynow" PaymentMethodTypePaypal PaymentMethodType = "paypal" @@ -583,6 +584,9 @@ type PaymentMethodP24Params struct { Bank *string `form:"bank"` } +// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. +type PaymentMethodPayByBankParams struct{} + // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. type PaymentMethodPaycoParams struct{} @@ -759,6 +763,8 @@ type PaymentMethodParams struct { OXXO *PaymentMethodOXXOParams `form:"oxxo"` // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. P24 *PaymentMethodP24Params `form:"p24"` + // If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + PayByBank *PaymentMethodPayByBankParams `form:"pay_by_bank"` // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. Payco *PaymentMethodPaycoParams `form:"payco"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @@ -1285,6 +1291,7 @@ type PaymentMethodP24 struct { // The customer's bank, if provided. Bank string `json:"bank"` } +type PaymentMethodPayByBank struct{} type PaymentMethodPayco struct{} type PaymentMethodPayNow struct{} type PaymentMethodPaypal struct { @@ -1460,6 +1467,7 @@ type PaymentMethod struct { Object string `json:"object"` OXXO *PaymentMethodOXXO `json:"oxxo"` P24 *PaymentMethodP24 `json:"p24"` + PayByBank *PaymentMethodPayByBank `json:"pay_by_bank"` Payco *PaymentMethodPayco `json:"payco"` PayNow *PaymentMethodPayNow `json:"paynow"` Paypal *PaymentMethodPaypal `json:"paypal"` diff --git a/paymentmethodconfiguration.go b/paymentmethodconfiguration.go index c48fdd01bb..227d1a796a 100644 --- a/paymentmethodconfiguration.go +++ b/paymentmethodconfiguration.go @@ -614,6 +614,25 @@ const ( PaymentMethodConfigurationP24DisplayPreferenceValueOn PaymentMethodConfigurationP24DisplayPreferenceValue = "on" ) +// The account's display preference. +type PaymentMethodConfigurationPayByBankDisplayPreferencePreference string + +// List of values that PaymentMethodConfigurationPayByBankDisplayPreferencePreference can take +const ( + PaymentMethodConfigurationPayByBankDisplayPreferencePreferenceNone PaymentMethodConfigurationPayByBankDisplayPreferencePreference = "none" + PaymentMethodConfigurationPayByBankDisplayPreferencePreferenceOff PaymentMethodConfigurationPayByBankDisplayPreferencePreference = "off" + PaymentMethodConfigurationPayByBankDisplayPreferencePreferenceOn PaymentMethodConfigurationPayByBankDisplayPreferencePreference = "on" +) + +// The effective display preference value. +type PaymentMethodConfigurationPayByBankDisplayPreferenceValue string + +// List of values that PaymentMethodConfigurationPayByBankDisplayPreferenceValue can take +const ( + PaymentMethodConfigurationPayByBankDisplayPreferenceValueOff PaymentMethodConfigurationPayByBankDisplayPreferenceValue = "off" + PaymentMethodConfigurationPayByBankDisplayPreferenceValueOn PaymentMethodConfigurationPayByBankDisplayPreferenceValue = "on" +) + // The account's display preference. type PaymentMethodConfigurationPayNowDisplayPreferencePreference string @@ -1290,6 +1309,18 @@ type PaymentMethodConfigurationP24Params struct { DisplayPreference *PaymentMethodConfigurationP24DisplayPreferenceParams `form:"display_preference"` } +// Whether or not the payment method should be displayed. +type PaymentMethodConfigurationPayByBankDisplayPreferenceParams struct { + // The account's preference for whether or not to display this payment method. + Preference *string `form:"preference"` +} + +// Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. +type PaymentMethodConfigurationPayByBankParams struct { + // Whether or not the payment method should be displayed. + DisplayPreference *PaymentMethodConfigurationPayByBankDisplayPreferenceParams `form:"display_preference"` +} + // Whether or not the payment method should be displayed. type PaymentMethodConfigurationPayNowDisplayPreferenceParams struct { // The account's preference for whether or not to display this payment method. @@ -1535,6 +1566,8 @@ type PaymentMethodConfigurationParams struct { P24 *PaymentMethodConfigurationP24Params `form:"p24"` // Configuration's parent configuration. Specify to create a child configuration. Parent *string `form:"parent"` + // Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + PayByBank *PaymentMethodConfigurationPayByBankParams `form:"pay_by_bank"` // PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. PayNow *PaymentMethodConfigurationPayNowParams `form:"paynow"` // PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. @@ -1986,6 +2019,19 @@ type PaymentMethodConfigurationP24 struct { Available bool `json:"available"` DisplayPreference *PaymentMethodConfigurationP24DisplayPreference `json:"display_preference"` } +type PaymentMethodConfigurationPayByBankDisplayPreference struct { + // For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + Overridable bool `json:"overridable"` + // The account's display preference. + Preference PaymentMethodConfigurationPayByBankDisplayPreferencePreference `json:"preference"` + // The effective display preference value. + Value PaymentMethodConfigurationPayByBankDisplayPreferenceValue `json:"value"` +} +type PaymentMethodConfigurationPayByBank struct { + // Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + Available bool `json:"available"` + DisplayPreference *PaymentMethodConfigurationPayByBankDisplayPreference `json:"display_preference"` +} type PaymentMethodConfigurationPayNowDisplayPreference struct { // For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. Overridable bool `json:"overridable"` @@ -2233,6 +2279,7 @@ type PaymentMethodConfiguration struct { P24 *PaymentMethodConfigurationP24 `json:"p24"` // For child configs, the configuration's parent configuration. Parent string `json:"parent"` + PayByBank *PaymentMethodConfigurationPayByBank `json:"pay_by_bank"` PayNow *PaymentMethodConfigurationPayNow `json:"paynow"` Paypal *PaymentMethodConfigurationPaypal `json:"paypal"` Payto *PaymentMethodConfigurationPayto `json:"payto"` diff --git a/setupintent.go b/setupintent.go index 65605c99ed..d896cb4451 100644 --- a/setupintent.go +++ b/setupintent.go @@ -515,6 +515,9 @@ type SetupIntentPaymentMethodDataP24Params struct { Bank *string `form:"bank"` } +// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. +type SetupIntentPaymentMethodDataPayByBankParams struct{} + // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. type SetupIntentPaymentMethodDataPaycoParams struct{} @@ -685,6 +688,8 @@ type SetupIntentPaymentMethodDataParams struct { OXXO *SetupIntentPaymentMethodDataOXXOParams `form:"oxxo"` // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. P24 *SetupIntentPaymentMethodDataP24Params `form:"p24"` + // If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + PayByBank *SetupIntentPaymentMethodDataPayByBankParams `form:"pay_by_bank"` // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. Payco *SetupIntentPaymentMethodDataPaycoParams `form:"payco"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @@ -1258,6 +1263,9 @@ type SetupIntentConfirmPaymentMethodDataP24Params struct { Bank *string `form:"bank"` } +// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. +type SetupIntentConfirmPaymentMethodDataPayByBankParams struct{} + // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. type SetupIntentConfirmPaymentMethodDataPaycoParams struct{} @@ -1428,6 +1436,8 @@ type SetupIntentConfirmPaymentMethodDataParams struct { OXXO *SetupIntentConfirmPaymentMethodDataOXXOParams `form:"oxxo"` // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. P24 *SetupIntentConfirmPaymentMethodDataP24Params `form:"p24"` + // If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + PayByBank *SetupIntentConfirmPaymentMethodDataPayByBankParams `form:"pay_by_bank"` // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. Payco *SetupIntentConfirmPaymentMethodDataPaycoParams `form:"payco"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. diff --git a/terminal_configuration.go b/terminal_configuration.go index 5687db9c6d..7de9b80484 100644 --- a/terminal_configuration.go +++ b/terminal_configuration.go @@ -138,6 +138,16 @@ type TerminalConfigurationTippingHKDParams struct { SmartTipThreshold *int64 `form:"smart_tip_threshold"` } +// Tipping configuration for JPY +type TerminalConfigurationTippingJpyParams struct { + // Fixed amounts displayed when collecting a tip + FixedAmounts []*int64 `form:"fixed_amounts"` + // Percentages displayed when collecting a tip + Percentages []*int64 `form:"percentages"` + // Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + SmartTipThreshold *int64 `form:"smart_tip_threshold"` +} + // Tipping configuration for MYR type TerminalConfigurationTippingMYRParams struct { // Fixed amounts displayed when collecting a tip @@ -226,6 +236,8 @@ type TerminalConfigurationTippingParams struct { GBP *TerminalConfigurationTippingGBPParams `form:"gbp"` // Tipping configuration for HKD HKD *TerminalConfigurationTippingHKDParams `form:"hkd"` + // Tipping configuration for JPY + Jpy *TerminalConfigurationTippingJpyParams `form:"jpy"` // Tipping configuration for MYR MYR *TerminalConfigurationTippingMYRParams `form:"myr"` // Tipping configuration for NOK @@ -344,6 +356,14 @@ type TerminalConfigurationTippingHKD struct { // Below this amount, fixed amounts will be displayed; above it, percentages will be displayed SmartTipThreshold int64 `json:"smart_tip_threshold"` } +type TerminalConfigurationTippingJpy struct { + // Fixed amounts displayed when collecting a tip + FixedAmounts []int64 `json:"fixed_amounts"` + // Percentages displayed when collecting a tip + Percentages []int64 `json:"percentages"` + // Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + SmartTipThreshold int64 `json:"smart_tip_threshold"` +} type TerminalConfigurationTippingMYR struct { // Fixed amounts displayed when collecting a tip FixedAmounts []int64 `json:"fixed_amounts"` @@ -409,6 +429,7 @@ type TerminalConfigurationTipping struct { EUR *TerminalConfigurationTippingEUR `json:"eur"` GBP *TerminalConfigurationTippingGBP `json:"gbp"` HKD *TerminalConfigurationTippingHKD `json:"hkd"` + Jpy *TerminalConfigurationTippingJpy `json:"jpy"` MYR *TerminalConfigurationTippingMYR `json:"myr"` NOK *TerminalConfigurationTippingNOK `json:"nok"` NZD *TerminalConfigurationTippingNZD `json:"nzd"` diff --git a/testhelpers_confirmationtoken.go b/testhelpers_confirmationtoken.go index 2b5f28f103..aececa1498 100644 --- a/testhelpers_confirmationtoken.go +++ b/testhelpers_confirmationtoken.go @@ -167,6 +167,9 @@ type TestHelpersConfirmationTokenPaymentMethodDataP24Params struct { Bank *string `form:"bank"` } +// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. +type TestHelpersConfirmationTokenPaymentMethodDataPayByBankParams struct{} + // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. type TestHelpersConfirmationTokenPaymentMethodDataPaycoParams struct{} @@ -336,6 +339,8 @@ type TestHelpersConfirmationTokenPaymentMethodDataParams struct { OXXO *TestHelpersConfirmationTokenPaymentMethodDataOXXOParams `form:"oxxo"` // If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. P24 *TestHelpersConfirmationTokenPaymentMethodDataP24Params `form:"p24"` + // If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + PayByBank *TestHelpersConfirmationTokenPaymentMethodDataPayByBankParams `form:"pay_by_bank"` // If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. Payco *TestHelpersConfirmationTokenPaymentMethodDataPaycoParams `form:"payco"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.