承接 peachpayments/magento2-graphql-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

peachpayments/magento2-graphql-plugin

Composer 安装命令:

composer require peachpayments/magento2-graphql-plugin

包简介

PeachPayments Hosted module, for Magento 2 GraphQl support.

README 文档

README

Installation

Install this module alongside the Peach Payments hosted payments module by running:

composer require peachpayments/magento2-graphql-plugin

GraphQL

To allow for a GraphQL flow, use the core Magento setPaymentMethodOnCart and placeOrder methods.

After a successful order ID has been returned, use the getPeachHostedRedirectUrl method to redirect the customer to the Checkout page. At this stage, the order should be in the pending state. Deconstruct the JSON object from form_data and submit it as _POST parameters to the specified form_link URL.

After the customer has returned to the return_url you specified, call the getPeachHostedOrderStatus method to get a success (1) or declined (2) status. If the status code is 3, retry regularly.

Examples


# Set Peach Payments as payment method
mutation setPaymentMethodOnCart($cartId: String!){
  setPaymentMethodOnCart(input: {
      cart_id: $cartId
      payment_method: {
          code: "peachpayments_hosted_card"
      }
  }) {
    cart {
      selected_payment_method {
        code
      }
    }
  }
}

# Place order
mutation placeOrder($cartId: String!) {
  placeOrder(input: {cart_id: $cartId}) {
    order {
      order_number
    }
  }
}

# Get redirect URL and data
query getPeachHostedRedirectUrl($cartId: String!){
  getPeachHostedRedirectUrl(input: {
    cart_id: $cartId,
    return_url: "https://my.app.pwa/payment/welcome-back.html"
  }) {
    form_data
    form_link
  }
}

# Get status by order increment ID
query getPeachHostedOrderStatus($orderNumber: String!){
  getPeachHostedOrderStatus(input: { order_number: $orderNumber }) {
    status
  }
}

# Get order details, used for confirmation page
query getPeachHostedOrderDetailsData($cartId: String!) {
    getPeachHostedOrderDetailsData(cart_id: $cartId) {
        id
        ...OrderConfirmationPageFragment
    }
}

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2023-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固