-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,72 @@ public void testGetLnurlpResponse_umaV0() throws Exception { | |
new InMemoryNonceCache(1L))); | ||
} | ||
|
||
@Test | ||
public void testGetPayRequest_umaV1() throws Exception { | ||
PayRequest request = umaProtocolHelper.getPayRequest( | ||
publicKeyBytes(), | ||
privateKeyBytes(), | ||
"USD", | ||
100L, | ||
true, | ||
"[email protected]", | ||
KycStatus.VERIFIED, | ||
"", | ||
null, | ||
null, | ||
null, | ||
"payerName", | ||
"payerEmail", | ||
null, | ||
null, | ||
"comment", | ||
"1.0" | ||
); | ||
assertNotNull(request); | ||
System.out.println(request); | ||
assertTrue(request instanceof PayRequestV1); | ||
assertTrue(umaProtocolHelper.verifyPayReqSignature( | ||
request, new PubKeyResponse(publicKeyBytes(), publicKeyBytes()), | ||
new InMemoryNonceCache(1L))); | ||
String requestJson = request.toJson(); | ||
PayRequest parsedRequest = umaProtocolHelper.parseAsPayRequest(requestJson); | ||
assertNotNull(parsedRequest); | ||
assertEquals(request, parsedRequest); | ||
} | ||
|
||
@Test | ||
public void testGetPayRequest_umaV0() throws Exception { | ||
PayRequest request = umaProtocolHelper.getPayRequest( | ||
publicKeyBytes(), | ||
privateKeyBytes(), | ||
"USD", | ||
100L, | ||
true, | ||
"[email protected]", | ||
KycStatus.VERIFIED, | ||
"", | ||
null, | ||
null, | ||
null, | ||
"payerName", | ||
"payerEmail", | ||
null, | ||
null, | ||
"comment", | ||
"0.3" | ||
); | ||
assertNotNull(request); | ||
System.out.println(request); | ||
assertTrue(request instanceof PayRequestV0); | ||
assertTrue(umaProtocolHelper.verifyPayReqSignature( | ||
request, new PubKeyResponse(publicKeyBytes(), publicKeyBytes()), | ||
new InMemoryNonceCache(1L))); | ||
String requestJson = request.toJson(); | ||
PayRequest parsedRequest = umaProtocolHelper.parseAsPayRequest(requestJson); | ||
assertNotNull(parsedRequest); | ||
assertEquals(request, parsedRequest); | ||
} | ||
|
||
@Test | ||
public void testGetPayReqResponseSync_umaV1() throws Exception { | ||
PayRequest request = umaProtocolHelper.getPayRequest( | ||
|