Coder Social home page Coder Social logo

monei / monei-prestashop Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 21.13 MB

MONEI PrestaShop Official Module

Home Page: https://monei.com

License: Other

CSS 0.45% PHP 85.62% Smarty 10.76% JavaScript 3.17%
accept-payments monei-prestashop payment payment-gateway payments prestashop

monei-prestashop's People

Contributors

alexandresaiz avatar alua-kinzhebayeva avatar chancleta avatar davidgf avatar jimmyn avatar presteamshop avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

presteamshop

monei-prestashop's Issues

Add Card Onsite payment method

Instead of redirecting the customer to MONEI's payment page, we should display the Card Input and Cardholder name fields directly on the checkout page.

Integration docs: https://docs.monei.com/docs/integrations/build-custom-checkout/
How to send cardholder name: https://docs.monei.com/docs/guides/send-cardholder-name/

Here is the example of similar Magento integration

image

Magento Demo: https://magento2-demo.monei.com/

  • Add Card Input Component
  • Add Cardholder Name field
  • Add frontend validation for both fields
  • Confirm payment using monei.confirmPayment without redirect
  • Add an option in admin to switch between Onsite and Redirect integrations

Show payment methods based on customer country

We need to show some payment methods only for countries that are supported:

  • Bizum: ES
  • Multibanco / MB Way: PT
  • Bancontact: BE
  • Blik: PL
  • EPS: AT
  • Giropay: DE
  • iDeal: NL
  • Klarna: AT, BE, CH, DE, DK, ES, FI, FR, GB, IT, NL, NO, SE
  • Sofort: AT, BE, DE, ES, IT, NL, CH, PL
  • Trustly: DE, DK, EE, ES, FI, GB, LT, LV, NL, NO, PL, SE, SK

Multibanco pending payments are marked as accepted in PrestaShop

Payments with Multibanco are async, the user is shown the instructions to complete the payment in the ATM, but payment stays in PENDING_PROCESSING status.

When payment is completed, MONEI will send the notification to the callbackUrl with the payment status.

Make sure that the payment is marked as pending in PrestaShop until the payment status has changed to SUCCEEDED or FAILED

Call to protected method ToolsCore::getContextLocale() from context 'Monei'

When I try to view an order paid by monei payments module I get an error 500.
Prestashop version 1.7.6.5.

Call to protected method ToolsCore::getContextLocale() from context 'Monei'

  at modules/monei/monei.php:1418
  at Monei->formatPrice(0, 'EUR')
     (modules/monei/monei.php:1336)
  at Monei->hookDisplayAdminOrder(array('id_order' => 5611, 'smarty' => object(Smarty_Internal_Template), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2))
     (classes/Hook.php:970)
  at HookCore::coreCallHook(object(Monei), 'hookdisplayAdminOrder', array('id_order' => 5611, 'smarty' => object(Smarty_Internal_Template), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2))
     (classes/Hook.php:355)
  at HookCore::callHookOn(object(Monei), 'displayAdminOrder', array('id_order' => 5611, 'smarty' => object(Smarty_Internal_Template), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2))
     (classes/Hook.php:907)
  at HookCore::exec('displayAdminOrder', array('id_order' => 5611, 'smarty' => object(Smarty_Internal_Template), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2), null)
     (config/smarty.config.inc.php:167)
  at smartyHook(array('h' => 'displayAdminOrder', 'id_order' => 5611), object(Smarty_Internal_Template))
     (classes/Smarty/SmartyLazyRegister.php:83)
  at SmartyLazyRegister->__call('smartyHook', array(array('h' => 'displayAdminOrder', 'id_order' => 5611), object(Smarty_Internal_Template)))
     (var/cache/dev/smarty/compile/43/f7/3f/43f73f0ebb2d12574e44a215786291e3ffa9b1a0_0.file.view.tpl.php:1320)
  at Block_1058646206663a3ad5926de4_05885426->callBlock(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_1058646206663a3ad5926de4_05885426), object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_1058646206663a3ad5926de4_05885426), object(Block_1141815777663a3ad5a37884_53541030))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:186)
  at Smarty_Internal_Runtime_Inheritance->process(object(Smarty_Internal_Template), object(Block_1141815777663a3ad5a37884_53541030))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(Smarty_Internal_Template), 'Block_1141815777663a3ad5a37884_53541030', 'override_tpl')
     (var/cache/dev/smarty/compile/ed/4d/51/ed4d51efedb5bd09033c018801edcb00bd9419a4_0.file.view.tpl.php:34)
  at content_663a3ad5a3c1f3_88349156(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:385)
  at Smarty_Internal_Template->_subTemplateRender('helpers/view/view.tpl', null, null, 0, 3600, array(), 2, false, null, null)
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:116)
  at Smarty_Internal_Runtime_Inheritance->endChild(object(Smarty_Internal_Template), 'helpers/view/view.tpl')
     (var/cache/dev/smarty/compile/43/f7/3f/43f73f0ebb2d12574e44a215786291e3ffa9b1a0_0.file.view.tpl.php:40)
  at content_663a3ad5a237f5_48405153(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render(object(Smarty_Internal_Template))
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render(false, 0)
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:232)
  at Smarty_Internal_TemplateBase->_execute(object(Smarty_Internal_Template), null, null, null, 0)
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116)
  at Smarty_Internal_TemplateBase->fetch()
     (classes/helper/Helper.php:114)
  at HelperCore->generate()
     (classes/helper/HelperView.php:58)
  at HelperViewCore->generateView()
     (classes/controller/AdminController.php:2478)
  at AdminControllerCore->renderView()
     (controllers/admin/AdminOrdersController.php:1974)
  at AdminOrdersControllerCore->renderView()
     (classes/controller/AdminController.php:2124)
  at AdminControllerCore->initContent()
     (classes/controller/Controller.php:292)
  at ControllerCore->run()
     (classes/Dispatcher.php:515)
  at DispatcherCore->dispatch()
     (management/index.php:97)```

qa branch

Could you please create and push qa branch to this repo? Then I will be able to send PR for "qa" branch

Check status, not statusCode

When a payment is verified or confirmed, we need to check the status, not the statusCode:

  • SUCCEEDED: The payment is successful, and the order can be marked as paid.
  • AUTHORIZED: Authorization is successful. To charge the customer's funds, they should be captured manually.
  • PENDING or PENDING_PROCESSING: The payment is pending. For some payment methods like Multibanco or MBWay, this is the default status because the payment process can take hours or even days (as in the case of Multibanco). The SUCCEEDED status will only be reported via callbackUrl.

Error with third-party modules

In our PrestaShop store we have correctly connected the MONEI platform and next to it, as in other payment methods configured we have a surcharge module called Advanced Payment Rules that adds a surcharge in the cart when a customer buys from abroad. What happens is that all other payment methods correctly take this value and add it to the amount to pay but your platform takes the final value of the cart but also the value without the surcharge thus generating a payment error at checkout. In this way the order is created in the PrestaShop backoffice but the order confirmation email will not be sent to the customer because the order status remains as "Payment error". If we go into that order we can see that indicates that have been paid for example 1000 € instead of 950 € that would be the cart without the 50 euros surcharge for foreign purchase. Could you make some compatibility since I have contacted the developers of that module and they tell me that they can not do anything about it.
image

Do not show success or error popup

image

We should eliminate the success popup and instead display a spinner until the user is redirected to the confirmation page.

Additionally, we should remove the error popup. Instead, show an inline error message within the selected payment method, such as for the cardholder name. Currently, the checkout page reloads automatically, which happens too quickly for users to read the error message, causing confusion. Instead, we should reload the page and prominently display the error message.

Error in PrestaShop 1.7.5.1

By selecting this payment method, you return me to the payment selection page, with a message indicating that I must "Accept the terms of service" or "Choose a payment method".
It's like if I detected that I checked those boxes.

Integration with Advanced Payment and Fees module

El modulo se llama Advanced Payment and Fees de la empresa MotionSeed. Los pasos para reproducir el error son los siguientes:

1-Añades un producto al carrito
2-Vas al carrito e intentas finalizar la compra
3-Seleccionas como metodo de pago monei
4-En el carrito se vera reflejado un recargo por pago en extrangero de por ejemplo 10€
5-Finalizas la compra pagando el importe del carrito + el importe del recargo atraves de MONEI
6-El pedido se cobra al cliente perfectamente sin embargo le llega el correo conforme que el pedido ha dado un error
7-En el apartado de pedidos de prestashop podemos ver como el estado del pedido es Error de Pago y si entramos a ver los detalles sale el siguiente mensaje: "Advertencia 710€ pagado en vez de 700 €"

Check if payment method is enabled and available in MONEI

It is possible to get information about what payment methods are supported by accountId or paymentId, this request also returns the supported countries. The request is cached, in order to bypass cache pass a timestamp as query parameter

https://api.monei.com/v1/payment-methods?paymentId={{paymentId}}&t=1234556
https://api.monei.com/v1/payment-methods?accountId={{accountId}}

We should check if payment method is enabled in MONEI before showing it.

  • Check the country dynamically
  • Check if payment method is enabled

Add MBWay payment method

Add MBWay payment method (similar to Multibanco), it has no insite option, just a simple redirect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.