#BidBird®
1 messages · Page 1 of 1 (latest)
I can see when stripe sends the updated PI it seems to strip the coupon_name is that expected behavior on the metadata
Let me test this with value 'null'..
ok! that sounds great
I am unable to reproduce this on my end and a value null is not ignored
interesting.
Here is what I see on my Dashboard and can see the values on my request in the Dashboard as well.
Can you confirm which library you're on?
👋 yeah what are you really doing. You talk about axios or fetch which doesn't add up if you're using our API
Undefined array key "coupon_name" that's what I'm getting on the webhook which is returned. If the coupon_name is stripped prior to getting to stripe, then that makes sense.
What's happening is after a customer selects a number of credits the js updates the payment intent:
await (async () => {
const response = await axios.post('https://bidbird.test/auctions/jobs/create/job-credits/update', {
//method: "POST", // or 'PUT'
// headers: {
// "Content-Type": "application/json",
// },
// body: JSON.stringify
({
params: {
paymentIntent: paymentIntent,
quantity: quantity,
price: price,
coupon_name: coupon_name
} });
So when that posts to my updateStripeIntent on the server
public function updatePaymentIntent(Request $request): \Illuminate\Http\JsonResponse
{
$amount = $request['params']['quantity'] * $request['params']['price'];
$intent = \Stripe\PaymentIntent::update( $request['params']['paymentIntent'],
['amount' => $amount,
'metadata' => [
'quantity' => $request['params']['quantity'], 'price' => $request['params']['price'], 'coupon_name' => $request['params']['coupon_name'], ]
] );
return response()->json(['status' => $intent]);}
why are you mixing up some JS and some PHP, what's happening? Why isn't your webhook handler written in PHP like the rest of your integration?
also where are params: { paymentIntent: paymentIntent, quantity: quantity, price: price, coupon_name: coupon_name } even coming from. Are those values correct? Did you properly log those to confirm?
The params come from the PaymentElement. It's a laravel app, so we use js in the blade files.
I'm super confused, you mentioned a webhook
I'm sorry but what is your real and exact question as the developer of this application. Which exact part of the code is failing?
Like do you have a concrete PaymentIntent id pi_123 where your PHP code updates it and sets some information properly?
for example if you look at the PaymentIntent from earlier, your only update call was https://dashboard.stripe.com/test/logs/req_pjd0sJjOlWT78B and that didn't have coupon_name
@winter lodge do you have any additional information?