bulldots-bulletpoint / laravel-joyn
为Joyn API提供的简单Laravel包
1
2021-05-12 13:13 UTC
Requires
- php: ^7.4|^8.0
- illuminate/support: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-09-29 05:49:57 UTC
README
# Laravel Joyn API包
Laravel Joyn API包。
生成用户在商店购买产品后可扫描的Joyn二维码。
安装
您可以通过composer安装此包
composer require bulldots-bulletpoint/laravel-joyn
使用方法
###示例
用户从您的网店购买商品。支付完成后,系统会向用户发送一封电子邮件以验证订单已支付。
您可以将Joyn二维码添加到该电子邮件中。例如
在这里,我们在webhookController中添加代码
//Http/Controllers/Front/webhookController.php
...
$joyn = new JoynController();
$auth = $joyn->getAuthorization();
$result = $joyn->setLoyaltyToken($auth,$order->reference,$payment->paymentData['amount']);
Mail::send("emails.orderConfirmation", [
"order" => $order,
"joyn" => $result,
"status" => "Your order is payed and confirmed."
]);
...
然后您编辑订单确认邮件模板
//resources/views/emails/orderConfirmation.blade.php
...
<p>Joyn points</p>
<p>Scan QR-Code below with the Joyn-app</p>
<img src="{{$joyn['qrCodeUrl']}}" alt="Joyn QR-Code">
<p>Can't read the QR-Code? <a href="{{$joyn['tokenUrl']}}">Click here</a></p>
...
变更日志
请参阅CHANGELOG了解最近更改的更多信息。
安全
如果您发现任何安全相关的问题,请发送电子邮件至louise@bulldots.be或olivier@bulldots.be,而不是使用问题跟踪器。
鸣谢
许可协议
MIT许可协议(MIT)。请参阅许可文件了解更多信息。
