shela / omnipay-btcpayserver
适用于 Omnipay 支付处理库的 BTCPayServer 驱动程序
Requires
- php: >=7.1
- bitpay/php-client: dev-master
- omnipay/common: ~3.0
Requires (Dev)
- omnipay/tests: ~3.0
This package is auto-updated.
Last update: 2024-09-14 17:37:25 UTC
README
用于 BTCPayServer 比特币支付处理程序的 Omnipay 驱动程序
Omnipay 是一个适用于 PHP 5.3+ 的框架无关、多网关支付处理库。此软件包实现了 Omnipay 对 BTCPayServer 的支持。
待办事项
此库应该只是围绕 btcpayserver/lib 的教程笔记进行包装:https://github.com/btcpayserver/php-bitpay-client/blob/master/examples/tutorial/003_createInvoice.php
- 从 btcpayserver/btcpayserver-php-client 库中修复密钥生成和配对脚本,并在本 README 中引用它们
要求
- 在
composer.json
中查看 PHP 和库依赖项 - 用于管理环境变量的
.env
文件
安装
此 Omnipay 驱动程序通过 Composer 安装。要安装它,只需将其添加到您的 composer.json
文件中,或只需运行 composer require dcentrica/omnipay-btcpayserver
{ "require": { "dcentrica/omnipay-btcpayserver": "dev-master" } }
配置
此库假设您正在使用 .env
文件进行应用程序配置。根据您的环境调整以下示例
# Hostname of your BTCPayServer instance BTCPAYSERVER_HOST="testnet.demo.btcpayserver.org" # Default web store fiat currency BTCPAYSERVER_STORE_DEFAULT_CURRENCY="NZD" # A URL for returning shoppers back to your website after a successful purchase BTCPAYSERVER_STORE_REDIRECT="https://pay.my-store.nz/" # Optional: IPN notifications are sent here (if set) BTCPAYSERVER_STORE_CALLBACK="https://my-store.nz/ipncallback/" # Generated by https://github.com/btcpayserver/btcpayserver-php-client/blob/master/examples/tutorial/002_pair.php BTCPAYSERVER_INVOICE_TOKEN="A2YbWgnBnEtRhX2UIqJHNvaMp2tt11AzbMiNLLJ9AKK" # Used to encrypt public & private keys BTCPAYSERVER_CONF_ENC_PASS="YourTopSecretPassword" # Absolute path to the private-key, generated according to # https://github.com/btcpayserver/btcpayserver-php-client/blob/master/examples/tutorial/001_generateKeys.php BTCPAYSERVER_PRIKEY_LOC="/tmp/btcpay.pri" # Absolute path to the public-key, generated according to # https://github.com/btcpayserver/btcpayserver-php-client/blob/master/examples/tutorial/001_generateKeys.php BTCPAYSERVER_PUBKEY_LOC="/tmp/btcpay.pub" # Test BTCPayServer endpoint BTCPAYSERVER_ENDPOINT_TEST="https://testnet.demo.btcpayserver.org/" # Live BTCPayServer endpoint BTCPAYSERVER_ENDPOINT_LIVE="https://demo.btcpayserver.org/" # Optionally receive emails at this address when purchases are made BTCPAYSERVER_STORE_NOTIFICATION_EMAIL="notifications@my-store.nz
如果您想在您的网店中显示支付二维码,需要一点 JavaScript,以下是一个示例
<script src="//my.btcpayserver.instance.com/modal/btcpay.js"></script> <script src="/path/to/my/jsquery.min.js"></script> <script> // As an example, `invoiceId` could be configured to come through as a GET param // The jQuery selector should identify the checkout button of your store $('#my-checkout-button').on('click', function(e) { window.btcpay.showInvoice(invoiceId); }); </script>
基本用法
此软件包提供了以下网关
- BTCPayServer
有关 Omnipay 的常规使用说明,请参阅主要的 Omnipay 仓库。有关 BTCPayServer 的使用说明,请参阅主要的 BTCPayServer 仓库和 完整文档。
支持
Omnipay
如果您遇到 Omnipay 的一般问题,我们建议您在 Stack Overflow 上发表帖子。务必添加 omnipay 标签,以便更容易找到。
如果您想了解发布公告、讨论项目想法或提出更详细的问题,还有一个您可以订阅的 邮件列表。
如果您认为您发现了 Omnipay 本身的错误,请使用 GitHub 问题跟踪器 进行报告,或者更好的是,分叉库并提交一个拉取请求。
Omnipay BTCPayServer 驱动程序
如果您认为您发现了此 驱动程序 的错误,请使用我们的 GitHub 问题跟踪器 进行报告。
BTCPayServer
有关 BTCPayServer 的帮助
- 访问网站
- 在 Mattermost 频道 上注册。