Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt webhook #5

Merged
merged 4 commits into from
May 10, 2021
Merged

Attempt webhook #5

merged 4 commits into from
May 10, 2021

Conversation

guus-frenken
Copy link
Contributor

No description provided.

guus-frenken added 4 commits May 4, 2021 22:07
- Switched from thephpleague/omnipay-mollie to mollie/mollie-api-php
- Created a webhook that Mollie will call when a payment status change occurs

Issues:
For some reason, sometimes at line 114, changePaymentState is unable to locate the order using the Mollie payment id that was sent to the webhook, causing $order to be null and being unable to create a new PaymentResult instance on line 119.
- Changed plugin name to better reflect it's purpose
- Re-added missing composer.json content
- Removed obsolete
- Added ability to change order status to 'canceled' when the Mollie payment is canceled.

Issues:
- Using $this->order->total_in_currency for the payment amount does not work when the total amount is a round number like 200 because the Mollie API expects "200.00". Need to find a safe and reliable way to convert this.
- The plugin now has the ability to specify a Mollie payment method when creating a payment. When creating a payment method in the "Mall: Payments" section of the settings, make sure that the "Code" field matches a [Mollie payment method](https://docs.mollie.com/reference/v2/payments-api/create-payment). When checking out an order, the plugin will check if the selected payment method is active in the Mollie account using the API. if the payment method is not active or otherwise invalid, the user will be redirected to the Mollie Checkout page that shows all possible payment methods.
- Fixed formatting for the amount > value field using ``` number_format() ``` I believe this is safe because the ``` $this->order->total_in_currency ``` variable is always a float.
@guus-frenken guus-frenken merged commit 11e03a2 into main May 10, 2021
@guus-frenken guus-frenken linked an issue May 11, 2021 that may be closed by this pull request
@guus-frenken guus-frenken deleted the attempt-webhook branch September 30, 2021 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Payment status other than "paid" refreshes the Mollie page
1 participant