diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/import.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay.ts | 23 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/import.ts b/packages/taler-wallet-core/src/operations/backup/import.ts index e4eaf8913..e099fae57 100644 --- a/packages/taler-wallet-core/src/operations/backup/import.ts +++ b/packages/taler-wallet-core/src/operations/backup/import.ts @@ -600,6 +600,8 @@ export async function importBackup( merchant: parsedContractTerms.merchant, products: parsedContractTerms.products, summaryI18n: parsedContractTerms.summary_i18n, + deliveryDate: parsedContractTerms.delivery_date, + deliveryLocation: parsedContractTerms.delivery_location, }, contractTermsRaw: backupProposal.contract_terms_raw, }; @@ -740,6 +742,8 @@ export async function importBackup( merchant: parsedContractTerms.merchant, products: parsedContractTerms.products, summaryI18n: parsedContractTerms.summary_i18n, + deliveryDate: parsedContractTerms.delivery_date, + deliveryLocation: parsedContractTerms.delivery_location, }, contractTermsRaw: backupPurchase.contract_terms_raw, }; diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts index 55b8f513d..d41a20e71 100644 --- a/packages/taler-wallet-core/src/operations/pay.ts +++ b/packages/taler-wallet-core/src/operations/pay.ts @@ -662,6 +662,8 @@ export function extractContractData( products: parsedContractTerms.products, summaryI18n: parsedContractTerms.summary_i18n, minimumAge: parsedContractTerms.minimum_age, + deliveryDate: parsedContractTerms.delivery_date, + deliveryLocation: parsedContractTerms.delivery_location, }; } @@ -1318,6 +1320,27 @@ export async function checkPaymentByProposalId( } } +export async function getContractTermsDetails( + ws: InternalWalletState, + proposalId: string, +): Promise<WalletContractData> { + const proposal = await ws.db + .mktx((x) => ({ proposals: x.proposals })) + .runReadOnly(async (tx) => { + return tx.proposals.get(proposalId); + }); + + if (!proposal) { + throw Error(`proposal with id ${proposalId} not found`); + } + + if (!proposal.download || !proposal.download.contractData) { + throw Error("proposal is in invalid state"); + } + + return proposal.download.contractData +} + /** * Check if a payment for the given taler://pay/ URI is possible. * diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 1ac2bd042..ebc223b23 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -448,6 +448,9 @@ export async function getTransactions( tipRecord.walletTipId, ), merchantBaseUrl: tipRecord.merchantBaseUrl, + // merchant: { + // name: tipRecord.merchantBaseUrl, + // }, error: tipRecord.lastError, }); }); |