add fullfilment url and message if the are present

This commit is contained in:
Sebastian 2023-04-04 10:04:28 -03:00
parent 2ef40efe53
commit 860cd81f35
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
3 changed files with 31 additions and 8 deletions

View File

@ -1284,6 +1284,7 @@ export namespace MerchantBackend {
// will send back to the customer the same proposal. Clearly, this URL
// can be bookmarked and shared by users.
fulfillment_url?: string;
fulfillment_message?: string;
// Maximum total deposit fee accepted by the merchant for this contract
max_fee: Amount;

View File

@ -216,4 +216,12 @@ export const exampleData: { [name: string]: Props } = {
}
},
},
WithFulfillmentURL: {
order_summary: 'this is the order with fulfillmentURL',
contract_terms: {
...defaultContractTerms,
fulfillment_url: "https://demo.taler.net",
fulfillment_message: "Congratulations! You just purchased an valuable item!"
},
},
}

View File

@ -171,10 +171,24 @@ export function ShowOrderDetails({
)}
{btr && `{{/refund_amount}}`}
{btr && `{{#contract_terms.fulfillment_message}}`}
{(btr || contract_terms?.fulfillment_message) && (
<section>
<InfoBox>
<b>{contract_terms?.fulfillment_message || `{{ contract_terms.fulfillment_message }}`}</b>.
</InfoBox>
</section>
)}
{btr && `{{/contract_terms.fulfillment_message}}`}
<section>
<TableExpanded>
<dt>Order summary:</dt>
<dd>{contract_terms?.summary || `{{ contract_terms.summary }}`}</dd>
{btr && `{{#contract_terms.fulfillment_url}}`}
<dt>Fulfillment URL:</dt>
<dd><a href={contract_terms?.fulfillment_url || `{{ contract_terms.fulfillment_url }}`}>{contract_terms?.fulfillment_url || `{{ contract_terms.fulfillment_url }}`}</a></dd>
{btr && `{{/contract_terms.fulfillment_url}}`}
<dt>Amount paid:</dt>
<dd>{contract_terms?.amount || `{{ contract_terms.amount }}`}</dd>
<dt>Order date:</dt>
@ -183,7 +197,7 @@ export function ShowOrderDetails({
? contract_terms?.timestamp.t_s != "never"
? format(
contract_terms?.timestamp.t_s,
"dd MMM yyyy HH:mm:ss"
"dd MMM yyyy HH:mm:ss",
)
: "never"
: `{{ contract_terms.timestamp_str }}`}{" "}
@ -243,7 +257,7 @@ export function ShowOrderDetails({
? p.delivery_date.t_s != "never"
? format(
p.delivery_date.t_s,
"dd MMM yyyy HH:mm:ss"
"dd MMM yyyy HH:mm:ss",
)
: "never"
: `{{ delivery_date_str }}`}{" "}
@ -293,7 +307,7 @@ export function ShowOrderDetails({
? contract_terms?.delivery_date.t_s != "never"
? format(
contract_terms?.delivery_date.t_s,
"dd MMM yyyy HH:mm:ss"
"dd MMM yyyy HH:mm:ss",
)
: "never"
: `{{ contract_terms.delivery_date_str }}`}{" "}
@ -335,7 +349,7 @@ export function ShowOrderDetails({
? contract_terms?.pay_deadline.t_s != "never"
? format(
contract_terms?.pay_deadline.t_s,
"dd MMM yyyy HH:mm:ss"
"dd MMM yyyy HH:mm:ss",
)
: "never"
: `{{ contract_terms.pay_deadline_str }}`}{" "}
@ -346,7 +360,7 @@ export function ShowOrderDetails({
? contract_terms?.wire_transfer_deadline.t_s != "never"
? format(
contract_terms?.wire_transfer_deadline.t_s,
"dd MMM yyyy HH:mm:ss"
"dd MMM yyyy HH:mm:ss",
)
: "never"
: `{{ contract_terms.wire_transfer_deadline_str }}`}{" "}
@ -376,7 +390,7 @@ export function ShowOrderDetails({
? contract_terms?.refund_deadline.t_s != "never"
? format(
contract_terms?.refund_deadline.t_s,
"dd MMM yyyy HH:mm:ss"
"dd MMM yyyy HH:mm:ss",
)
: "never"
: `{{ contract_terms.refund_deadline_str }}`}{" "}
@ -393,7 +407,7 @@ export function ShowOrderDetails({
intervalToDuration({
start: 0,
end: contract_terms?.auto_refund.d_us,
})
}),
)
: "forever"
: `{{ contract_terms.auto_refund_str }}`}{" "}
@ -533,7 +547,7 @@ export function mount(): void {
order_summary={os}
refund_amount={ra}
/>,
document.body
document.body,
);
} catch (e) {
console.error("got error", e);