Introduce placeholder express methods - #20
Conversation
Previously there was a large CSL score because all of the Adyen Express methods were being lazy loaded and only showing after the network request had finished. The BlueFinch Checkout has had an update allowing for placeholder express methods to be rendered and remain visible until the lazy loading of the full Express methods. This update introduces these placeholders and then switches them out after we have fully rendered the express methods.
| $this->adyenPaymentMethodManagement->getPaymentMethods($quoteId), | ||
| true | ||
| ) : []; | ||
| $result[self::PAYMENT_METHODS_KEY] = $paymentMethods; |
There was a problem hiding this comment.
@maxparkergene This will currently fire after all section data loads, but if adyen express payments is enabled we're already doing this request once. This will help reduce load on adyen and keep this lean
We need to handle two cases
- Adyen express enabled
- we need to check storeConfigPaths to see if express is active and enabled
- if it is, then we terminate this plugin because we dont want to duplicate api requests
- we also need a new plugin or extension, after the adyen express functionality to grab that payload and use it for our purposes. so that we dont run the same request twice
- Adyen express not enabled
- use this implementation, as its very similar to the adyen express method.
There was a problem hiding this comment.
Hi @convenient,
Thanks for the feedback and I have added the checks as you've suggested to only run the Adyen API request if the express module is not enabled. If it is there is a separate plugin that will take the data and use it as we are expecting in BlueFinch checkout.
If the Adyen Express module is enabled then they will have already gathered the payment methods to be added into the customer data. Added a check to see if any of the configuration for Adyen Express is enabled and if so we will not run the lookup ourselves but instead use a plugin to take the data that already exists and use it for our purposes.
tr33m4n
left a comment
There was a problem hiding this comment.
@maxparkergene Looking good, added a comment about idle packages
| $payPalExpressEnabled = $this->scopeConfig->getValue('payment/adyen_paypal_express/express_show_on', ScopeInterface::SCOPE_STORE); | ||
|
|
||
| // Only run if no Adyen Express methods are enabled otherwise we'd be duplicating the Adyen API request. | ||
| if (!$googlePayExpressEnabled && !$applePayExpressEnabled && !$payPalExpressEnabled) { |
There was a problem hiding this comment.
@maxparkergene As the package can be installed and potentially not configured, we could see duplicate requests just with the express module sitting in the background. The better check here might be something using the \Magento\Framework\Module\Manager like:
if (!$this->moduleManager->isEnabled('Adyen_ExpressCheckout')) {
//
}
Previously there was a large CSL score because all of the Adyen Express methods were being lazy loaded and only showing after the network request had finished.
The BlueFinch Checkout has had an update allowing for placeholder express methods to be rendered and remain visible until the lazy loading of the full Express methods.
This update introduces these placeholders and then switches them out after we have fully rendered the express methods.