Skip to content

Commit

Permalink
[FIX] payment: stop using the term "payment" when tokenizing
Browse files Browse the repository at this point in the history
All the messages on the "Payment Status" page were using the term
"payment". This could cause confusion in users when saving payment
methods, as a "payment" related message will appear even that no
payment related transaction is ocurring.

After this commit messages will use the more generic term "operation",
aiding in consistency and as a bonus avoiding confusion in users.

Task - 3050181

closes odoo#111868

X-original-commit: 14b5bc6
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
  • Loading branch information
hote-odoo authored and AntoineVDV committed Feb 3, 2023
1 parent fb8765b commit 9e997c7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
2 changes: 2 additions & 0 deletions addons/payment/models/payment_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ def _get_post_processing_values(self):
- `state`: The transaction state: `draft`, `pending`, `authorized`, `done`, `cancel`, or
`error`.
- `state_message`: The information message about the state.
- `operation`: The operation of the transaction.
- `is_post_processed`: Whether the transaction has already been post-processed.
- `landing_route`: The route the user is redirected to after the transaction.
- Additional provider-specific entries.
Expand All @@ -836,6 +837,7 @@ def _get_post_processing_values(self):
'currency_code': self.currency_id.name,
'state': self.state,
'state_message': self.state_message,
'operation': self.operation,
'is_post_processed': self.is_post_processed,
'landing_route': self.landing_route,
}
Expand Down
30 changes: 21 additions & 9 deletions addons/payment/static/src/xml/payment_post_processing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div>
<!-- Error transactions -->
<div t-if="tx_error.length > 0">
<h1>Payments failed</h1>
<h1>Failed operations</h1>
<ul class="list-group">
<t t-foreach="tx_error" t-as="tx">
<a t-att-href="tx['landing_route']" class="list-group-item">
Expand All @@ -22,8 +22,9 @@
</t>
</ul>
</div>
<!-- Pending/Authorized/Confirmed transactions -->
<div t-if="tx_done.length > 0 || tx_authorized.length > 0 || tx_pending.length > 0">
<h1>Payments received</h1>
<h1>Operations in progress</h1>
<div class="list-group">
<!-- Done transactions -->
<t t-foreach="tx_done" t-as="tx">
Expand All @@ -34,11 +35,22 @@
</h4>
<small class="list-group-item-text">
<t t-if="!tx['is_post_processed']">
Your order is being processed, please wait ... <i class="fa fa-cog fa-spin"/>
<t t-if="tx['operation'] != 'validation'">
Your payment is being processed, please wait... <i class="fa fa-cog fa-spin"/>
</t>
<t t-else="">
Saving your payment method, please wait... <i class="fa fa-cog fa-spin"/>
</t>
</t>
<t t-else="">
Your order has been processed.<br/>
Click here to be redirected to the confirmation page.
<t t-if="tx['operation'] != 'validation'">
Your payment has been processed.<br/>
Click here to be redirected to the confirmation page.
</t>
<t t-else="">
Your payment method has been saved.<br/>
Click here to be redirected to the confirmation page.
</t>
</t>
</small>
</a>
Expand All @@ -59,7 +71,7 @@
<t t-else="">
Your payment is in pending state.<br/>
You will be notified when the payment is fully confirmed.<br/>
You can click here to be redirected to the confirmation page.
Click here to be redirected to the confirmation page.
</t>
</small>
</a>
Expand Down Expand Up @@ -88,7 +100,7 @@
</div>
<!-- Draft transactions -->
<div t-if="tx_draft.length > 0">
<h1>Waiting for payment</h1>
<h1>Waiting for operations to process</h1>
<ul class="list-group">
<t t-foreach="tx_draft" t-as="tx">
<a t-att-href="tx['landing_route']" class="list-group-item">
Expand All @@ -112,7 +124,7 @@
</div>
<!-- Cancel transactions -->
<div t-if="tx_cancel.length > 0">
<h1>Cancelled payments</h1>
<h1>Canceled operations</h1>
<ul class="list-group">
<t t-foreach="tx_cancel" t-as="tx">
<a t-att-href="tx['landing_route']" class="list-group-item">
Expand All @@ -121,7 +133,7 @@
<span class="badge float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span>
</h4>
<small class="list-group-item-text">
This transaction has been cancelled.<br/>
This payment has been canceled.<br/>
No payment has been processed.
</small>
</a>
Expand Down

0 comments on commit 9e997c7

Please sign in to comment.