Skip to content

Commit

Permalink
Merge pull request #6 from bchainhub/update/readme-01
Browse files Browse the repository at this point in the history
Readme
  • Loading branch information
rastislavcore authored Jan 22, 2025
2 parents 9b98286 + 44d9a05 commit 3338c7a
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ payto.value = 20.02;
console.log(payto.amount); // 'ctn:20.02'
console.log(payto.fiat); // 'eur'

// ACH payment examples
const achPayto1 = new Payto('payto://ach/123456789/1234567'); // With routing number
console.log(achPayto1.routingNumber); // 123456789
console.log(achPayto1.accountNumber); // 1234567

const achPayto2 = new Payto('payto://ach/1234567'); // Account number only
console.log(achPayto2.accountNumber); // 1234567

// UPI/PIX payment examples
const upiPayto = new Payto('payto://upi/user@example.com');
console.log(upiPayto.accountAlias); // 'user@example.com'

const pixPayto = new Payto('payto://pix/user@example.com');
console.log(pixPayto.accountAlias); // 'user@example.com'

// Geo location example
const geoPayto = new Payto('payto://void/geo');
geoPayto.location = '51.5074,0.1278'; // Valid coordinates
Expand Down Expand Up @@ -70,7 +85,8 @@ Creates a new Payto instance from a payto URL string.

| Property | Type | Description |
|----------|------|-------------|
| `accountNumber` | `number \| null` | Account number (7-14 digits) |
| `accountAlias` | `string \| null` | Email address for UPI/PIX payments |
| `accountNumber` | `number \| null` | Account number (7-14 digits) for ACH payments |
| `address` | `string \| null` | Payment address |
| `amount` | `string \| null` | Payment amount with currency |
| `asset` | `string \| null` | Asset type or contract address |
Expand Down Expand Up @@ -124,11 +140,24 @@ The library includes TypeScript type definitions and runtime validation for:
- Bank Identifier Codes (BIC)
- Routing numbers (9 digits)
- Account numbers (7-14 digits)
- Email addresses (for UPI/PIX)
- Geographic coordinates
- Plus codes
- Unix timestamps
- Barcode formats

## Payment System Support

### ACH Payments
Supports two formats:
- `payto://ach/routing/account` (with routing number)
- `payto://ach/account` (account number only)

### UPI/PIX Payments
Email-based payment identifiers:
- `payto://upi/email@example.com`
- `payto://pix/email@example.com`

## License

This project is licensed under the CORE License - see the [LICENSE](LICENSE) file for details.
Expand Down

0 comments on commit 3338c7a

Please sign in to comment.