Skip to content

Commit

Permalink
resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Nov 1, 2024
1 parent 119ad86 commit ca73277
Showing 1 changed file with 16 additions and 30 deletions.
46 changes: 16 additions & 30 deletions src/iden3comm/handlers/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,38 +482,24 @@ export class PaymentHandler
}
];

const d: Iden3PaymentRailsRequestV1 = {
type: PaymentRequestDataType.Iden3PaymentRailsRequestV1,
'@context': [
`https://schema.iden3.io/core/jsonld/payment.jsonld#${type}`,
'https://w3id.org/security/suites/eip712sig-2021/v1'
],
recipient,
amount: amount.toString(),
currency,
expirationDate: new Date(expiration).toISOString(),
nonce: nonce.toString(),
metadata: '0x',
proof
};
dataArr.push(
type === PaymentRequestDataType.Iden3PaymentRailsRequestV1
? {
type,
'@context': [
`https://schema.iden3.io/core/jsonld/payment.jsonld#${type}`,
'https://w3id.org/security/suites/eip712sig-2021/v1'
],
recipient,
amount: amount.toString(),
currency,
expirationDate: expiration,
nonce: nonce.toString(),
metadata: '0x',
proof
}
: {
type,
'@context': [
`https://schema.iden3.io/core/jsonld/payment.jsonld#${type}`,
'https://w3id.org/security/suites/eip712sig-2021/v1'
],
features: features || [],
tokenAddress: tokenAddress || '',
recipient,
amount: amount.toString(),
currency,
expirationDate: expiration,
nonce: nonce.toString(),
metadata: '0x',
proof
}
? d
: { ...d, type, tokenAddress: tokenAddress || '', features: features || [] }
);
}
paymentRequestInfo.push({
Expand Down

0 comments on commit ca73277

Please sign in to comment.