条纹收据 url

Stripe receipt url

我可以从 Stripe 仪表板查看收据(点击发票详细信息中的预览 link)。然后收据显示在弹出窗口中,但其中有一个 permalink,因此可以将其视为一个单独的页面。电子邮件收据的 URL 如下所示:

https://dashboard.stripe.com/emails/receipts/invrc_xxxxxxxxxxxx

此 URL 不需要身份验证,因此非常适合让我显示 link 以显示我应用程序结算页面中的收据详细信息。除了似乎无法从 API 中获取神奇的 invrc_xxxxxxxxxxxx id,所以我无法构造 URL.

或者出于某种奇怪的原因,Stripe 工程师设计了一个未经验证的收据查看页面,但决定不通过 API 公开它。为什么??

此问题已在 Stripe API - Receipts Listing 中提出(请参阅底部的评论部分),但未提供任何解释、解决方案或理由。希望这个更具体的问题能有所帮助。

更新: 自 2019 年 1 月 17 日起,现在可以执行此操作。 Charge 对象具有 receipt_url property,无论电子邮件收据是否已发送,您都可以访问此信息!

这是重新发送一封新邮件吗?在成功付款的设置中有一个选项向客户发送电子邮件。另一个想法是将电子邮件发送到像 Mandrill 这样的东西进行处理并提取 URL:

http://help.mandrill.com/entries/21699367-Inbound-Email-Processing-Overview

不幸的是,目前不支持该功能。无法通过 API 获取要在此处使用的收据 ID。该端点的构建目的是仅用于从收据电子邮件正文永久链接到收据。也就是说,我们正在考虑在未来的某个时候构建此功能。

编辑:看起来我在 Stripe 支持部门的同事在这方面先发制人。

更新:截至 2019 年 1 月 17 日,现在通过 receipt_url 属性 收费 (https://stripe.com/docs/api/charges/object#charge_object-receipt_url) 支持。

invoice object 具有以下属性:

hosted_invoice_url - string - The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.

invoice_pdf - string - The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.

使用截图解决API 如果您使用的是 React,请试试这个,但您可以只使用 ajax 请求在您的应用程序中显示收据

const [recipt, setrecipt] = useState({loading: false,img: '',});

从条带响应中获取 url receipt_url const url = receipt_url

const result = await axios.get(`https://screenshotapi.net/api/v1/screenshot url=${url}&token=yourtokenhere`,);

然后你可以从 result.data.screenshot 中找到 png URL 然后你可以使用 img 标签来显示它确保用你的替换令牌