首页 > 解决方案 > 使用php创建发票后如何获取条带发票链接

问题描述

我使用条纹发票创建创建了发票 ID:

$invoice = \Stripe\Invoice::create([
   "customer" => "customer_id",
   ]);

但是想要获取以开头的发票 IDinvst_那么我该如何获取呢?

所以我会用这个链接访问发票

https://pay.stripe.com/invoice/invst_

标签: phpstripe-payments

解决方案


我得到了我自己的答案。使用这些获取发票详细信息:

$invoiceId = $subscription->latest_invoice;
$invoice = \Stripe\Invoice::retrieve($invoiceId);
$invoice_hosted_url = $invoice->hosted_invoice_url;
$invoice_pdf = $invoice->invoice_pdf;

invoice_hosted_url是发票的主要链接invst_和完整链接。


推荐阅读