lineitem smarty variable mismatch in thankyou page
We recently got this issue while testing Agileware's eWay payment processor.
After submitting a contribution, the line items are trying to get line item details from a string instead of an array. This does not happen with other processors, and is not a problem when an explicit price set is used.
To reproduce this issue, you will need to have the eWay payment processor or a payment processor with
billing_mode = 4 and call
Contribution.completetransaction during the thankyou page.
- Open a contribution page, like https://domain/civicrm/contribute/transact?reset=1&id=1
- Use the mentioned payment processor to complete the form
- Comfirm and go to thankyou page
The thankyou page shows broken information.
The smarty variable
Array (  => Array ( [qty] => 1 [label] => Booster [unit_price] => 10.00 [line_total] => 10.00 [price_field_id] => 2 [participant_count] => 0 [price_field_value_id] => 4 [field_title] => Contribution Amount [html_type] => Radio [description] => [entity_id] => 225 [entity_table] => civicrm_contribution [contribution_id] => 225 [financial_type_id] => 1 [financial_type] => Donation [membership_type_id] => [membership_num_terms] => [tax_amount] => [price_set_id] => 3 [tax_rate] => [subTotal] => 10 ) )
The thankyou page should show the total amount only. It should not show the lineitem table at all in this case.
However, for lineitem, the expected smarty variable based on the template is:
Array (  => Array (  => Array ( [price_field_id] => 2 [price_field_value_id] => 4 [label] => Booster [field_title] => Contribution Amount [description] => [qty] => 1 [unit_price] => 10.000000000 [line_total] => 10 [participant_count] => 0 [max_value] => [membership_type_id] => [membership_num_terms] => [auto_renew] => [html_type] => Radio [financial_type_id] => 1 [tax_amount] => [non_deductible_amount] => 0.00 ) ) )
- CiviCRM: 5.19.3
- PHP: 7.2
- CMS: Drupal 7.30 and WordPress 5.3
I believe this is a core issue because the eWay payment processor does not create the contribution during this workflow. It calls
Contribution.completetransaction when it comes to the thankyou page, and that is the critical action that causes the output.
If this is the expected behaviour for Civi, what should the payment processor do?
Agileware ref: CIVIEWAY-144