#bird-payment-redirecturl
1 messages · Page 1 of 1 (latest)
So you are on localhost and in test mode?
Is there a request ID associated with that error?
yes, I'm on local host. Not sure about test mode. Does that mean the stripe dashboar?
https://bidbird.test/auctions/jobs/create
Are you using your test mode secret and publishable keys for your integration?
Okay so that error message isn't coming from us
That is from your own integration
That is not our hosted UI
pi_3MlECpKT8fxib8XB1BFRuHcW looks like this is happening on the confirm
Ah okay so yeah the issue is your return_url
You passed undefined/jobs/create/job-credits
That must be an actual HTTPS url
that's strange. looking into this console.log(process.env.APP_URL) must not be accessing the .env.
great idea
pi_3MlESIKT8fxib8XB0RJO7q2r succeeded! Alright. So now I'm trying to hook this up: On the updated method how do you generally submit the updated quantity?
form.addEventListener('submit', async (event) => {
event.preventDefault(); console.log(process.env.APP_URL)
Here?
updateStripeIntent()
1)
await (async () => {
const response = await fetch(process.env.APP_URL + '/jobs/create/job-credits/update');
if (response.status === 'requires_payment_method') {
const {error} = await elements.fetchUpdates(); } })();
2)
const {error} = await stripe.confirmPayment({
//`Elements` instance that was used to create the Payment Element process.env.APP_URL + elements, confirmParams: { return_url: 'https://bidbird.test/jobs/create/job-credits', }, });
Gotcha so yeah troubleshooting your .env.APP_URL seems like next step
Definitely will. May I have a little more help on this update()?
Happy to help if you have specific questions
I can't really help troubleshoot your APP_URL issue as that needs to be properly pulled from your backend
o for sure on the url. That'll be relatively easy.
I'm now concerned with where to update the PI after a user hits submit.
const options = { clientSecret: '{{ $stripeIntent->client_secret }}',
....
function updateStripeIntent () {
axios.post('/jobs/create/job-credits/update', {
params: {
options: this.options
request: this.request
}
}).then(function (response) {
this.options = response.data }.bind(this))
.catch(err => {
console.log(err) })}
Does that seem right?
I'm not sure if you can submit variables on the stripe fetch() or if I should call this custom method?
What update are you performing?
so, what it'll be is $request->quantity * $request->price = $amount
basically, I created the PI on the page creation, then a customer can select the number of job credits that they need.
Oh okay then yeah you want to fetch your backend just before calling confirmPayment and update the PI
nice, alright so above I've posted that submit. Is this updateStripeIntent() function necessary?
I thought that was the update request you are sending to your backend?
where I put step 1) is that where you'd call updateStripeIntent()?
ahh nice. ok. let me try and wire that up. I'll be back in a few!
Sounds good!