Download the PHP package petzsch/laravel-btcpay without Composer

On this page you can find all versions of the php package petzsch/laravel-btcpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-btcpay

This project is not maintained anymore. And therefore was archived.

LaravelBtcPay

LaravelBtcPay Social Image

Latest Version on Packagist Total Downloads

LaravelBtcPay enables you and your business to transact in Bitcoin, Litecoin and 10+ other BtcPay-supported cryptocurrencies within your Laravel application.

Requires PHP ^7.3

Supported Resources

Contents

Installation

Install package

You can install the package via composer:

Publish config file

Publish config file with:

This will create a laravel-btcpay.php file inside your config directory.

Add configuration values

Add the following keys to your .env file and update the values to match your preferences (read more about configuration):

Configure Webhooks (Optional)

BtcPay resource status updates are completely based on webhooks (IPNs). LaravelBtcPay is fully capable of automatically handling webhook requests. Whenever a webhook is received from BtcPay's server, BtcpayWebhookReceived event is dispatched. Take the following steps to configure your application for webhook listening:

1. Setup your webhook route

Resolve the btcPayWebhook route macro in your desired route file (web.php is recommended). The macro accepts a single, optional argument, which is the URI path at which you want to receive BtcPay webhook POST requests. If none is provided, it defaults to 'laravel-btcpay/webhook':

:information_source: To retrieve your newly created webhook route anywhere in your application, use: route('laravel-btcpay.webhook.capture')

LaravelBtcPay also offers the convenience of auto-populating your configured webhook url on applicable resources. Specifically when:

You may enable this feature per-resource by uncommenting the respective entry within the auto_populate_webhook array found in the laravel-btcpay.php config file.

:warning: If a value is manually set, most likely via $resource->setNotificationURL('https://...') during resource initialization, auto-population is overridden.

2. Setup your webhook listener

Start by generating an event listener:

Then, implement your application-specific logic in the handle(...) function of the generated listener.

In the following example, we assume you have previously created an invoice, storing its token on your internal Order model:

Finally, map your listener to the BtcpayWebhookReceived event inside the $listen array of your EventServiceProvider:

Examples

Invoices

Invoices are time-sensitive payment requests addressed to specific buyers. An invoice has a fixed price, typically denominated in fiat currency. It also has an equivalent price in the supported cryptocurrencies, calculated by BtcPay, at a locked exchange rate with an expiration time of 15(or whatever you configured) minutes.

Create an invoice

In this example we assume you've already created an instance of your equivalent Order model, to be associated with this Invoice (referred to as $order):

TODO: Check if all of this works with the invoice object exposed by greenfield!!!

:information_source: It is highly recommended you store the Invoice ID and Token on your internal model(s). The token can come in handy when verifying webhooks.

Retrieve an existing invoice

Retrieve a list of existing invoices

In this example we retrieve all MTD (Month-To-Date) invoices: TODO: unsupported by Greenfield!!!

Refund an invoice

TODO: Add support for pull payments to implement refunds (not currently included)

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-btcpay with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
btcpayserver/btcpayserver-greenfield-php Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package petzsch/laravel-btcpay contains the following files

Loading the files please wait ....