VivaPayments / API

Index of Viva Wallet open source projects on GitHub.
139 stars 163 forks source link

Fixed a bug in model/controller. #2477

Open Charisn opened 8 months ago

Charisn commented 8 months ago

Issue with Zero Price: When a discount is applied to an order, and the final price becomes zero, the Viva payment system responds with an HTTP error 500. This issue occurs because Viva does not handle transactions with a zero amount correctly.

Database Column Name Change: In the database model, the column originally named vivawallet_total was renamed to payment_vivawallet_total. This change was made to ensure consistency and to match the actual column name used in the database.

Controller Modification for Checkout Process: An additional 'if' statement was added to the controller code. This modification was added for scenarios like one-page checkout processes, where the sequence of loading various components might differ from what the Viva extension originally expected. This change helps to avoid issues by ensuring that the payment process is only initiated when appropriate, especially in cases where the order amount might be zero due to discounts or other factors.