0

What does the Magento Payment Module do in Magento 2.4? I want to create a payment method. How do I use this module

1
  • The above two payment methods seem to have different logic codes. Are there any differences between them。
    – sq y
    Mar 15, 2023 at 9:17

2 Answers 2

1

The Magento payment module in Magento 2.4 is a module that provides the necessary functionality to create and manage payment methods within your Magento store. This module includes pre-built payment methods such as PayPal, Braintree, and Authorize.net, as well as the ability to create custom payment methods.

To create a payment method using the Magento payment module, you can follow these general steps:

  1. Create a new module in your Magento 2.4 installation using the Magento CLI or manually.
  2. Define the payment method in your module's configuration files, specifying the necessary details such as the method code, title, and payment type.
  3. Implement the necessary PHP classes to handle the payment method's functionality, such as processing payments, handling refunds, and displaying payment information to customers.
  4. Configure the payment method in your Magento store's backend, specifying any additional settings or requirements.

Here are some resources that can help you get started with creating a payment method using the Magento payment module:

Magento 2.4 DevDocs: Payment Method Overview (https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/payment-method-overview.html)

Magento 2.4 DevDocs: Create a Payment Method (https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/payment-method-create.html)

Magento 2.4 DevDocs: Payment Gateway Integration (https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/payment-gateway-intro.html)

4
1

You can configure default payment method from adminpanel (backoffice).

Settings :

ADMIN > STORES > Settings (Configuration) > SALES > PAYMENT METHODS.

There you shoud enable and configure payment method.

You also can create custom payment method

https://www.mageplaza.com/devdocs/magento-2-create-payment-method/#the-bottom-line

https://meetanshi.com/blog/create-payment-method-in-magento-2/

6
  • The above two payment methods seem to have different logic codes. Are there any differences between them
    – sq y
    Mar 15, 2023 at 9:17
  • You need to update logic as your requirement. It's only show require files.
    – S.P
    Mar 15, 2023 at 12:24
  • github.com/mageplaza/magento-2-sample-payment-method May be it would help you. you can download and use it.
    – S.P
    Mar 15, 2023 at 12:31
  • Thank you,but use this(devdocs.magento.com/guides/v2.4/payments-integrations/…) , I think very difficult。
    – sq y
    Mar 15, 2023 at 15:28
  • Yes, It's little complicated, But if you learnt mageplaza sample payment module and try to modified it then you can get better idea.
    – S.P
    Mar 16, 2023 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.