#codingwisely
1 messages ยท Page 1 of 1 (latest)
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?
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');
}
}```
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.
thanks man
req_cvGRtP1xFaAs4w
there we go, found it ๐
found it
there is Cashier::calculateTaxes(); - so i will disable it now
and try
moment
yeah, so you can see from https://dashboard.stripe.com/test/logs/req_cvGRtP1xFaAs4w that Cashier passes automatic_tax[enabled]=true so you need to make it not do that
ok cool
thank you so much ! ๐ that logs page helped a lot ๐
much appreciated!
while here, may i ask you one more thing please
sure thing!
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,
});
the options are passed when creating the PaymentElement, not when creating the stripe.elements
it looks that stripe.elements accept only 2 params
elements = stripe.elements({
appearance,
clientSecret:clientSecret
});
paymentElement = elements.create("payment", options);
paymentElement.mount("#payment-element");
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;
});