#Macrohard

1 messages ยท Page 1 of 1 (latest)

strange boughBOT
simple reef
#

test

late burrow
#

@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

simple reef
#

Ah, k. About how long so I know going forward?

late burrow
#

It really depends - if the questions seem resolved we'll usually close it out faster

simple reef
#

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.

#

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?

late burrow
#

You need to remove the line automatic_payment_methods: {enabled: true}, if you're passing in payment_method_types

simple reef
#

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

late burrow
#

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

simple reef
#

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

late burrow
#

what do you see in your UI with that code?

simple reef
#

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

late burrow
#

How are you initializing the PaymentElement?

simple reef
#

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>
)
}

late burrow
#

Which docs specifically are you following?

#

Aha that's the issue

simple reef
#

I'll have to retrace my steps for the docs, give me a minute there

late burrow
#

You're doing the flow where you don't need the intent when you render the Payment Element

simple reef
#

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

late burrow
#

๐Ÿ‘ that's what I thought

#

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

simple reef
#

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.

late burrow
#

๐Ÿ‘

simple reef
#

you know what

#

I just tried it and it works

late burrow
#

(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

simple reef
#

thanks again for your help

late burrow
#

awesome! glad to know it works!

simple reef
#

that's what I see there

#

I'll leave that for another day

late burrow
#

Hmm... that's a bit weird

#

Yeah if you want me to dig in more just let me know

simple reef
#

All good, thanks again. I should be able to switch to live mode once I activate.