定制 billie/shopware6-payment-module 二次开发

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

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

billie/shopware6-payment-module

最新稳定版本:4.0.0

Composer 安装命令:

composer require billie/shopware6-payment-module

包简介

Billie payment for Shopware 6

README 文档

README

If you do not use the Shopware default invoice documents, you need to inform the Billie module about the invoice number form the ERP/WaWi.

Please do NOT modify any data via direct SQL commands!

The following code snippet will show you how you can modify the Billie data correctly. You should create a custom plugin for this, or integrate it into the adaptor of your WaWi/ERP system.

Preparation

You should inject the entity repository via DI of Symfony. The name of the service is called billie_order_data.repository and will be an instance of \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository

You can also get it via the container (not the recommended):

/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */

/** @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $repository */
$repository = $container->get('billie_order_data.repository');

Fetch Billie order data by order id

If you do only have the entity id of the order, you need to use the repository to find the billie data by the order id.

/** @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $repository */

$orderId = 'YOUR_ORDER_ID';
$criteria = new \Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria();
$criteria->addFilter(new \Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter(
    \Billie\BilliePayment\Components\Order\Model\OrderDataEntity::FIELD_ORDER_ID,
    $orderId
));

/** @var \Billie\BilliePayment\Components\Order\Model\OrderDataEntity $billieOrderData */
$billieOrderData = $repository->search($criteria, \Shopware\Core\Framework\Context::createDefaultContext())->first();

$billieOrderData->getId(); // ID of the Billie order data entity
$billieOrderData->getReferenceId(); // billie order reference id (uui)
$billieOrderData->getExternalInvoiceNumber(); // external invoice number
$billieOrderData->getExternalInvoiceUrl(); // external invoice url
$billieOrderData->getExternalDeliveryNoteUrl(); // external delivery note url
$billieOrderData->getBankIban(); // bank account: iban
$billieOrderData->getBankBic(); // bank account: bic
$billieOrderData->getBankName(); // bank account: name

Fetch Billie order data from loaded order entity

If you already have an instance of an order entity, you can get the order data simply by the getExtension-method.

/** @var \Shopware\Core\Checkout\Order\OrderEntity $order */
$order = [...];

/** @var \Billie\BilliePayment\Components\Order\Model\OrderDataEntity $billieOrderData */
$billieOrderData = $order->getExtension(\Billie\BilliePayment\Components\Order\Model\Extension\OrderExtension::EXTENSION_NAME);

$billieOrderData->getExternalInvoiceNumber(); // External invoice number
$billieOrderData->getExternalInvoiceUrl(); // external invoice url
$billieOrderData->getExternalDeliveryNoteUrl(); // external delivery note url

Update Billie order data

If you need to modify the Billie data, you should do this with the entity repository and the upsert-method.

/** @var \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository $repository */

$repository->upsert([
    [
        \Billie\BilliePayment\Components\Order\Model\OrderDataEntity::FIELD_ID => 'ID of the Billie order data entity', // This is always required !
        \Billie\BilliePayment\Components\Order\Model\OrderDataEntity::FIELD_EXTERNAL_INVOICE_NUMBER => 'external invoice number',
        \Billie\BilliePayment\Components\Order\Model\OrderDataEntity::FIELD_EXTERNAL_INVOICE_URL => 'external invoice url',
        \Billie\BilliePayment\Components\Order\Model\OrderDataEntity::FIELD_EXTERNAL_DELIVERY_NOTE_URL => 'external delivery note url',
    ]
], \Shopware\Core\Framework\Context::createDefaultContext());

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固