定制 multisafepay/magento2-graphql 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

multisafepay/magento2-graphql

Composer 安装命令:

composer require multisafepay/magento2-graphql

包简介

MultiSafepay module for Magento 2 GraphQl support

README 文档

README

MultiSafepay plugin for Magento 2 (GraphQL module)

This module provides GraphQL support for MultiSafepay payments. For a complete installation of all our features, please check out our meta package.

Installation

This module can be installed via composer:

composer require multisafepay/magento2-graphql

Next, enable the module:

bin/magento module:enable MultiSafepay_ConnectCore MultiSafepay_ConnectFrontend MultiSafepay_ConnectAdminhtml MultiSafepay_ConnectGraphQl

Next, run the following commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Please keep in mind that after installing this module, you will only have graphql compatability and core functionalities.

For a quick installation of all the modules, we recommend using the meta package instead.

Usage

To create an order using GraphQL, please take a look at the Magento manual

Example requests

  • Get the issuers and additional data for selected MultiSafepay payment:
query {
    cart(cart_id: "{ CART_ID }") {
        selected_payment_method {
            code
            multisafepay_additional_data {
                image
                instructions
                is_preselected
            }
            multisafepay_available_issuers {
                code
                description
            }
        }
    }
}
  • Get the available payments methods with issuers and additional data for MultiSafepay gateways:
query {
    cart(cart_id: "{ CART_ID }") {
        available_payment_methods {
            code
            title
            multisafepay_available_issuers {
                code
                description
            }
            multisafepay_additional_data {
                image
                instructions
                is_preselected
            }
        }
    }
}
  • setPaymentMethodOnCart query with issuers example:
mutation {
    setPaymentMethodOnCart(input: {
        cart_id: "{ CART_ID }"
        payment_method: {
            code: "multisafepay_mybank"
            multisafepay_mybank: {
                issuer_id: "CT000003-it-1"
            }
        }
    }) {
        cart {
            selected_payment_method {
                code
                multisafepay_additional_data {
                    image
                    is_preselected
                }
            }
        }
    }
}
  • To retrieve MultiSafepay request data which includes information about Payment Component, Apple Pay or/and Google Pay, you can use the following query:
query MultisafepayPaymentRequestData {
    multisafepayPaymentRequestData(cart_id: { CART_ID }) {
        apiToken
        apiTokenLifeTime
        cartTotal
        currency
        environment
        locale
        paymentComponentContainerId
        payment_component_template_id
        storeId
        applePayButton {
            applePayButtonId
            getMerchantSessionUrl
            isActive
            additionalTotalItems {
                amount
                label
            }
            cartItems {
                label
                price
            }
        }
        googlePayButton {
            accountId
            googlePayButtonId
            isActive
            mode
            merchantInfo {
                merchantId
                merchantName
            }
        }
        paymentComponentConfig {
            gatewayCode
            paymentMethod
            paymentType
            additionalInfo {
                image
                is_preselected
                vaultCode
            }
            tokens {
                bin
                code
                display
                expired
                expiry_date
                last4
                model
                name_holder
                token
            }
        }
    }
}
  • setPaymentMethodOnCart query with payment component payload example: (for more information on how to retrieve the payload, see the MultiSafepay documentation)
mutation {
    setPaymentMethodOnCart(input: {
        cart_id: "{ CART_ID }"
        payment_method: {
            code: "multisafepay_creditcard"
            multisafepay_creditcard: {
                payload: "xxxx"
                tokenize: true
            }
        }
    }) {
        cart {
            selected_payment_method {
                code
                multisafepay_additional_data {
                    image
                    is_preselected
                }
            }
        }
    }
}
  • Place order request example. After placing the order, you will receive the multisafepay_payment_url on which the customer should be redirected to for placing a transaction:
mutation {
    placeOrder(input: {cart_id: "{ CART_ID }"}) {
        order {
            order_number
            multisafepay_payment_url {
                payment_url
                error
            }
        }
    }
}
  • Request example of a new mutation of restoreQuote for restoring the quote by Cart ID after, for example, an unsuccessfull payment:
mutation {
    restoreQuote(input: {
        cart_id: "{ CART_ID }"
        } 
    )
  • Get MultiSafepay payment url from a placed order:
query {
    customer {
        orders(
            pageSize: 10
        ) {
            total_count
            items {
                id
                increment_id
                multisafepay_payment_url
            }
        }
    }
}

Support

You can create issues on our repository. If you need any additional help or support, please contact integration@multisafepay.com

We are also available on our Magento Slack channel #multisafepay-payments. Feel free to start a conversation or provide suggestions as to how we can refine our Magento 2 plugin.

A gift for your contribution

We look forward to receiving your input. Have you seen an opportunity to change things for better? We would like to invite you to create a pull request on GitHub. Are you missing something and would like us to fix it? Suggest an improvement by sending us an email or by creating an issue.

What will you get in return? A brand new designed MultiSafepay t-shirt which will make you part of the team!

License

Open Software License (OSL 3.0)

Want to be part of the team?

Are you a developer interested in working at MultiSafepay? View our job openings and feel free to get in touch with us.

multisafepay/magento2-graphql 适用场景与选型建议

multisafepay/magento2-graphql 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53.81k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2021 年 02 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 multisafepay/magento2-graphql 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 multisafepay/magento2-graphql 我们能提供哪些服务?
定制开发 / 二次开发

基于 multisafepay/magento2-graphql 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 53.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2021-02-16