Coder Social home page Coder Social logo

mcspronko / liqpay-magento2 Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 22.0 1.12 MB

LiqPay integration extension for Magento 2

License: MIT License

PHP 81.48% JavaScript 4.79% HTML 13.73%
liqpay-extension liqpay-magento2 magento2 magento2-module open-source-project

liqpay-magento2's People

Contributors

dmzaiets avatar galanis-a avatar ityetti avatar nikolay1993 avatar prokopovvitaliy avatar serzhik avatar vitaliyhexbrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

liqpay-magento2's Issues

Add Payment Code constant into an API interface

Please add 'pronko_liqpay' into a constant of an interface inside the Pronko_LiqPayApi extension.
Change all occurrences of the string payment method code in the configuration files and PHP classes to use the new constant.

Create redirect payment method form

What should be done:

  • New payment method with the title "LiqPay Redirect" should be rendered on the checkout payment page
  • The payment method should include a billing address and a button "Proceed to LiqPay"

It should be created in the Pronko_LiqPayRedirect extension.

LiqPay Redirect payment method code should be pronko_liqpay_redirect

Add basic LiqPay configuration settings

What should be done:

  • Add new configuration settings under Stores -> Configuration -> Sales -> Payment Methods -> LiqPay
  • "General Settings" section
    • "Enabled", select field, Yes/No
    • "Title", text field
    • "Mode", select field, Production/Sandbox
  • "Account Settings" section
    • "Sandbox Credentials" section
      • "Public Key", text field
      • "Private Key", text field
    • "Production Credentials" section
      • "Public Key", text field
      • "Private Key", text field

Configure HttpClient class to send Pay Transaction request

What should be done:

  • TransferFactory class (see \Magento\Payment\Gateway\Http\TransferFactoryInterface) should be created to configure and build the \Magento\Payment\Gateway\Http\TransferInterface instance
  • Configure \Magento\Payment\Gateway\Http\Client\Zend class to send the HTTP POST Request with the Pay Transaction to the LiqPay server.

The \Magento\Payment\Gateway\Command\GatewayCommand class should be used to configure Capture command virtual type.

I have issue when install

Problem 1
- The requested package pronko/liqpay-magento2 could not be found in any version, there may be a typo in the package name.

Add LiqPayGateway extension directory

The Pronko_LiqPayGateway extension is responsible for Gateway API classes and interfaces for sending a request, validating request and response and processing a response from LiqPay API.

What should be included as part of this task:

  • see checkout directory as an example:
    ** registration.php
    ** composer.json
    ** etc/module.xml

Add Order Prefix configuration field

This field should be concatenated with order id when sending all LiqPay transaction requests.

The "Order Prefix" and "Order Suffix" fields can be added inside Advanced Settings or Account Settings of the module.

The Config class from the gateway module should be adjusted

Add Authorize transaction support

Currently, LiqPay only supports a capture transaction.

What should be done:

  • Add the "Payment Type" setting to the configuration to the Pronko\LiqPayAdmin module
  • The setting should include 2 standard options "Authorize Only" and "Authorize and Capture"
  • Implement Builders to support Authorization transaction

Invalid parameter card_date when sending 2021

Please check https://www.liqpay.ua/documentation/en/api/aquiring/pay/doc for year format.

[2019-08-30 06:05:51] main.DEBUG: array (
  'request_raw' => 
  array (
    'data' => 
    array (
      'version' => 3,
      'public_key' => '',
      'action' => 'pay',
      'description' => 'LiqPay for Magento 2',
      'order_id' => '000000098',
      'card' => '4000000000000002',
      'card_cvv' => '111',
      'card_exp_month' => '1',
      'card_exp_year' => '2021',
      'amount' => 53.71,
      'currency' => 'USD',
      'phone' => '(555) 229-3326',
    ),
    'signature' => '',
  ),
) [] []

[2019-08-30 06:05:51] main.DEBUG: array (
  'request_uri' => 'https://www.liqpay.ua/api/request',
  'response' => 
  array (
    'result' => 'error',
    'action' => 'pay',
    'status' => 'failure',
    'err_code' => 'err_wrong',
    'err_description' => 'Invalid parameter card_date',
    'version' => 3,
    'type' => 'buy',
    'public_key' => 'sandbox_i70710739841',
    'liqpay_order_id' => '000000098',
    'description' => 'LiqPay for Magento 2',
    'amount' => 53.71,
    'currency' => 'USD',
    'is_3ds' => false,
    'key' => 'card_date',
    'code' => 'err_wrong',
  ),
) [] []

Create Payment Form on Checkout Payment Page

What should be done:

  • Payment form should be created using UI Component (JS and HTML files) and added via checkout_index_index.xml file
  • Payment form should include a LiqPay title
  • Payment form should have the following fields:
    • Card Number
    • Expiration Month
    • Expiration Year
    • CVV code
  • Place Order button

Implement \Pronko\LiqPayGateway\Gateway\Config class

What should be done:

  • getPrivateKey() method should return value from either payment/pronko_liqpay/sandbox_private_key or payment/pronko_liqpay/production_private_key depending on the Envrionment value Sandbox or Production.
  • same logic for getPublicKey should be implemented

Fix coding standards

Maxs-MacBook-Pro:liqpay-magento2 pronko$ composer test-phpcs

vendor/bin/phpcs --standard=Magento2 ./checkout/ ./test/ ./admin/ ./card-gateway/ ./gateway/ ./redirect/ ./customer/ ./widget/ ./api/

FILE: ...y-magento2/card-gateway/Test/Integration/Gateway/RequestTest.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

102 | WARNING | Code must not contain multiple empty lines in a row;
| | found 2 empty lines.

FILE: ...nto2/card-gateway/Gateway/Request/Builder/CardPaymentBuilder.php

FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES

49 | WARNING | Line exceeds maximum limit of 120 characters;
| | contains 155 characters
50 | WARNING | Line exceeds maximum limit of 120 characters;
| | contains 152 characters

FILE: ...ions/liqpay-magento2/api/Api/Data/PaymentMethodCodeInterface.php

FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES

11 | WARNING | [x] Expected 1 space(s) before asterisk; 0 found
12 | WARNING | [x] Expected 1 space(s) before asterisk; 0 found

PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY

Add LiqPayAdmin extension directory

The Pronko_LiqPayAdmin extension is responsible for rendering configuration of the LiqPay payment method.

What should be included as part of this task:

  • see checkout directory as an example:
    ** registration.php
    ** composer.json
    ** etc/module.xml

Create remaining configuration settings

What should be done:

  • The settings for the LiqPay payment method should be created:
    • Under General Settings section
      • Payment Action, select field, Options: Authorize Only (value authorize), Authorize and Capture (Pay) (value authorize_capture)
    • new section "Card Payment" - should be created in the scope of the card-admin module (Pronko_LiqPayCardAdmin)
      • Card Types, multi-select field, options: Visa, Mastercard
  • Advanced Settings
    • Minimum Order Total, text field
    • Maximum Order Total, text field
    • Sort Order, text field
    • New Order Status, select field, default Processing
    • Accepted Currencies, multi-select field, options - USD, EUR, RUB, UAH

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.