@meterbox/customer-portal 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,7 +44,9 @@ function handlePlanSelect(plan, billingInterval) {
44
44
  (`/v1/customer-portal/:id/cancellation`). Also exported on its own as
45
45
  `<CancelSubscription>`. Each step reaches you as a webhook
46
46
  (`customer.cancel.initiated`, `customer.win-back.accepted`,
47
- `customer.cancel.confirmed`).
47
+ `customer.cancel.confirmed`). Below that, the customer's **invoices**, each
48
+ with its PDF and payment page (`<InvoiceHistory>`,
49
+ `GET /v1/customer-portal/:id/invoices`).
48
50
  - **Plans**: the published plans (`GET /v1/customer-portal/:id/plans`) in a
49
51
  `<PricingTable>` (monthly/annual toggle and each plan's model rates
50
52
  included) + inline
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meterbox/customer-portal",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Drop-in multi-page React customer portal for Meterbox: Account, Plans, Credits. Built on @meterbox/react.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://meterbox.ai",
@@ -17,7 +17,7 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@meterbox/react": "0.1.2"
20
+ "@meterbox/react": "0.1.4"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=17",
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * <AccountPage /> — fetches GET /v1/customer-portal/:id/me and renders the
3
- * customer's own profile + current plan.
3
+ * customer's own profile + current plan, the way to cancel, and their
4
+ * invoices with PDFs (`<InvoiceHistory>` from @meterbox/react).
4
5
  */
5
6
 
6
7
  const React = require("react");
8
+ const { InvoiceHistory } = require("@meterbox/react");
7
9
  const CancelSubscription = require("../CancelSubscription");
8
10
 
9
11
  const styles = {
@@ -163,6 +165,7 @@ function AccountPage({ baseUrl, customerId, customerToken, fetch: fetchImpl }) {
163
165
  cancelAt: me.cancel_at,
164
166
  onChange: reload,
165
167
  }),
168
+ React.createElement(InvoiceHistory, { baseUrl, customerId, customerToken, fetch: fetchImpl }),
166
169
  );
167
170
  }
168
171