velirapay 0.2.0 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this library are documented here. It follows [Semantic Versioning](https://semver.org).
4
4
 
5
+ ## 0.2.1 - 2026-11-12
6
+
7
+ - `invoices.create()` takes `success_url` and `cancel_url`, public https:// addresses the invoice's page and its charges' checkout offer the customer a way back to: a button once they have paid, and a link while it is open. `invoice.successUrl` and `invoice.cancelUrl` read them back, and are `null` in webhooks, which leave them out.
8
+
5
9
  ## 0.2.0 - 2026-11-12
6
10
 
7
11
  ### Breaking
package/README.md CHANGED
@@ -243,6 +243,7 @@ const invoice = await velirapay.invoices.create({
243
243
  { description: 'Hosting', quantity: '1', unit_amount: '250.00' },
244
244
  ],
245
245
  due_at: '2026-12-01', // a day, as YYYY-MM-DD
246
+ success_url: 'https://example.com/orders/1042',
246
247
  send_email: true,
247
248
  });
248
249
 
@@ -469,7 +470,7 @@ The charge and invoice in a delivery are not quite the ones the API answers with
469
470
 
470
471
  - A charge's coin amounts and exchange rate carry all 18 decimal places (`"0.002500000000000000"` rather than `"0.0025"`). Compare amounts as numbers, not as strings.
471
472
  - A charge has no `timeline`, `refunds`, `checkoutUrl`, `receiptUrl`, `successUrl`, `cancelUrl` or `successMessage`. It names its payment link with its title and its invoice with its number: `charge.paymentLink` and `charge.invoice` hold the codes, and `charge.paymentLinkTitle` and `charge.invoiceNumber` the rest, which are `null` on the API's charges.
472
- - An invoice has no `overdue` or `documentUrl`; both are `null`.
473
+ - An invoice has no `overdue`, `documentUrl`, `successUrl` or `cancelUrl`; all four are `null`.
473
474
  - `charge.refunded` carries no refund. Read its amount, txid and reason from the event: `(await velirapay.events.retrieve(eventId)).details`.
474
475
 
475
476
  Fetch the object when you need what a delivery leaves out.
@@ -36,7 +36,7 @@ export interface ClientOptions {
36
36
  export declare class VeliraPayClient {
37
37
  #private;
38
38
  /** The version of this library. */
39
- static readonly VERSION = "0.2.0";
39
+ static readonly VERSION = "0.2.1";
40
40
  /** The address of the VeliraPay API. */
41
41
  static readonly DEFAULT_BASE_URL = "https://api.velirapay.com";
42
42
  /** The account the API key belongs to. */
@@ -93,6 +93,10 @@ export interface InvoiceCreateParams {
93
93
  memo?: string | null;
94
94
  /** The day it is due, as YYYY-MM-DD. */
95
95
  due_at?: string | null;
96
+ /** A public https:// address the customer is offered a button back to once they have paid. */
97
+ success_url?: string | null;
98
+ /** A public https:// address the customer can go back to from the invoice without paying. */
99
+ cancel_url?: string | null;
96
100
  send_email?: boolean;
97
101
  }
98
102
  export interface InvoiceListParams extends PageParams {
@@ -46,6 +46,10 @@ export declare class Invoice extends ApiResource {
46
46
  readonly voidedAt: Date | null;
47
47
  /** When it was created. */
48
48
  readonly createdAt: Date | null;
49
+ /** The page the customer is offered a button back to once they have paid; absent from webhooks. */
50
+ readonly successUrl: string | null;
51
+ /** The page the customer can go back to from the invoice without paying; absent from webhooks. */
52
+ readonly cancelUrl: string | null;
49
53
  constructor(attributes: Attributes);
50
54
  /** Whether the invoice can still be paid. */
51
55
  isOpen(): boolean;
@@ -43,6 +43,10 @@ class Invoice extends api_resource_ts_1.ApiResource {
43
43
  voidedAt;
44
44
  /** When it was created. */
45
45
  createdAt;
46
+ /** The page the customer is offered a button back to once they have paid; absent from webhooks. */
47
+ successUrl;
48
+ /** The page the customer can go back to from the invoice without paying; absent from webhooks. */
49
+ cancelUrl;
46
50
  constructor(attributes) {
47
51
  super(attributes);
48
52
  this.id = (0, api_resource_ts_1.string)(attributes, 'id', (0, api_resource_ts_1.string)(attributes, 'code'));
@@ -68,6 +72,8 @@ class Invoice extends api_resource_ts_1.ApiResource {
68
72
  this.paidAt = (0, api_resource_ts_1.date)(attributes, 'paid_at');
69
73
  this.voidedAt = (0, api_resource_ts_1.date)(attributes, 'voided_at');
70
74
  this.createdAt = (0, api_resource_ts_1.date)(attributes, 'created_at');
75
+ this.successUrl = (0, api_resource_ts_1.nullableString)(attributes, 'success_url');
76
+ this.cancelUrl = (0, api_resource_ts_1.nullableString)(attributes, 'cancel_url');
71
77
  }
72
78
  /** Whether the invoice can still be paid. */
73
79
  isOpen() {
@@ -1,2 +1,2 @@
1
1
  /** The version of this library. */
2
- export declare const VERSION = "0.2.0";
2
+ export declare const VERSION = "0.2.1";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  /** The version of this library. */
5
- exports.VERSION = '0.2.0';
5
+ exports.VERSION = '0.2.1';
@@ -36,7 +36,7 @@ export interface ClientOptions {
36
36
  export declare class VeliraPayClient {
37
37
  #private;
38
38
  /** The version of this library. */
39
- static readonly VERSION = "0.2.0";
39
+ static readonly VERSION = "0.2.1";
40
40
  /** The address of the VeliraPay API. */
41
41
  static readonly DEFAULT_BASE_URL = "https://api.velirapay.com";
42
42
  /** The account the API key belongs to. */
@@ -93,6 +93,10 @@ export interface InvoiceCreateParams {
93
93
  memo?: string | null;
94
94
  /** The day it is due, as YYYY-MM-DD. */
95
95
  due_at?: string | null;
96
+ /** A public https:// address the customer is offered a button back to once they have paid. */
97
+ success_url?: string | null;
98
+ /** A public https:// address the customer can go back to from the invoice without paying. */
99
+ cancel_url?: string | null;
96
100
  send_email?: boolean;
97
101
  }
98
102
  export interface InvoiceListParams extends PageParams {
@@ -46,6 +46,10 @@ export declare class Invoice extends ApiResource {
46
46
  readonly voidedAt: Date | null;
47
47
  /** When it was created. */
48
48
  readonly createdAt: Date | null;
49
+ /** The page the customer is offered a button back to once they have paid; absent from webhooks. */
50
+ readonly successUrl: string | null;
51
+ /** The page the customer can go back to from the invoice without paying; absent from webhooks. */
52
+ readonly cancelUrl: string | null;
49
53
  constructor(attributes: Attributes);
50
54
  /** Whether the invoice can still be paid. */
51
55
  isOpen(): boolean;
@@ -40,6 +40,10 @@ export class Invoice extends ApiResource {
40
40
  voidedAt;
41
41
  /** When it was created. */
42
42
  createdAt;
43
+ /** The page the customer is offered a button back to once they have paid; absent from webhooks. */
44
+ successUrl;
45
+ /** The page the customer can go back to from the invoice without paying; absent from webhooks. */
46
+ cancelUrl;
43
47
  constructor(attributes) {
44
48
  super(attributes);
45
49
  this.id = string(attributes, 'id', string(attributes, 'code'));
@@ -65,6 +69,8 @@ export class Invoice extends ApiResource {
65
69
  this.paidAt = date(attributes, 'paid_at');
66
70
  this.voidedAt = date(attributes, 'voided_at');
67
71
  this.createdAt = date(attributes, 'created_at');
72
+ this.successUrl = nullableString(attributes, 'success_url');
73
+ this.cancelUrl = nullableString(attributes, 'cancel_url');
68
74
  }
69
75
  /** Whether the invoice can still be paid. */
70
76
  isOpen() {
@@ -1,2 +1,2 @@
1
1
  /** The version of this library. */
2
- export declare const VERSION = "0.2.0";
2
+ export declare const VERSION = "0.2.1";
@@ -1,2 +1,2 @@
1
1
  /** The version of this library. */
2
- export const VERSION = '0.2.0';
2
+ export const VERSION = '0.2.1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "velirapay",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "description": "The official Node.js library for VeliraPay crypto payments: charges, payment links, invoices, payouts, events and webhook verification.",
6
6
  "keywords": [
7
7
  "velirapay",