Giter VIP home page Giter VIP logo

alma-monthlypayments-magento2's Introduction

Alma Monthly Payments for Magento 2

This plugin adds a new payment method to Magento 2, which allows you to offer monthly payments to your customer using Alma.

Description

Alma is a service to provide merchants with an easy and safe monthly payments solution.
Let your customers pay for their purchases at their own pace! You'll receive the funds instantly, and your customer will pay later over a few monthly instalments.

This plugin integrates Alma into Magento 2 by adding a new payment method that you can activate to offer monthly payments to your customers.

Installation

Prerequisites

You first need to create your merchant account on dashboard.getalma.eu and activate your account.

Installing

Using Composer

The easiest way to install the extension is to use Composer:

$ composer require almapay/alma-monthlypayments-magento2
$ bin/magento module:enable Alma_MonthlyPayments
$ bin/magento setup:upgrade && bin/magento setup:static-content:deploy

Configuring the plugin

After installing the plugin, go to Stores > Configuration > Sales > Payment Methods.
Find "Alma Monthly Payments" in the payment methods list to start configuring it.

Fill in the API keys for your account, which you can find on your dashboard's security page.

You also have access to different settings to control what the plugin should display on the Cart, Mini-cart and Checkout pages. We advise you to stay in "Test" mode until you're happy with your configuration and are ready to accept payments from your customers.

Once everything is properly set up, go ahead and switch to "Live" mode!

alma-monthlypayments-magento2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alma-monthlypayments-magento2's Issues

Base currency needs to be EUR

If the Magento Store is configured with a base currency other than Euros, the charged amount on Alma's side will be whatever the base currency's grand total is, but charged in Euros.

for instance, a $118/68€ cart will be charged 118€ if the store's base currency is USD instead of EUR.

Error on product page due to erased method on release v2.4.0

Reproduced on product page after installing release v2.4.0 on Magento v2.3.5-p2.

PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Alma\MonthlyPayments\Gateway\Config\Config::isFullyConfigured() in /var/www/html/vendor/alma/alma-monthlypayments-magento2/Gateway/Config/Config.php:210

It seems that the class of the method has been renamed in last release but not all calls 😱

Error getOrderShippingMethodName() method payment not possible 3.4.0

Hello,

when I make a payment in 3.4.0, I get this error :

TypeError(code: 0): Alma\\MonthlyPayments\\Helpers\\OrderHelper::getOrderShippingMethodName(): Return value must be of type string, null returned at vendor/almapay/alma-monthlypayments-magento2/Helpers/OrderHelper.php:164)

Error on CSP whitelist declaration

Hi, I'm encountering an error on my website (developer mode) because there is an error on the csp_whitelist.xml file because you have a duplicate id on the values.

Error :
1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): More than one node matching the query: /csp_whitelist/policies/policy[@id='font-src']/values/value[@id='fonts_gstatic'], Xml is: <?xml version="1.0" encoding="UTF-8"?>...

image

Thanks.

Change payment issue still present in version v4.1.0

Hi

I've upgraded to version 4.1.0 to fix the payment change problem. It still doesn't work for me, but I now have this error:

helpers.ts:23 Uncaught Error: Element not found, please add an id selector for the iframe at f (helpers.ts:23:9) at y (helpers.ts:15:21) at w (mount.ts:49:19) at b (mount.ts:43:16) at Module.J [as initialize] (index.ts:42:19) at UiClass.selectInstallments (alma_monthly_payments.js:237:36) at UiClass.selectAlmaPaymentMethod (alma_monthly_payments.js:222:26) at HTMLInputElement.<anonymous> (knockout.js:4669:74) at HTMLInputElement.dispatch (jquery.js:5430:49) at elemData.handle (jquery.js:5234:47)

Note that when I select Alma as the first payment, the information block opens but the checkbox is not selected :
Capture d’écran 2023-09-29 à 08 57 20

Thanks in advance for your help

Magento 2.4.2 : Block issue in the back office

Magento Version : 2.4.2
Module Version : 1.2.0

Hello,

I tried to update the module from 1.1.2 to 1.2.0 during a Magento migration from 2.3.5 to 2.4.2. But when I enable the module in the back office, it make the page unavailable with the following error :

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: '/var/www/html/vendor/composer/../alma/alma-monthlypayments-magento2/view/adminhtml/templates/form/field/plans.phtml' in module: 'Alma_MonthlyPayments' block's name: 'adminhtml\form\field\plans_0'

Can you check that, please ?

Alma is not compatible with magento 2.4.4

I'm trying to upgrade to magento 2.4.4 and this error came up
I'm using alma 2.6.0

Warning: Declaration of Alma\MonthlyPayments\Helpers\Logger::addRecord($level, $message, array $context = Array): bool should be compatible with Monolog\Logger::addRecord(int $level, string $message, array $context = Array, ?Monolog\DateTimeImmutable $datetime = NULL): bool in vendor/alma/alma-monthlypayments-magento2/Helpers/Logger.php on line 74

Method 'Alma\MonthlyPayments\Helpers\Logger::addRecord()' is not compatible with method 'Magento\Framework\Logger\Monolog::addRecord()'

Hi,

After to install a new Magento 2.4.5 and add the alma/alma-monthlypayments-magento2 module on a php 8.1 server I had the error:

Method 'Alma\MonthlyPayments\Helpers\Logger::addRecord()' is not compatible with method 'Magento\Framework\Logger\Monolog::addRecord()'

Seems like that the Monolog dependency doesn't correspond to the expected Alma Helper method:
To correct this I just changed this method to:

use Monolog\DateTimeImmutable;

/**
 * @param int $level
 * @param string $message
 * @param array $context
 * @param DateTimeImmutable $datetime Optional log date to log into the past or future
 * @return bool
 */
public function addRecord($level, $message, array $context = [], DateTimeImmutable $datetime = null): bool
{
    if (!$this->configHelper->canLog()) {
        return true;
    }

    return parent::addRecord($level, $message, $context, $datetime);
}

Maybe should be a futur update of this module?

Have a nice day.

Coupon code and Alma payment

Hello.

When choose first to make a payment with Alma, the order is created and set to "Pending payment" status. So if you used a single-use coupon code for this payment, you can't draw back and change your payment method.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Cart Price Rules with a coupon in Magento Back Office
  2. Make an order that use the rule
  3. Go to checkout an choose Alma payment
  4. See the order created and in "Pending payment" status in the Back Office
  5. Check in database the times_used at 1 for the coupon in salesrule_coupon table

Expected behavior
Have a way to go back to the payment method selection, so the customer can pay another way with his coupon.

Magento version
2.3.6-p1

Plugin version
6.5.0

Pending Orders for Unpaid

This extension creates "Pending Orders" for the unpaid orders. Currently looking for a fix or workaround.
As these "Pending Orders" reserve the stock we are facing an issue.

Order is created when click on place order

In the checkout, when we select the payment method Alma and we place order, the order is created. If we cancel the order in the page where we fill the credit card, the order is not canceled.

Code generation failed with php 7.3 and v4.1.0

Hi,

Seems the class \Alma\MonthlyPayments\Controller\Payment\Eligibility is not compatible with php version previous 7.4. The fact that the $logger property is typed break this compatibility.

Unable to load checkout form

Get this error on checkout page with magento 2.4.4 / alma v 3.1.3

Failed to load the "Alma_MonthlyPayments/payment/form" template requested by "checkout.steps.billing-step.payment.payments-list.alma_monthly_payments"

Does somebody have the same issue ? (I had the same with version 3.1.2)

thanks

Critical Error on Product page > issue with registry usage

On some configurable products, page goes to error with that log :
[2022-09-22T11:47:35.244653+00:00] main.CRITICAL: Error: Call to a member function getId() on null in /var/wwwxxxxx/vendor/alma/alma-monthlypayments-magento2/Block/Catalog/Product/View.php:96
Stack trace:
#0 /var/www/xxxxxx/vendor/alma/alma-monthlypayments-magento2/Block/Catalog/Product/View.php(85): Alma\MonthlyPayments\Block\Catalog\Product\View->getProduct()

Here, line 96, callling to registry fails
Should get it from context
$this->product = $this->context->getRegistry()->registry('product');
https://github.com/alma/alma-monthlypayments-magento2/blob/master/Block/Catalog/Product/View.php

Retirees

MY name is Annette C Harrison I retired from LAUSD and my monthly payment is deposited directly to my bank account so don't get a check stubs how can I get a copy of my monthly payment. What information is needed so I can get this . Can you help me with this matter.

Checkout : SQL Error if one product of cart has no category IDs

Hello,

When we place an order for an item (Simple product without category, or a configurable product with a child product without an assigned category), the form refuses to go to the Alma platform and displays an SQL error in customer view (even by disabling debug mode).

Capture d’écran 2022-12-08 à 12 42 19


I found a simple workaround, just check if the product has categories before starting the search via the repository:

private function getProductCategories(Product $product): array
{
  $categoryIds = $product->getCategoryIds();

  if(empty($categoryIds)) return []; # add this

  try {
    $categoryCollection = $this->getCategoryCollection($categoryIds);
  } catch (LocalizedException $e) {
    $this->logger->info(
        'Impossible to create category collection for product',
        [
            'product ID '=> $product->getId(),
            'Exception Message' => $e->getMessage()
        ]
    );
    return [];
  }
...

If you find anything better than my light workaround, go for it. And, if you have more questions, don't hesitate to reply me :)

Have a nice day !

Installation not correct for 3.X

Current installation guide :

$ composer require alma/alma-monthlypayments-magento2

New installation guide :

$ composer require almapay/alma-monthlypayments-magento2

Issue with payment 3 month and badge.js

Hi there,

I would like to report a couple issues that i'm currently facing :

  • The first one is coming from the badge.js
var qtyNode = document.getElementById('qty');
qtyNode.addEventListener("input",function(){updateWidget()});

In some cases it looks like it is triggering a js error when the script loads before the dom

image

As a fix attempt, I would suggest to add domReady! for this js file ?

=========================================================================

  • The second issue i'm facing is about the configuration of my 3x payment in product page.

As you can see, two times works fine

image

But not the 3 times

image

I've been trying to dig by myself but I can't find where this values are generated; so I don't really know what is happening.

=========================================================================

  • The third one is when you go on the modal payment detail ; it looks like the html isn't properly interprated. But there again I can't find anywhere in the code where this might comes from.

image

Did I missed something in the database ? Thanks for attention

Error with Website Scope on Store -> Configuration -> Sales -> Payment Method

When you change the scope in Magento's configuration to the website, there are an error:

1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): The store that was requested wasn't found. Verify the store and try again.

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): The store that was requested wasn't found. Verify the store and try again.
<pre>#1 Magento\Store\Model\StoreManager->getStore() called at [generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php:119]
#2 Magento\Store\Model\StoreManagerInterface\Proxy->getStore() called at [vendor/magento/module-store/Model/Resolver/Store.php:30]
#3 Magento\Store\Model\Resolver\Store->getScope() called at [vendor/magento/framework/App/Config/ScopeCodeResolver.php:49]
#4 Magento\Framework\App\Config\ScopeCodeResolver->resolve() called at [vendor/magento/framework/App/Config.php:69]
#5 Magento\Framework\App\Config->getValue() called at [vendor/magento/module-payment/Gateway/Config/Config.php:94]
#6 Magento\Payment\Gateway\Config\Config->getValue() called at [vendor/almapay/alma-monthlypayments-magento2/Gateway/Config/Config.php:126]
#7 Alma\MonthlyPayments\Gateway\Config\Config->get() called at [vendor/almapay/alma-monthlypayments-magento2/Gateway/Config/Config.php:140]
#8 Alma\MonthlyPayments\Gateway\Config\Config->getIsActive() called at [vendor/almapay/alma-monthlypayments-magento2/Block/Adminhtml/System/Config/GeneralGroupFrontModel.php:30]
#9 Alma\MonthlyPayments\Block\Adminhtml\System\Config\GeneralGroupFrontModel->_getHeaderCommentHtml() called at [vendor/magento/module-config/Block/System/Config/Form/Fieldset.php:140]

The following method in Helpers/StoreHelper.php return a website ID:

private function backStoreId(): string
    {
        $store = $this->request->getParam('store');
        if ($store) {
            return $store;
        }
        $website = $this->request->getParam('website');
        if ($website) {
            return $website;
        }
        return '0';
    }

Magento is attempt a Store ID in module-payment/Gateway/Config.php:

public function getValue($field, $storeId = null)
    {
        if ($this->methodCode === null || $this->pathPattern === null) {
            return null;
        }

        return $this->scopeConfig->getValue(
            sprintf($this->pathPattern, $this->methodCode, $field),
            ScopeInterface::SCOPE_STORE,
            $storeId
        );
    }

Cart is not empty after the order success

Hi,
After we place an order, the cart contains all the products ordered.
We have some logs :
Eligibility check failed for following reasons: array ( 'purchase_amount' => 'invalid_value', ) [] [].
But the order is created and we receive a confirmation email by Alma.

OrderStatus event if payment fails

Orders are created with new status even if payment is KO
That led to non paid orders to my customer who uses this status to trig his ERP actions

Please propose a setting to choose order status after payment, on failure, etc. as this is done on the finetecture module for example to fit all tiers configs capabilities

Enable Alma payment is not active for Iphone ios

The alma module is not activated on the user's first visit on iPhone IOS.

What I'm talking about in the first journey is the user who arrives then logs in, chooses their delivery method and arrives on the payment solutions page. Alma does not activate.

But if we return to the basket and redo all the steps, the Alma payment solution is displayed.

Magento version 2.4.6-p3

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.