velirapay 0.2.1 → 0.2.2
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 +4 -0
- package/README.md +2 -0
- package/dist/cjs/client.d.ts +1 -1
- package/dist/cjs/resources/charge.d.ts +6 -0
- package/dist/cjs/resources/charge.js +9 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client.d.ts +1 -1
- package/dist/esm/resources/charge.d.ts +6 -0
- package/dist/esm/resources/charge.js +10 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
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.2 - 2026-11-12
|
|
6
|
+
|
|
7
|
+
- `charge.customer.ipCountry`, `ipAsn` and `ipNetwork`: what VeliraPay works out from the customer's IP address, in the API's answers and in webhooks alike. `ipCountry` is the country the hosted checkout placed the address in, as an ISO 3166 two-letter code or `T1` for Tor, and `null` for a charge created through the API; `ipAsn` is the number of the network (autonomous system) the address belongs to, and `ipNetwork` who runs it, such as `24940` and `'Hetzner Online GmbH'`. A customer on a hosting company's network is often a bot or someone hiding behind a server. They are read only, and `null` in a payload that leaves them out.
|
|
8
|
+
|
|
5
9
|
## 0.2.1 - 2026-11-12
|
|
6
10
|
|
|
7
11
|
- `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.
|
package/README.md
CHANGED
|
@@ -203,6 +203,8 @@ charge.customer.metadata; // { orders: 7 }
|
|
|
203
203
|
|
|
204
204
|
Every field is optional, and any other key is refused with a `ValidationError`. The older `customer_email` parameter still works.
|
|
205
205
|
|
|
206
|
+
The customer also comes back with what VeliraPay works out from the IP address, which you cannot send: `ipCountry`, the country the hosted checkout placed it in, as an ISO 3166 two-letter code or `'T1'` for Tor (`null` for a charge created through the API), and `ipAsn` and `ipNetwork`, the number of the network it belongs to and who runs it, such as `24940` and `'Hetzner Online GmbH'`. A customer on a hosting company's network is often a bot or someone hiding behind a server, and a country that differs from the one they gave is worth a second look.
|
|
207
|
+
|
|
206
208
|
### Network surcharges
|
|
207
209
|
|
|
208
210
|
Passing a payment on costs the same whatever its size on some networks, so the customer pays that part: a charge in USDT on Tron (`Asset.USDT_TRON`) asks for 2.50 USDT on top of the price. The coin says so before it is chosen, as `coin.networkSurcharge` from `assets.list()`, so tell the customer; the checkout does. A charge counts it in `assetAmount` and gives it again as `charge.networkSurcharge`, which is `null` for every coin without one. VeliraPay keeps it: it is not part of your payout, and a refund can never include it.
|
package/dist/cjs/client.d.ts
CHANGED
|
@@ -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.
|
|
39
|
+
static readonly VERSION = "0.2.2";
|
|
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. */
|
|
@@ -112,6 +112,12 @@ export declare class Customer extends ApiResource {
|
|
|
112
112
|
readonly name: string | null;
|
|
113
113
|
/** The IP address the customer paid from, recorded by the checkout or passed when the charge was created. */
|
|
114
114
|
readonly ipAddress: string | null;
|
|
115
|
+
/** The country the hosted checkout placed the IP address in, as an ISO 3166 two-letter code, or T1 for Tor; null for a charge created through the API. */
|
|
116
|
+
readonly ipCountry: string | null;
|
|
117
|
+
/** The number of the network (autonomous system) the IP address belongs to, such as 24940. */
|
|
118
|
+
readonly ipAsn: number | null;
|
|
119
|
+
/** Who runs that network, such as an internet provider or a hosting company. */
|
|
120
|
+
readonly ipNetwork: string | null;
|
|
115
121
|
/** The user agent of the browser the customer paid from. */
|
|
116
122
|
readonly userAgent: string | null;
|
|
117
123
|
/** Your own id for the customer. */
|
|
@@ -153,6 +153,12 @@ class Customer extends api_resource_ts_1.ApiResource {
|
|
|
153
153
|
name;
|
|
154
154
|
/** The IP address the customer paid from, recorded by the checkout or passed when the charge was created. */
|
|
155
155
|
ipAddress;
|
|
156
|
+
/** The country the hosted checkout placed the IP address in, as an ISO 3166 two-letter code, or T1 for Tor; null for a charge created through the API. */
|
|
157
|
+
ipCountry;
|
|
158
|
+
/** The number of the network (autonomous system) the IP address belongs to, such as 24940. */
|
|
159
|
+
ipAsn;
|
|
160
|
+
/** Who runs that network, such as an internet provider or a hosting company. */
|
|
161
|
+
ipNetwork;
|
|
156
162
|
/** The user agent of the browser the customer paid from. */
|
|
157
163
|
userAgent;
|
|
158
164
|
/** Your own id for the customer. */
|
|
@@ -168,6 +174,9 @@ class Customer extends api_resource_ts_1.ApiResource {
|
|
|
168
174
|
this.email = (0, api_resource_ts_1.nullableString)(attributes, 'email');
|
|
169
175
|
this.name = (0, api_resource_ts_1.nullableString)(attributes, 'name');
|
|
170
176
|
this.ipAddress = (0, api_resource_ts_1.nullableString)(attributes, 'ip_address');
|
|
177
|
+
this.ipCountry = (0, api_resource_ts_1.nullableString)(attributes, 'ip_country');
|
|
178
|
+
this.ipAsn = (0, api_resource_ts_1.nullableInt)(attributes, 'ip_asn');
|
|
179
|
+
this.ipNetwork = (0, api_resource_ts_1.nullableString)(attributes, 'ip_network');
|
|
171
180
|
this.userAgent = (0, api_resource_ts_1.nullableString)(attributes, 'user_agent');
|
|
172
181
|
this.reference = (0, api_resource_ts_1.nullableString)(attributes, 'reference');
|
|
173
182
|
this.phone = (0, api_resource_ts_1.nullableString)(attributes, 'phone');
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of this library. */
|
|
2
|
-
export declare const VERSION = "0.2.
|
|
2
|
+
export declare const VERSION = "0.2.2";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/client.d.ts
CHANGED
|
@@ -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.
|
|
39
|
+
static readonly VERSION = "0.2.2";
|
|
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. */
|
|
@@ -112,6 +112,12 @@ export declare class Customer extends ApiResource {
|
|
|
112
112
|
readonly name: string | null;
|
|
113
113
|
/** The IP address the customer paid from, recorded by the checkout or passed when the charge was created. */
|
|
114
114
|
readonly ipAddress: string | null;
|
|
115
|
+
/** The country the hosted checkout placed the IP address in, as an ISO 3166 two-letter code, or T1 for Tor; null for a charge created through the API. */
|
|
116
|
+
readonly ipCountry: string | null;
|
|
117
|
+
/** The number of the network (autonomous system) the IP address belongs to, such as 24940. */
|
|
118
|
+
readonly ipAsn: number | null;
|
|
119
|
+
/** Who runs that network, such as an internet provider or a hosting company. */
|
|
120
|
+
readonly ipNetwork: string | null;
|
|
115
121
|
/** The user agent of the browser the customer paid from. */
|
|
116
122
|
readonly userAgent: string | null;
|
|
117
123
|
/** Your own id for the customer. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChargeStatus } from '../enums.js';
|
|
2
|
-
import { ApiResource, bool, date, int, map, nullableString, objects, records, reference, string } from './api-resource.js';
|
|
2
|
+
import { ApiResource, bool, date, int, map, nullableInt, nullableString, objects, records, reference, string } from './api-resource.js';
|
|
3
3
|
/** A single payment in one coin, with the rate locked and a deposit address of its own. */
|
|
4
4
|
export class Charge extends ApiResource {
|
|
5
5
|
/** The charge's public code, also the last segment of its checkout URL. */
|
|
@@ -149,6 +149,12 @@ export class Customer extends ApiResource {
|
|
|
149
149
|
name;
|
|
150
150
|
/** The IP address the customer paid from, recorded by the checkout or passed when the charge was created. */
|
|
151
151
|
ipAddress;
|
|
152
|
+
/** The country the hosted checkout placed the IP address in, as an ISO 3166 two-letter code, or T1 for Tor; null for a charge created through the API. */
|
|
153
|
+
ipCountry;
|
|
154
|
+
/** The number of the network (autonomous system) the IP address belongs to, such as 24940. */
|
|
155
|
+
ipAsn;
|
|
156
|
+
/** Who runs that network, such as an internet provider or a hosting company. */
|
|
157
|
+
ipNetwork;
|
|
152
158
|
/** The user agent of the browser the customer paid from. */
|
|
153
159
|
userAgent;
|
|
154
160
|
/** Your own id for the customer. */
|
|
@@ -164,6 +170,9 @@ export class Customer extends ApiResource {
|
|
|
164
170
|
this.email = nullableString(attributes, 'email');
|
|
165
171
|
this.name = nullableString(attributes, 'name');
|
|
166
172
|
this.ipAddress = nullableString(attributes, 'ip_address');
|
|
173
|
+
this.ipCountry = nullableString(attributes, 'ip_country');
|
|
174
|
+
this.ipAsn = nullableInt(attributes, 'ip_asn');
|
|
175
|
+
this.ipNetwork = nullableString(attributes, 'ip_network');
|
|
167
176
|
this.userAgent = nullableString(attributes, 'user_agent');
|
|
168
177
|
this.reference = nullableString(attributes, 'reference');
|
|
169
178
|
this.phone = nullableString(attributes, 'phone');
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of this library. */
|
|
2
|
-
export declare const VERSION = "0.2.
|
|
2
|
+
export declare const VERSION = "0.2.2";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of this library. */
|
|
2
|
-
export const VERSION = '0.2.
|
|
2
|
+
export const VERSION = '0.2.2';
|
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.
|
|
4
|
+
"version": "0.2.2",
|
|
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",
|