Download the PHP package wangta69/btc-payment without Composer
On this page you can find all versions of the php package wangta69/btc-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wangta69/btc-payment
More information about wangta69/btc-payment
Files in wangta69/btc-payment
Package btc-payment
Short Description Payment system for btc with bitcoind
License MIT
Informations about the package btc-payment
btc-payment
Prerequisites
Laravel version >= 5.5
Install package via composer:
OR
Checking payments and confirmations:
Package contains class Pondol\BtcPayment\Commands\CheckPayment. This is Laravel Command and you can call it via php artisan :
Each time you call it, it scan for payments and confirmations on block chain. You can call it manually for testing purposes like mentioned above , but there is no much sense to do so, because it's job is to check for payments and it needs to run always.
You need to make crontab entry on linux servers or task scheduler on Win servers to call this command every minute.
This script also fires events that we can listen ...
Listening for payments
You'll find new classes in app\Listeners folder of your app when you published pakage ( see installation section). this is :
ConfirmedPaymentListener.php
To activate these Listeners copy this code in app\Providers\EventServiceProvider.php class (this class exists by default installation of Laravel), in $listen attribute of this class.
Like this:
In each of these class there is handle method, where you can put logic for actions that need to be done when event is fired (DB insert-update, sending mails ...).
Below is example of ConfimedPaymentListener, event is generated when number of confirmations is equal to BITCOIND_MIN_CONFIRMATIONS in .env file and we can be sure that payment is ok.
Events
- Pondol\BtcPayment\Events\ConfirmedPaymentEvent - Payment is made and number of confirmations is equal or greater than value of BITCOIND_MIN_CONFIRMATIONS in .env file.
Models
Pondol\BtcPayment\Models\Payment - Represents Confirmed and Unconfirmed Payments (see Usage section)
License
MIT License