Download the PHP package ambitionphp/laravel-bitpay without Composer
On this page you can find all versions of the php package ambitionphp/laravel-bitpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ambitionphp/laravel-bitpay
More information about ambitionphp/laravel-bitpay
Files in ambitionphp/laravel-bitpay
Package laravel-bitpay
Short Description Bitpay wrapper for laravel
License MIT
Homepage https://github.com/vrajroham/laravel-bitpay
Informations about the package laravel-bitpay
Laravel + BitPay Integration
Accept Bitcoin and Bitcoin Cash for your business with your Laravel application and BitPay client.
Requires PHP ^7.3
Contents
- Installation
- Install Package
- Publish config file
- Add configuration values
- Add webhook event listener
- Connect to server and authenticate the client
- Examples
- Create Invoice and checkout (step wise)
- Changelog
- Contributing
- Security
- Credits
- License
Installation
Install package
You can install the package via composer:
Publish config file
Publish config file with:
Add configuration values
Add following keys to .env
file and updated the details (view more about configuration):
Add webhook event listener
By default package is capable of handling of webhook requests. Bitpay payment status updates are completely based on webhooks. Whenever webhook is received from server, BitpayWebhookReceived
event is dispatched. You just need to provide a listener for this event.
You can add your listener as below,
Next, add listener to EventServiceProvider's $listen
array as below,
Connect to server and authenticate the client
- Create keypairs and pair your client(application) with BitPay server.
-
What exactly above command do?
- Above command will create Private and Public key, encrypt your private key using bitpay secure storage class using your provided password.
- SIN (Service Identification Number) for your client will be created to uniquely identify requests from your server.
- By using SIN new Token and Pairing Code will be created for your client on bitpay server and will be shown on your console output.
- Token will be used for all future request to bitpay and will automatically be copied to your
.env
file. - Based on environment you set TEST/LIVE, command will provide URL to approve your client and you need to copy and search Pairing Code on bitpay server & approve it.
- You are all set. :golf:
Examples
Create Invoice and checkout
Let's go step by step.
-
Create your internal system order and then initiate the workflow by creating bitpay invoice as below,
- Once you get the invoice url for payment, redirect user to that particular url. Use will see something like below on browser.
-
Next, open your bitpay wallet, scan the code and make a payment. Something like below,
-
Once payment is done, success screen will be displayed and user needs to click on Return to Shop Name.
- Payment done! Now you need to wait for webhook to get notification regarding status of payment.
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
- Vaibhavraj Roham
- All Contributors
License
The MIT License (MIT). Please see License File for more information.