@@ -106,7 +106,7 @@ describe('payment-request handler', () => {
106
106
if ( data . currency !== SupportedCurrencies . ETH ) {
107
107
throw new Error ( 'integration can only pay in eth currency' ) ;
108
108
}
109
- const options = { value : ethers . formatUnits ( data . amount , 'ether' ) } ;
109
+ const options = { value : ethers . parseUnits ( data . amount , 'ether' ) } ;
110
110
const txData = await payContract . pay ( sessionId , did , options ) ;
111
111
return txData . hash ;
112
112
} ;
@@ -117,7 +117,7 @@ describe('payment-request handler', () => {
117
117
) : Promise < void > => {
118
118
const rpcProvider = new JsonRpcProvider ( RPC_URL ) ;
119
119
const tx = await rpcProvider . getTransaction ( txId ) ;
120
- if ( tx ?. value !== BigInt ( data . amount ) ) {
120
+ if ( tx ?. value !== ethers . parseUnits ( data . amount , 'ether' ) ) {
121
121
throw new Error ( 'invalid value' ) ;
122
122
}
123
123
} ;
@@ -132,11 +132,11 @@ describe('payment-request handler', () => {
132
132
type : PaymentRequestType . PaymentRequest ,
133
133
data : {
134
134
type : PaymentRequestDataType . Iden3PaymentRequestCryptoV1 ,
135
- amount : '0.1 ' ,
135
+ amount : '0.001 ' ,
136
136
id : 12432 ,
137
137
chainId : 80002 ,
138
138
address : '0x2C2007d72f533FfD409F0D9f515983e95bF14992' ,
139
- currency : 'eth '
139
+ currency : 'ETH '
140
140
} ,
141
141
expiration : '2125558127' ,
142
142
description : 'payment-request integration test'
0 commit comments