diff --git a/src/iden3comm/handlers/payment.ts b/src/iden3comm/handlers/payment.ts index dc2f8d10..cda276dd 100644 --- a/src/iden3comm/handlers/payment.ts +++ b/src/iden3comm/handlers/payment.ts @@ -94,7 +94,7 @@ export async function verifyEIP712TypedData( ? { recipient: data.recipient, amount: convertedAmount, - expirationDate: data.expirationDate, + expirationDate: getUnixTimestamp(new Date(data.expirationDate)), nonce: data.nonce, metadata: '0x' } @@ -102,7 +102,7 @@ export async function verifyEIP712TypedData( tokenAddress: data.tokenAddress, recipient: data.recipient, amount: convertedAmount, - expirationDate: data.expirationDate, + expirationDate: getUnixTimestamp(new Date(data.expirationDate)), nonce: data.nonce, metadata: '0x' }; @@ -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 diff --git a/tests/handlers/payment.test.ts b/tests/handlers/payment.test.ts index 656b8dde..6dda37c1 100644 --- a/tests/handlers/payment.test.ts +++ b/tests/handlers/payment.test.ts @@ -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: [ @@ -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: [