#arilks_api

1 messages · Page 1 of 1 (latest)

sick skyBOT
#

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

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

sick skyBOT
rotund solar
#

Do you have to collect shipping?

tall flare
#

I don't quite understand what you mean. The addresses for "Bill to" and "Ship to" were filled in by me through the "Customers -> Create" interface. Can I hide the "Ship to" address?

rotund solar
#

If you don't collect a shipping address then ship to won't be populated

#

Otherwise it will

#

So that's why I asked if you have to collect shipping for your integration

tall flare
#
$stripe = new StripeClient(config('services.stripe.secret'));

        $invoice = $stripe->invoices->create([
            'customer' => 'cus_TcHcznKWD7hQmD',
            'collection_method' => 'charge_automatically',
        ]);


        $stripe->invoiceItems->create([
            'customer' => 'cus_TcHcznKWD7hQmD',
            'invoice' => $invoice->id,
            'description' => 'Diamond 服務費 / 年',
            'amount' => 128888,
            'currency' => 'eur',
        ]);
        
        $invoice = $stripe->invoices->finalizeInvoice($invoice->id);
        
        $invoice = $stripe->invoices->pay($invoice->id, [
            'paid_out_of_band' => true
        ]);

Can I send you the code?

rotund solar
#

The issue is you passed a shipping address when creating the customer

#

So if all you need is billing address, then just populate that

tall flare
#

Okay, I'll try handling it in invoiceItems->create.

rotund solar
#

What do you mean

tall flare
#

When creating a user, is it okay to leave the address blank and set it through the /v1/invoices interface?

rotund solar
#

Yes

tall flare
#

The "Ship to" option means the address you filled in will definitely appear on the PDF, right?

rotund solar
#

If you populate shipping address on either the invoice or the customer, then ship to will always be included on the pdf

#

However, if you only populate billing address on the customer or invoice, then ship to will not appear

tall flare
#

Okay, okay, I understand. The marked address will definitely be displayed after I fill in the address.