diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-31 00:34:31 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-31 00:34:31 +0530 |
commit | 119c1c708f9922e3e92ff592dcf08a1bd4f2f2e4 (patch) | |
tree | 5c00e984ca11d0a22f0c8b34ceaa9f92a942ed1d /src/operations | |
parent | b51932cc85287a04dca13cbb3e4d12c5b98e9c47 (diff) |
respond with contract terms as JSON (instead of string) in the wallet APIv0.7.1-dev.16
Diffstat (limited to 'src/operations')
-rw-r--r-- | src/operations/pay.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/operations/pay.ts b/src/operations/pay.ts index 4a8c2144f..9cbda5ba5 100644 --- a/src/operations/pay.ts +++ b/src/operations/pay.ts @@ -924,7 +924,7 @@ export async function preparePayForUri( logger.info("not confirming payment, insufficient coins"); return { status: PreparePayResultType.InsufficientBalance, - contractTerms: d.contractTermsRaw, + contractTerms: JSON.parse(d.contractTermsRaw), proposalId: proposal.proposalId, }; } @@ -935,7 +935,7 @@ export async function preparePayForUri( return { status: PreparePayResultType.PaymentPossible, - contractTerms: d.contractTermsRaw, + contractTerms: JSON.parse(d.contractTermsRaw), proposalId: proposal.proposalId, amountEffective: Amounts.stringify(costInfo.totalCost), amountRaw: Amounts.stringify(res.paymentAmount), @@ -957,20 +957,20 @@ export async function preparePayForUri( const r = await submitPay(ws, proposalId); return { status: PreparePayResultType.AlreadyConfirmed, - contractTerms: purchase.contractTermsRaw, + contractTerms: JSON.parse(purchase.contractTermsRaw), paid: true, nextUrl: r.nextUrl, }; } else if (!purchase.timestampFirstSuccessfulPay) { return { status: PreparePayResultType.AlreadyConfirmed, - contractTerms: purchase.contractTermsRaw, + contractTerms: JSON.parse(purchase.contractTermsRaw), paid: false, }; } else if (purchase.paymentSubmitPending) { return { status: PreparePayResultType.AlreadyConfirmed, - contractTerms: purchase.contractTermsRaw, + contractTerms: JSON.parse(purchase.contractTermsRaw), paid: false, }; } |