phycom/paypal
Phycom平台使用的Paypal支付网关
1.0.0-beta.2
2020-08-09 09:50 UTC
Requires
- php: >=7.4
- phycom/base: ~1.0
This package is auto-updated.
Last update: 2024-09-10 00:21:07 UTC
README
Phycom平台使用的Paypal支付网关
此扩展与支付模块结合使用
安装
使用composer安装
composer install phycom/paypal
配置
在支付模块下添加支付方法配置,如下所示
modules => [
'payment' => [
'modules' => [
\Phycom\Paypal\Module::ID => \Phycom\Paypal\Module::class
]
]
]
默认情况下,Paypal商户ID从环境中获取
getenv(ENV . '_PAYPAL_MERCHANT_ID');
其中 `ENV`
是在您的 config.php
中定义的环境前缀
如果您想覆盖一些默认变量,可以使用数组语法,如下所示
modules => [
'payment' => [
'modules' => [
\Phycom\Paypal\Module::ID => [
'class' => \Phycom\Paypal\Module::class,
'merchantId' => '<your paypal merchant id>',
'currency' => 'EUR',
'paymentInfo' => 'some text that appears under the payment button'
]
]
]
]
当支付方法已配置后,设置框应出现在:`<backend base path>/settings#t2-payment-methods`
。在那里,您也可以打开或关闭支付方法。
将支付方法添加到结算页面
如果主题已正确配置,它应该会自动出现,无需任何额外修改。或者,您可以在需要的位置自行调用 `\Phycom\Paypal\Module::getPaymentButtons()`
方法。