@paybyrd/devagent-test-js 2.1.0-alpha.13 → 2.1.0-alpha.15

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
@@ -11,13 +11,10 @@ Used by `devagent-test-service` (Azure DevOps): `web/` (npm) and `widget/` (Yarn
11
11
 
12
12
  Build and test: `npm ci && npm test`.
13
13
 
14
- ## Demo page
14
+ ## Demo
15
15
 
16
- `demo/index.html` validates a payment with the built SDK (`dist/`). It is not part of the npm package.
16
+ `demo/` is a static page that runs `validatePayment` from the built `dist/` (it is not published in the npm package):
17
17
 
18
- ```sh
19
- npm ci && npm run build
20
- python3 -m http.server # from the repository root
21
- ```
22
-
23
- Then open http://localhost:8000/demo/.
18
+ 1. `npm ci && npm run build`
19
+ 2. From the repository root: `python3 -m http.server`
20
+ 3. Open http://localhost:8000/demo/
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export interface PaymentRequest {
2
2
  amount: number;
3
3
  reference: string;
4
- currency?: string | null;
4
+ currency?: string;
5
5
  }
6
6
  export interface ValidationResult {
7
7
  valid: boolean;
package/dist/index.js CHANGED
@@ -13,9 +13,8 @@ function validatePayment(request) {
13
13
  else if (request.reference.length > 50) {
14
14
  errors.push("reference must be at most 50 characters");
15
15
  }
16
- // null (JSON payloads, plain JS callers) means "no currency", like undefined
17
16
  if (request.currency != null && !SUPPORTED_CURRENCIES.includes(request.currency)) {
18
- errors.push(`currency must be one of ${SUPPORTED_CURRENCIES.join(", ")}`);
17
+ errors.push("currency must be one of EUR, USD, GBP");
19
18
  }
20
19
  return { valid: errors.length === 0, errors };
21
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paybyrd/devagent-test-js",
3
- "version": "2.1.0-alpha.13",
3
+ "version": "2.1.0-alpha.15",
4
4
  "description": "Test package for the Paybyrd dev agent sandbox. Not for use: it has no real functionality.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "license": "UNLICENSED",
15
15
  "devDependencies": {
16
+ "jsdom": "26.1.0",
16
17
  "typescript": "5.6.3"
17
18
  }
18
19
  }