Download the PHP package binarycabin/brainblocks without Composer
On this page you can find all versions of the php package binarycabin/brainblocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download binarycabin/brainblocks
More information about binarycabin/brainblocks
Files in binarycabin/brainblocks
Package brainblocks
Short Description An integration helper for taking Nano payments via BrainBlocks
License MIT
Informations about the package brainblocks
BrainBlocks for Laravel
An integration helper for taking Nano payments via BrainBlocks.io
This package adds a few helpers when adding a BrainBlocks button with Laravel
Installation
In .env, add your Nano wallet address the button will send to:
Adding Buttons
Simply include the button view where you would like the button to appear. Be sure to include the amount (in rai) that the button will take as well as the url the button will POST to with a valid brainblocks token:
You can add multiple buttons on this page using this include. Then at the bottom of the page, be sure to add your javascript
Validating BrainBlocks Responses
In your POST route, call the
BrainBlocks::getTokenResponse
will return the full response from the BrainBlocks, this can be validated manually or you can use the validateResponse
helper.
By default, the validateResponse
helper will make sure:
- the
fulfilled
property istrue
- the "destination" address matches the address your config The second property takes an array of additional validations you would like to check, for example checking the amount.
Custom Currencies
In addition to the default "rai", you can change the currency used to any of the supported currencies listed on brainblocks.io
Be sure to update your validator to look for the correct currency and amount
Custom Destination
If you need a specific button to go to a destination address other than the one set in your configuration, you can add it as an option as well
Be sure to update your validator to look for the changed destination instead of the default