reepay / reepay-woocommerce-payment Goto Github PK
View Code? Open in Web Editor NEWReepay Woocommerce Payment Plugin
Home Page: https://wordpress.org/plugins/reepay-checkout-gateway/
Reepay Woocommerce Payment Plugin
Home Page: https://wordpress.org/plugins/reepay-checkout-gateway/
The implementation of handling sessions for guest users in pull request: #103 which was released in version: 1.3.1 in woocommerce_init()
in reepay-woocommerce-payment.php
includes the use of session_start()
for all users this is very, very bad for servers using Varnish caching as this sets a cookie for all users upon visiting. The action of setting this cookie on first visit effectively renders Varnish caching useless and significantly increases Time-To-First-Byte (TTFB). Please either remove or rethink the implementation. The culprit is inside this function:
reepay-woocommerce-payment/reepay-woocommerce-payment.php
Lines 160 to 173 in 847b881
We've seen Varnish hits decrease significantly since updating our sites to Reepay version 1.3.1 and our TTFB has increased by an order of magnitude. Our Varnish hit rates have currently decreased by more than 50% and our response times have increased significantly.
We have already implemented a fallback if the plugin experience the error invoice already settled. This fallback function can be activated by enabling Order handle failover in the settings.
Besides this error we also currently experiencing customer already exist and country is not ISO standard. We need similar fallback methods for these errors. E.g. if Reepay response with a customer already exists, create fallback customer cust_1235-1.
What seems to be the problem, once a gift card cupon has been added to the basket the amount is diminished to the correct amount (fx 500kr cupon), when redirected to the reepay payment form the original price is still shown, even though the cupon has been successfully applied.
Site: https://stagpurebasic.wpengine.com/
Video of issue: https://drive.google.com/file/d/1pwUF0gLZveOxQV9_Jl4jKxWjxAbo93WE/view?usp=sharing
The following notices show up in the debug.log when completing and order:
PHP Notice: Undefined index: invoice in /home/merchcit/public_html/wp-content/plugins/reepay-checkout-gateway/includes/class-wc-gateway-reepay-checkout.php on line 669
PHP Notice: Undefined index: transaction in /home/merchcit/public_html/wp-content/plugins/reepay-checkout-gateway/includes/class-wc-gateway-reepay-checkout.php on line 684
Looks like there are some checks that need to be refined.
there are two reasons to not use this function for scheduled functions:
Auto cancellation may cancel an authorized invoice, when webhooks fail to set the state of an order to processing instead of on hold.
The plugin doesn't support the new woocommerce_subscription_payment_meta filter introduced in WooCommerce Subscriptions v2.0. Can be found here: https://github.com/Prospress/woocommerce-subscriptions-importer-exporter#importing-payment-gateway-meta-data
This is important for merchants that would like to move from another payment gateway to Reepay.
If a customer was met by an error when they were redirected to Reepay, we previously showed a notice in the Woocommerce checkout, which contained the error code from Reepay. We do not do that anymore and instead, Woocommerce checkout just stands and loads without anything happening. This is a bug.
We need to show this notice again.
WooCommerce already sets a product to be physical or online. Why not make it even more convenient for merchants, that deal with both physical products, and online products to automatically charge the online products?
The plugin doesn't automatically import your WooCommerce webhook URL to your Reepay test and/or live accounts. In order to automatically import the WooCommerce webhook URL and activate the webhook in Reepay, this API can be used: https://reference.reepay.com/api/#update-webhook-settings
Hi at Repay
The plugin isn't "properly prepared" for translation in the WordPress repository. By preparing your plugin for localization people in the WordPress community around the world are able to translate your plugin for you.
https://translate.wordpress.org/projects/wp-plugins/reepay-checkout-gateway/
https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/
Kind regards
This functions runs 3 times.
LOGS:
05-01-2019 @ 11:18:11 - WC_Gateway_Reepay_Checkout::WC_Gateway_Reepay_Checkout::payment_confirm Incoming data array (
'key' => 'wc_order_RSjlcQMOv53nq',
'id' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
'customer' => 'cust-0009',
'payment_method' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
)
05-01-2019 @ 11:18:12 - WC_Gateway_Reepay_Checkout::WC_Gateway_Reepay_Checkout::payment_confirm Incoming data array (
'key' => 'wc_order_RSjlcQMOv53nq',
'id' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
'customer' => 'cust-0009',
'payment_method' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
)
05-01-2019 @ 11:18:12 - WC_Gateway_Reepay_Checkout::WC_Gateway_Reepay_Checkout::payment_confirm Incoming data array (
'key' => 'wc_order_RSjlcQMOv53nq',
'id' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
'customer' => 'cust-0009',
'payment_method' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
)
In the referenced code an array is being set on the shipping_address
, and right after strlen
is used causing an error.
What is the purpose of the strlen
check?
reepay-woocommerce-payment/includes/abstracts/abstract-wc-gateway-reepay.php
Lines 512 to 532 in 847b881
Deprecated: Non-static method WC_ReepayCheckout::add_footer() should not be called statically in /var/www/html/wp-includes/class-wp-hook.php on line 286
This is currently flooding the logs on a site running PHP 7.2+
PHP Deprecated: Non-static method WC_ReepayCheckout::add_footer() should not be called statically in /home/account/public_html/wp-includes/class-wp-hook.php on line 286
Edit
In reepay-woocommerce-payment.php
on line 51
when calling add_action
with a static
method like this:
add_action( 'wp_footer', __CLASS__ . '::add_footer' );
The function add_footer
on line 122 must be declared as static
Change line 122 from:
public function add_footer() {
To:
public static function add_footer() {
If you deactivate WooCommerce while Reepay Checkout is active, the whole site crashes.
The plugin doesn't give any information about the payment if you are on the WoCommerce order page and see all your orders. You need to go into each order to see the current Reepay order/transaction status.
Merchants have requested to have the following information/options under the order page. See picture for illustration.
There is a race condition between the use of the accept url and the webhook. This sporadically, if the timing is right, results in double authorizations, double notes on orders and double stock reduction calls - which is a nightmare for logistics.
Even though there are checks for a DB value which tries to mitigate this it doesn't prevent the issue (since it's a race condition).
It seems there has been implemented multiple checks, which actually try to verify if a webhook is configured and then only use that. This still doesn't work as intended though. We've verified that our webhook is configured and that the value for this in the database reflects this. When the check is performed it seems that the accept url is still being used however so there must be an issue with reading out the value somewhere.
Adding more logging with regards to what method was used for authorization/refund could help troubleshoot this further.
We have a merchant that is still getting the allready settled error on their invoices. This has been reported before and we need to fix it.
Last time we got the message that:
"It was my mistake, we call the function statically. So the script we ran didn't clean order reference from renewal orders. WooCommerce subscription initially clone orders as renewal orders with metadata saved. So the hook that should remove order reference (of initial order) didn't work. It's fixed now on madstationen.com
I really hope this is the last time they have problems. It's hard because i cannot simulate conditions without cloning their site and that's a lot of job. But I think now it's fixed."
I don't know if it should have been fixed, seems like it is not.
A customer reported the following in their log:
52.18.114.235 - - [25/Apr/2019:00:35:00 +0200] "POST /wc-api/WC_Gateway_Reepay_Checkout/" 500 "-" "reepay-webhook-invoker/864"
52.18.114.235 - - [25/Apr/2019:00:35:00 +0200] "POST /wc-api/WC_Gateway_Reepay_Checkout/" 500 "-" "reepay-webhook-invoker/864"
52.18.114.235 - - [25/Apr/2019:00:35:00 +0200] "POST /wc-api/WC_Gateway_Reepay_Checkout/" 500 "-" "reepay-webhook-invoker/864"
Even if wordpress does not need the webhook event for anything it is important the server still reponse with a 200 ok.
The file class-wc-reepay-update.php seems to be missing from the version 1.1.8 release.
This issue results in the database not being able to update and the notice hanging in the admin panel indefinitely.
Entry from debug.log:
PHP Fatal error: Uncaught Error: Class 'WC_Reepay_Update' not found in /home/account/public_html/wp-content/plugins/reepay-checkout-gateway/reepay-woocommerce-payment.php:353
Since updating to Reepay v.1.4.4 we are getting double orders for every order placed by the customer.
There seems to be an issue where and order is created and the first time an invoice is requested from the Reepay API the response returned is a 404 Not Found for that order. Just after this a new order is created and another request to the Reepay API is sent for this invoice - this returns a 200 OK.
Se log trace:
08-31-2021 @ 14:06:39 - Request: GET https://api.reepay.com/v1/invoice/order-MC-41245 []
08-31-2021 @ 14:06:39 - [0.1457] HTTP Code: 404. Response: {"code":31,"error":"Invoice not found","path":"/v1/invoice/order-MC-41245","timestamp":"2021-08-31T12:06:39.359+00:00","http_status":404,"http_reason":"Not Found","request_id":"a90731f1fa3aab7d5d906570c335b34e"}
08-31-2021 @ 14:06:50 - Request: GET https://api.reepay.com/v1/invoice/order-MC-41246 []
08-31-2021 @ 14:06:51 - [0.1287] HTTP Code: 200. Response: {"id":"420272671419c1410794cacc924d788d","handle":"order-MC-41246","customer":"cust-2022","state":"authorized","type":"ch","amount":48800,"number":29263,"currency":"DKK","due":"2021-08-31T11:26:47.852+00:00","authorized":"2021-08-
The plugin doesn't support the edit feature, which allows you to change the amount of an order. We can't, of course, allow increasing the amount from for example 4 kr. to 5 kr. but merchant should be able to decrease from for example 4 kr. to 3 kr. like in the example below. You can edit the price in WooCommerce, but Reepay makes a full capture of the first amount.
Add Klarna Slice It to WooCommerce
The plugin doesn't support the automatic capture when changing order status in WooCommerce. If you try to do a bulk-action where you update the order status or just try to manual update the order status under a specific order, it doesn't make the Settle the transaction in Reepay. In the example below, "Reepay Settle" is set to Completed in the settings. When you update the order status from Processing to Completed, it doesn't Settle in Reepay, but stay as Authorized.
The plugin doesn't support separate MobilePay Online and ViaBill payment methods. That means at the moment, that you can't choose your preferred payment method directly on the WooCommerce checkout page. See the picture.
It would give a better experience if you were able to present for example Mobile Pay Online directly on the WooCommerce checkout page.
If a settle, authorize, cancel or refund action gets status failed, we need to show an error and log the event with a note in WooCommerce order. E.g. Transaction settled = failed
Jetpack plugin within WordPress for image and static files (CDN), has been reported to cause very slow loading times of images, payment windows etc, when being combined with our reepay module.
Once Jetpack plugin is disabled, webshop speed restores to normal.
video example: https://www.awesomescreenshot.com/video/1771373?key=c14eed10204076e6274f7a1858ee5377
There have been quite a number of reports of merchants utilising the WC plugin, who have reported the error:
HTTP Code: 400. Response: {"code":99,"error":"Customer cannot be changed on invoice","path":"/v1/session/charge","timestamp":"2020-06-22T12:24:45.258+00:00","http_status":400,"http_reason":"Bad Request","request_id":"b7367a4ddb6896553f402fb6b6a9605e"}
Merchants have mentioned that this has been an ongoing occurrence. As our platform doesn't allow multiple handles with the same customer used by another, the above event is triggered. This seems to be happening more often with what seems only to be with WC.
I've attached a log file which the customer has included.
Note from customer: You can recreate it by going to the checkout, begin a payment, cancel, and go back to the checkout.
Could there be a way around this, so the end-user doesn't get stuck trying to make another purchase on top of an existing handle linked to their session without abandoning their basket and trying again?
Apple pay is not an option in overlay mode of the plugin.
Might be outside the plugin.
At the moment, the Reepay plugin will perform a full settlement if the status on an order is changed from an authorized state to a settled state. Instead, Reepay needs to look at the current total from the order in Woo and settle this specific amount. This will solve issues where orders have been changed and the amount is not the same anymore.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.