lyrasoft/shopgo-ecpay
最新稳定版本:1.1.1
Composer 安装命令:
composer require lyrasoft/shopgo-ecpay
包简介
ShopGo Ecpay package
README 文档
README
Installation
Install from composer
composer require lyrasoft/shopgo-ecpay
Register to shopgo config:
use Lyrasoft\ShopGo\Ecpay\EcpayPayment; use Lyrasoft\ShopGo\Ecpay\EcpayShipping; return [ //... 'shipping' => [ 'types' => [ // ... 'ecpay' => EcpayShipping::class, // <-- Add this ] ], 'payment' => [ 'types' => [ // ... 'ecpay' => EcpayPayment::class, // <-- Add this ] ],
Session
As ShopGo may need to redirect to outside Payment service to process checkout, you must disable SameSite cookie policy
and set secure as TRUE.
// etc/packages/session.php return [ 'session' => [ // ... 'cookie_params' => [ // ... 'secure' => true, // <-- Set this to TRUE // ... 'samesite' => CookiesInterface::SAMESITE_NONE, // Set this to `SAMESITE_NONE` ],
CSRF
Since Ecpay may call back to out website, you must exclude 2 routes from CSRF at front.route.php:
// front.route.php ->middleware( CsrfMiddleware::class, excludes: [ 'front::backup', 'front::shipping_task', 'front::payment_task', ] )
JS
After composer install, Wil automatically install the required JS packages.
"@lyrasoft/shopgo-ecpay": "portal:./vendor/lyrasoft/shopgo-ecpay/assets"
Run:
yarn install
Then add this to front/main.ts after useShopGoCatalog()
// front/main.ts +import { useShopGoEcpay } from '@lyrasoft/shopgo-ecpay'; // ... useShopGoCatalog(); +useShopGoEcpay();
统计信息
- 总下载量: 687
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-28