#nextplayerrr_api

1 messages ¡ Page 1 of 1 (latest)

knotty pebbleBOT
#

👋 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/1337450546981769217

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

hushed fjord
#
invoice = stripe.Invoice.create(
        customer=stripe_customer_id,
        collection_method="charge_automatically",
        metadata={
            "invoice_id": invoice_id
        },
        currency="usd",
        description=description
    )
    stripe_invoice_id = invoice.id
    for item in items_billed:
        if not item['unit_price'] or not item['amount']:
            stripe.InvoiceItem.create(
                customer=stripe_customer_id,
                amount=item['total_price'],
                currency="usd",
                description=item['title'],
                invoice=stripe_invoice_id
            )
        else:
            stripe.InvoiceItem.create(
                customer=stripe_customer_id,
                unit_amount=item['unit_price'],
                quantity=item['amount'],
                currency="usd",
                description=item['title'],
                invoice=stripe_invoice_id
            )

    result = stripe.Invoice.finalize_invoice(stripe_invoice_id)```
#

This is how I create the invoice

kind crag
hushed fjord
#

Ok thank you

kind crag