stripe / stripe-go

Go library for the Stripe API.
https://stripe.com
MIT License
2.15k stars 460 forks source link

Custom terms of service don't override auto generated terms of service disclaimer as expected. #1842

Closed linse closed 7 months ago

linse commented 7 months ago

Describe the bug

I'm not able to override the auto-generated terms of service disclaimer below the checkout button, even though the docs suggest it is possible to override completely.

I tried TermsOfServiceAcceptance, AfterSubmit, Submit. For all of them, my new Message text was displayed alongside the auto-generated disclaimer instead of overriding it. I would like to override it completely, and the docs and comments in the library made me think that this was possible.

To Reproduce

Create a checkout session with the code snippet below, adding your own disclaimer string. See that default terms of service disclaimer that is displayed below the checkout button is not overridden, but your own disclaimer string is presented above / below the auto generated text, with the auto-generated text still being present.

Expected behavior

I want to override the auto-generated terms of service disclaimer below the checkout button, the docs suggest it is possible to override completely.

Code snippets

func newStripeCheckoutSession(..) {
    ...
    params := &stripe.CheckoutSessionParams{
        ConsentCollection: &stripe.CheckoutSessionConsentCollectionParams{
            TermsOfService: stripe.String(string(stripe.CheckoutSessionConsentCollectionTermsOfServiceRequired)),
        },
        CustomText: &stripe.CheckoutSessionCustomTextParams{
            AfterSubmit: &stripe.CheckoutSessionCustomTextAfterSubmitParams{
                Message: stripe.String(disclaimer),
            },
            TermsOfServiceAcceptance: &stripe.CheckoutSessionCustomTextTermsOfServiceAcceptanceParams{
                Message: stripe.String(disclaimer),
            },
            Submit: &stripe.CheckoutSessionCustomTextSubmitParams{
                Message: stripe.String(disclaimer),
            },
        },
    ...
}

OS

Linux

Go version

go1.21.4

stripe-go version

v76.23.0

API version

2023-10-16

Additional context

No response

remi-stripe commented 7 months ago

@linse Github issues should be limited to bugs with the stripe-go SDK itself. Your question is more an integration support question better directed at our support team: https://support.stripe.com/contact

I recommend providing enough details to debug this such as an exact Checkout Session id, a screenshot of what you see with and without the custom_fields and what is not working. I have tried locally and if I pass both I see my custom text instead of Stripe's default ToS message. Support will then be able to help you!