定制 vbdev/magento2-store-credit 二次开发

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

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

vbdev/magento2-store-credit

最新稳定版本:1.0.1

Composer 安装命令:

composer require vbdev/magento2-store-credit

包简介

Magento 2 Store Credit

README 文档

README

composer require vbdev/magento2-store-credit

Main Functionalities

  • The module offers the possibility to create credits for the customer with rest API, this credit can be used in the store as a payment method.

Install

Type 1: Zip file

  • Unzip the zip file in app/code/Vbdev
  • Enable the module by running bin/magento module:enable Vbdev_StoreCredit
  • Apply database updates by running bin/magento setup:upgrade
  • Flush the cache by running bin/magento cache:flush

Type 2: Composer

  • Install the module composer by running composer require vbdev/magento2-store-credit
  • enable the module by running bin/magento module:enable Vbdev_StoreCredit
  • apply database updates by running bin/magento setup:upgrade
  • Flush the cache by running bin/magento cache:flush

Manage store credits

REST Endpoints:

POST <base_url>/rest/V1/store-credit/get

  • Returns the customer's store credit. If the customer ID is not found, it will be ignored and only those found will be returned. If none of the customer IDs are found, an empty array is returned.
  • BODY EXAMPLE:
{
  "customerIds": [
    "94795",
    "94796",
    "94797"
  ]
}

POST <base_url>/rest/V1/store-credit/create

  • Create store credit for a customer. If any item has an invalid customer_id, website_id, or value, it will be marked as failed and deleted from the list, and an error message describing the problem will be returned. If there are no failed items during the update, an empty array is returned. If an error occurred during the update, an exception will be thrown.
  • BODY EXAMPLE:
{
  "storeCredits": [
    {
      "customer_id": "94795",
      "website_id": "4",
      "amount": "234.12"
    },
    {
      "customer_id": "94796",
      "website_id": "12",
      "amount": "903.12"
    },
    {
      "customer_id": "94797",
      "website_id": "1",
      "amount": "200.12"
    }
  ]
}
  • When making a request for a customer ID that does not have Store Credit, it will create a new one with the “amount” value entered and for that website entered.
  • If a request is made for a customer ID that already has a Store Credit, it will be updated to the value entered in the "amount".
  • There is also the possibility of adding the values, that is, if they already have a Store Credit, when making another request the credit will be added to the previous one and not replaced, for this use UPDATE:

POST <base_url>/rest/V1/store-credit/update

  • BODY EXAMPLE:
  • Update customer's store credit. If any items will have invalid customer_id, website_id or amount, they will be marked as failed and excluded from update list and an error message describing the problem will be returned. If there were no failed items during update empty array will be returned. If error occurred during the update, an exception will be thrown.
{
  "storeCredits": [
    {
      "customer_id": "94795",
      "website_id": "4",
      "amount": "4"
    },
    {
      "customer_id": "94796",
      "website_id": "1",
      "amount": "4"
    },
    {
      "customer_id": "94797",
      "website_id": "5",
      "amount": "4"
    }
  ]
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2023-12-21