#climatebro_code

1 messages · Page 1 of 1 (latest)

hexed wraithBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1237549515859558420

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

candid ravine
#

def update_prices():
try:
product = stripe.Product.list(name="Monthly Donation (GBP)", limit=1).data[0]

    prices = stripe.Price.list(product=product.id)

    for price in prices:
        if price.unit_amount == 700 and price.currency == "gbp" and price.recurring.interval == "month" and price.billing_scheme == "per_unit":
            # Update the price to a £7 per month flat rate fixed price with no proration
            stripe.Price.modify(
                price.id,
                unit_amount=700,
                billing_scheme="fixed_price",
                proration_behavior="none",
            )
            print("Price updated to £7 per month for the product 'Monthly Donation (GBP)' with no proration")
            return

    print("No eligible prices found for update")

except stripe.error.StripeError as e:
    print(f"Stripe error: {e}")
#

Above is the script i'm trying to get to work

stable osprey
#

Are you able to add some logging to inspect the value of product and prices?

hexed wraithBOT