heureka / overeno-zakazniky
Heureka 'Ověřeno zákazníky' (ShopCertification) 服务API实现
v4.0.2
2023-10-16 07:06 UTC
Requires
- php: >=7.3
Requires (Dev)
- mockery/mockery: ~1.4.3
- phpunit/phpunit: ~9.5.0
Suggests
- ext-curl: Simplifies the library usage (you don't have to provide your own requester)
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();