This question has been flagged
1 Reply
1886 Views

Hello everyone,

Under transfer payment acquirer one have the "Thanks Message" (post_msg field).

This is usually pre-filled with the predefined message to be shown on customer checkout on eCommerce.

I need to "capture/inherit" this post_msg field live during checkout process to add some live computed value to be shown when user payment acquirer is 'transfer'.

Unfortunately I am unable to find the method/code I need to inherit in order to achieve this.

The first solution I am looking for is a way to capture this message live and inherit it to pass the desired values.

Another solution is a way to include some python code on the "Thanks message" field.

Can anyone help please?

Thank you all in advance

Best regards

PM




Avatar
Discard
Author Best Answer

Hi found it.

I was looking for the solution on the python files but in fact it is on the xml.

Under "website_sale" we have the template "payment_confirmation_status".

I simple inherited:

    <div t-if="payment_tx_id.acquirer_id.post_msg" t-att-class="'card-body %s' % (
                    (payment_tx_id.state == 'pending' and 'bg-info-light') or
                    (payment_tx_id.state == 'done' and 'bg-success-light') or
                    (payment_tx_id.state == 'authorized' and 'bg-success-light') or
                    'bg-danger-light')">
                    <t t-raw="payment_tx_id.acquirer_id.post_msg" />
                    <div t-if="payment_tx_id.acquirer_id.provider == 'transfer' and order.reference">
                        <b>Communication: </b><span t-esc='order.reference'/>
                  </div>
     </div>

...and added my own code here.

Thank you

Best regards


Avatar
Discard