#codingwisely

1 messages ยท Page 1 of 1 (latest)

indigo relicBOT
vapid pasture
#

probably you should just remove automatic_tax from the parameters you pass when creating the Subscription

#

what is the request ID req_xxx for the error message you mentioned so I can take a look?

white arch
#

Hello karllekko, thank you, how do i do that please?

#

hee is the code dispatching request:

class SubscriptionController extends Controller

{

    public function __invoke(SubscriptionRequest $request)

    {

        auth()->user()->newSubscription($request->plan['name'], $request->plan['price_id'])

                ->create($request->paymentMethod);





        return redirect('dashboard')->with('success');

    }

}```
vapid pasture
#

not sure, that is Lavarel, which I don't know about

#

do you have the request ID? at least that way we can see what options lavarel is passing to the actual API, and go from there.

white arch
#

thanks man

#

req_cvGRtP1xFaAs4w

#

there we go, found it ๐Ÿ™‚

#

found it

#

there is Cashier::calculateTaxes(); - so i will disable it now

#

and try

#

moment

vapid pasture
#

ok cool

white arch
#

thank you so much ! ๐Ÿ™‚ that logs page helped a lot ๐Ÿ˜„

#

much appreciated!

#

while here, may i ask you one more thing please

vapid pasture
#

sure thing!

white arch
#

this is payment element

#

now, i see in documentations that i can style it and assign options

#

but, looks like it cant do both at same time! ๐Ÿ˜„

#

this is from console: controller-7e36e2bfd0607340203c26db67558080.js:1 Unrecognized elements() parameter: options is not a recognized parameter. This may cause issues with your integration in the future.

#

and here is my attempt:

const options = {
        layout: {
            type: "accordion",
            defaultCollapsed: true,
        },
    };
    const appearance = {
        labels: "floating",
        theme: "flat",
        variables: {
            colorPrimary: "#2BADAD",
            colorBackground: "#1f2937",
            colorText: "#FFF",
            colorDanger: "#df1b41",
            fontFamily: "Mona Sans, system-ui, sans-serif",
            spacingUnit: "4px",
            borderRadius: "4px",
            // See all possible variables below
        },
        // other configurations such as `theme`, `variables` and `rules`...
    };

    elements = stripe.elements({
        clientSecret: props.setupIntent.client_secret,
        appearance,
        options,
    });
vapid pasture
#

the options are passed when creating the PaymentElement, not when creating the stripe.elements

white arch
#

it looks that stripe.elements accept only 2 params

vapid pasture
#
elements = stripe.elements({ 
    appearance,
    clientSecret:clientSecret
  });

  paymentElement = elements.create("payment", options);
  paymentElement.mount("#payment-element");
white arch
#

this one?

#

v

#

const paymentElement = elements.create("payment");
paymentElement.mount("#payment-element");

#

ahhhh!

#

damn me! Dtupid! ๐Ÿ˜„ ๐Ÿ˜„

#

โค๏ธ

#

ahahahahaha

#

thank you ๐Ÿ™‚

#

one more the last and i will let you be ๐Ÿ˜„

#

how can i prefill email on element? i know how to prefill email on payment links, but i want it prefilled on my form

#

on elements ๐Ÿ™‚

#
onMounted(async () => {
    stripe = await loadStripe(import.meta.env.VITE_STRIPE_KEY);
    const options = {
        layout: {
            type: "accordion",
            defaultCollapsed: true,
        },
    };
    const appearance = {
        labels: "floating",
        theme: "flat",
        variables: {
            colorPrimary: "#2BADAD",
            colorBackground: "#1f2937",
            colorText: "#FFF",
            colorDanger: "#df1b41",
            fontFamily: "Mona Sans, system-ui, sans-serif",
            spacingUnit: "4px",
            borderRadius: "4px",
            // See all possible variables below
        },
        // other configurations such as `theme`, `variables` and `rules`...
    };

    elements = stripe.elements({
        clientSecret: props.setupIntent.client_secret,
        appearance,
    });
    const paymentElement = elements.create("payment", options);
    paymentElement.mount("#payment-element");
    const linkAuthenticationElement = elements.create("linkAuthentication");
    linkAuthenticationElement.mount("#link-authentication-element");
    isLoading.value = false;
});
white arch
#

works, thank you!

#

again, thank you very mso much !

#

i wish you wonderful day sir