Skip to content

Commit

Permalink
expirationDate - ISO format
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Dec 2, 2024
1 parent f47c4d6 commit 1d5fd94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/iden3comm/handlers/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ export async function verifyEIP712TypedData(
? {
recipient: data.recipient,
amount: convertedAmount,
expirationDate: data.expirationDate,
expirationDate: getUnixTimestamp(new Date(data.expirationDate)),
nonce: data.nonce,
metadata: '0x'
}
: {
tokenAddress: data.tokenAddress,
recipient: data.recipient,
amount: convertedAmount,
expirationDate: data.expirationDate,
expirationDate: getUnixTimestamp(new Date(data.expirationDate)),
nonce: data.nonce,
metadata: '0x'
};
Expand Down Expand Up @@ -603,7 +603,7 @@ export class PaymentHandler
recipient,
amount: amount.toString(),
currency,
expirationDate: getUnixTimestamp(expirationDateRequired).toString(),
expirationDate: expirationDateRequired.toISOString(),
nonce: nonce.toString(),
metadata: '0x',
proof
Expand Down
4 changes: 2 additions & 2 deletions tests/handlers/payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ describe('payment-request handler', () => {
recipient: '0xE9D7fCDf32dF4772A7EF7C24c76aB40E4A42274a',
amount: '0.00003',
currency: SupportedCurrencies.ETH_GWEI,
expirationDate: '2362135500',
expirationDate: '2044-11-07T12:45:00.000Z',
nonce: '411390',
metadata: '0x',
proof: [
Expand Down Expand Up @@ -513,7 +513,7 @@ describe('payment-request handler', () => {
recipient: '0xE9D7fCDf32dF4772A7EF7C24c76aB40E4A42274a',
amount: '0.00003',
currency: 'USDT',
expirationDate: '2362135500',
expirationDate: '2044-11-07T12:45:00.000Z',
nonce: '411390',
metadata: '0x',
proof: [
Expand Down

0 comments on commit 1d5fd94

Please sign in to comment.