#xfechx
1 messages ยท Page 1 of 1 (latest)
Hi there. What's the issue you are facing?
Hi,
I have this include 'stripe.php'; $stripe = new \Stripe\StripeClient($secret_key, $connected_account); $stripe_promotion_code = $stripe->promotionCodes->update([ $stripe_promotion_code_id, [ 'active' => !$used, ] ], ['stripe_account' => $connect]);
but not working, so just want to make sure I have the format ok, I need to change the active parameter
Can you share the request id so I can take a look?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
dont have it
You don't have Dashboard access?
When you say its "not working" what do you mean?
Are you hitting an error, or is it not doing what you expect?
i need only guidance/example like in how to write for updating active param with a connected account attached, a dummy skelleton is ok
Well what you have looks valid, which i why i ask if you're having issues, and can be more specific about that
ok
What happens when you run that code?
i dont see it in logs
Which logs?
dashboard
Well it would be in the logs for the connected account, is that where you're looking?
Ok, so when running that request, can you log out the request id header from the result? Or share the connected account you're using so I can look for it?
sure, can I give you the platform and account?
connected account: acct_1EVqvDLeN6kOhyrs
platform: acct_103xXp2lgzywWyEx
yea i'm not seeing update requests either -- only new promo code creation
Can you try running the same request using curl and share the request ID, and/or any errors?
not sure how to add a connected account parameter to curl
can you please send me a skelleton in php of how to update the active field of a promotion code with a connected account, please?
is what I have been asking since beginning
ok got this:
(Status 404) Unrecognized request URL (POST: /v1/promotion_codes/). If you are trying to list objects, remove the trailing slash. If you are trying to retrieve an object, make sure you passed a valid (non-empty) identifier in your code. Please see https://stripe.com/docs or we can help at https://support.stripe.com/.
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I have no problems creating a promo code with almost the same code
for updating I get the error above
??
Catching up, just a sec
ok, that looks like your existing promo code id is missing
You alreayd have the skeleton, is what i'm saying, your code looks correct
Log and check the contents of $stripe_promotion_code_id -- that error suggests it might be empty
ahhh ok
I think i see, can you try this:
$stripe_promotion_code = $stripe->promotionCodes->update(
[
'id' => $stripe_promotion_code_id,
'active' => !$used,
]
, ['stripe_account' => $connect]);
note the id moved inside the first param array
err sorry, no nested array, fixing
same error
throws me the same error
with this $stripe_promotion_code = $stripe->promotionCodes->update( [ 'id' => $stripe_promotion_code_id, 'active' => !$used, ] , ['stripe_account' => $connected] );
changed $connect, for $connected (it has the stripe_account_id)
but still not working with new edits you sent
get the same error
ok last try, i think i missed your extra [] and thought i did that:
$stripe_promotion_code = $stripe->promotionCodes->update(
$stripe_promotion_code_id,
[
'active' => !$used,
]
, ['stripe_account' => $connect]);
What do you mean by used?
times_redeemed?
You can deactivate them if you like or check times_redeemed
https://stripe.com/docs/api/promotion_codes/object#promotion_code_object-times_redeemed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes, exactly ๐
is "times_redeemed" updateable?
ok, so I cannot update it via API
Nope
NP! thanks for your patience -- have a good one