heureka/overenozakazniky

该软件包已被废弃且不再维护。作者建议使用heureka/overeno-zakazniky软件包。

Heureka 'Ověřeno zákazníky' (ShopCertification)服务API实现

v4.0.2 2023-10-16 07:06 UTC

README

Heureka Ověřeno zákazníky (ShopCertification)服务API客户端实现,适用于PHP。

注意:对于非PHP实现,请查阅docs文件夹中的API文档。

示例

您可以在该存储库的examples文件夹中查看工作示例。

用法

使用您的API密钥(您需要登录)初始化类Heureka\ShopCertification

require_once __DIR__ . '/vendor/autoload.php';

$shopCertification = new \Heureka\ShopCertification('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

请注意,您的API密钥仅属于您,并且它应该是保密的。不要将您的API密钥发布给任何人,不要将其放入JavaScript或任何其他地方。它应该仅存在于您的服务器上。如果您觉得有必要违反这条规则,那么您可能正在做错事 - 请在采取任何行动之前咨询我们的支持部门

SK商店应该在选项中设置服务参数初始化类

$options = ['service' => \Heureka\ShopCertification::HEUREKA_SK];
$shopCertification = new \Heureka\ShopCertification('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', $options);

设置客户电子邮件地址

$shopCertification->setEmail('jan.novak@muj-eshop.cz');

设置客户的订单ID(仅允许整数)

$shopCertification->setOrderId(15195618851564);

添加客户订购的产品(使用您在Heureka XML源中的ITEM_ID字段中使用的ID)

$shopCertification->addProductItemId('B1234');
$shopCertification->addProductItemId('15968421');
$shopCertification->addProductItemId('814687');

最后,发送请求以记录订单

$shopCertification->logOrder();