Download the PHP package vrajroham/laravel-bitpay without Composer

On this page you can find all versions of the php package vrajroham/laravel-bitpay. 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-bitpay

LaravelBitPay

LaravelBitPay Social Image

Latest Version on Packagist Build Status Quality Score Total Downloads

LaravelBitPay enables you and your business to transact in Bitcoin, Bitcoin Cash and 10+ other BitPay-supported cryptocurrencies within your Laravel application.

Requires PHP 7.4+

:warning: Migration From v4 :warning:

If upgrading from v4, please follow MIGRATION.md

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-bitpay.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):

Generate Key-Pair and API Token(s)

The laravel-bitpay:createkeypair command generates a BitPay API Token and Pairing Code for each enabled facade:

Create Key-Pair Command

:information_source: By default, the command will use the (valid) existing private key located at BITPAY_PRIVATE_KEY_PATH. You may specify the --fresh or -f option to explicitly generate a fresh private key, from which tokens are derived.

After successful API Token generation, you will need to approve it by visiting the provided link.

:warning: Note that the payout facade must be enabled on your BitPay merchant account before you can approve and use the related API Token. This means you won't be able to perform actions on the Recipients and Payouts resources. To enable Payouts functionality, Contact BitPay Support.

Configure Webhooks (Optional)

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

1. Setup your webhook route

Resolve the bitPayWebhook 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 BitPay webhook POST requests. If none is provided, it defaults to 'laravel-bitpay/webhook':

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

LaravelBitPay 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-bitpay.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 BitpayWebhookReceived 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 BitPay, at a locked exchange rate with an expiration time of 15 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):

: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:

Request an Invoice webhook to be resent

Refunds

Refund requests are full or partial refunds associated to an invoice. Fully paid invoices can be refunded via the merchant's authorization to issue a refund, while underpaid and overpaid invoices are automatically executed by BitPay to issue the underpayment or overpayment amount to the customer.

Refund an invoice

The item Jane purchased was dead on arrival. Give back the lady her crypto:

Retrieve a refund request

Let's periodically retrieve (and check the status of) Jane's refund request:

Retrieve all refund requests on an invoice

In this example we retrieve all refund requests related to Jane's invoice:

Cancel a refund request

Turns out Jane didn't initially follow the instruction manual. The item works and she no longer wants a refund:

Bills

Bills are payment requests addressed to specific buyers. Bill line items have fixed prices, typically denominated in fiat currency.

Create a bill

In the following example, we create a bill that's due in 10 days:

Retrieve a bill

Retrieve a list of existing bills

You can narrow down the retrieved list by specifying a Bill status:

Update a bill

We managed to upsell a product to our client. Let's add an extra line item to their existing Bill:

Deliver a bill via email

Subscriptions

Subscriptions are repeat billing agreements with specific buyers. BitPay sends bill emails to buyers identified in active subscriptions according to the specified schedule.

Create a subscription

Let's create a subscription that's delivered on the 28th of each month and due on the first of the following month, at 9 AM, respectively:

Retrieve a subscription

Retrieve a list of existing subscriptions

You can narrow down the retrieved list by specifying a Subscription status:

Update a subscription

In this example we activate a Subscription by updating its status:

Settlements

Settlements are transfers of payment profits from BitPay to bank accounts and cryptocurrency wallets owned by merchants, partners, etc.

Retrieve settlements

In this example we retrieve completed YTD (Year-To-Date) settlements denominated in Euros (EUR). We only need 100 records, starting from the 5th one:

Retrieve a settlement

Fetch a reconciliation report

A reconciliation report is a detailed report of the activity within the settlement period, in order to reconcile incoming settlements from BitPay.

Ledgers

Ledgers are records of money movement.

Retrieve account balances

Retrieve ledger entries

In this example we retrieve MTD (Month-To-Date) ledger entries denominated in United States Dollars (USD).

Recipients

The Recipient resource allows a merchant to invite their clients to signup for a BitPay personal account.

:warning: Your BitPay Merchant account must be authorized for Payouts functionality. To enable Payouts functionality, Contact BitPay Support.

Invite Recipients

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

Retrieve a recipient

Retrieve recipients by status

In this example, we retrieve 100 recipients (starting from the 50th) that have passed the good 'ole Onfido ID verification checks:

Update a recipient

Remove a recipient

Request a recipient webhook to be resent

Payouts

Payouts are individual (or batches of) bitcoin payments to employees, customers, partners, etc.

:warning: Your BitPay Merchant account must be authorized for Payouts functionality. To enable Payouts functionality, Contact BitPay Support.

Create a payout

Let's assume Ada Lovelace accepted our invitation. In this example, we schedule her an individual payout for a 5-star rating she received from a referral:

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

Create a payout batch

Let's pay our two top-tier affiliates for all their hard work, batching both payments into a single API call, for the efficiency of it.

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

Retrieve a payout

Retrieve a payout batch

Retrieve payouts based on status

In this example, we retrieve all completed, Year-To-Date (YTD) payouts.

Retrieve payout batches based on status

In this example, we retrieve all cancelled, Year-To-Date (YTD) payout batches.

Cancel a payout

Cancel a payout batch

Request a payout webhook to be resent

Request a payout batch webhook to be resent

Currencies

Currencies are fiat currencies supported by BitPay.

Retrieve the supported currencies

In this example, we retrieve the list of supported BitPay Currency objects.

Rates

Rates are exchange rates, representing the number of fiat currency units equivalent to one BTC.

Retrieve the exchange rate table maintained by BitPay

Retrieve all the rates for a given cryptocurrency

Retrieve the rate for a cryptocurrency / fiat pair

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] or [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-bitpay with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0 || ^8.1
ext-json Version *
bitpay/sdk Version ~7.1.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 vrajroham/laravel-bitpay contains the following files

Loading the files please wait ....