#Macrohard
1 messages ยท Page 1 of 1 (latest)
test
@simple reef Hello! We typically close threads that haven't been responded to in a while
I can help if you give me a quick summary of your current issue
Ah, k. About how long so I know going forward?
It really depends - if the questions seem resolved we'll usually close it out faster
Yes, please read the past thread I pointed to. I can now see the options in the web UI -- not sure how I missed that before. It appears that I cannot change anything in test mode, so I'm happy to wait until I fully activate the account. That's fine. However, separately from that I should have said that I'm using a SetupIntent. I followed the docs here: https://stripe.com/docs/api/setup_intents/create?lang=ruby.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and my actual code is as follows:
intent = Stripe::SetupIntent.create({
customer: user.stripe_id,
automatic_payment_methods: {enabled: true},
payment_method_types: ['card']
})
however, that doesn't change the UI element. So now I'm just curious if that's also "not working" because I'm still in test mode (pre-activated), and I can expect that to change later?
You need to remove the line automatic_payment_methods: {enabled: true}, if you're passing in payment_method_types
okay, should take 1 minute
Unfortunately that didn't appear to work. I can continue looking at it, but would you mind confirming that I can or cannot change the payment method types with a pre-activated account?
Just to avoid spinning my gears on it
Well backing up here for a second - if you're manually setting the payment method types when you create the SetupIntent then you shouldn't be touching the dashboard settings at all
You'd only want to change the payment methods through the dashboard if you're using automatic_payment_methods
Which I was originally
although I hadn't actually discovered the dashboard yet
until it was linked in the prior thread
I have undone that per your suggestion, and strictly using the method types parameters as shown
intent = Stripe::SetupIntent.create({
customer: user.stripe_id,
# automatic_payment_methods: {enabled: true},
payment_method_types: ['card']
})
did hard reset on front and backend as well
so I'm not sure if the behavior is consistent with the dashboard at this point
particularly if I can or cannot change this pre-activated
I'm happy to kick this down the road until after I activate, since it may just be easier to use the dashboard
what do you see in your UI with that code?
I still see the cash app section there
tbh, it seemed odd that the config for it is on the backend
just now I shut down my backend completely, refreshed the front end, and the elements still render
seems like there's a disconnect about how this works
How are you initializing the PaymentElement?
return (
<form onSubmit={foo}>
<AddressElement options={addressOptions} />
<PaymentElement />
<button type="submit" disabled={!stripe || loading}>
Submit
</button>
{errorMessage && <div>{errorMessage}</div>}
</form>
);
almost entirely from the docs -- I can share the foo handler if needed
then there's the outer form:
const AddCardInfo = (): JSX.Element => {
const options = {
mode: 'setup',
currency: 'usd',
setupFutureUsage: 'off_session'
} as StripeElementsOptions
return (
<Elements stripe={stripePromise} options={options}>
<CheckoutForm />
</Elements>
)
}
I'll have to retrace my steps for the docs, give me a minute there
You're doing the flow where you don't need the intent when you render the Payment Element
Yeah, I learned my flow is rather offbeat
my product is pay as you go
we take the card with no known payments or ongoing subscription cost
it's just based on X usage at end of month
this was the key doc I used: https://stripe.com/docs/payments/accept-a-payment-deferred?type=setup
๐ that's what I thought
so for your particular case you'll want to pay close attention to this section https://stripe.com/docs/payments/accept-a-payment-deferred?type=setup#additional-options
Specifically, the paymentMethodTypes parameter that you can set in options
You can either specify that to only pass in card
If you don't provide that param at all, then it's controlled through the dashboard
Okay, I must have looked at that 10 times
I think the problem is that I didn't realize what it was called at the time
I'm nearly certain this will do what I expect
I'll have to try it in a bit, but I appreciate all your help. I believe I'm on the right path now.
๐
(and for what it's worth you should definitely be able to change your settings with an un-activated account) It may be that you accidentally have the "test mode" setting toggled off
thanks again for your help
awesome! glad to know it works!
All good, thanks again. I should be able to switch to live mode once I activate.