blockbee/php-blockbee-checkout

dev-main 2024-03-14 14:48 UTC

This package is auto-updated.

Last update: 2024-05-18 20:56:57 UTC


README

68747470733a2f2f626c6f636b6265652e696f2f7374617469632f6173736574732f696d616765732f626c6f636b6265655f6c6f676f5f6e6f7370616365732e706e67

BlockBee's Checkout PHP Library

Official PHP library of BlockBee Checkout

Deprecated! It has been integrated into php-blockbee.

Requirements:

PHP >= 5.6
ext-curl

Install

composer require blockbee/php-blockbee-checkout

on GitHubon Composer

Usage

To use our Checkout page, you will need to follow these steps:

  • (1) Create an account on our Dashboard.
  • (2) Create a "Company" within the account.
  • (3) In the "Company" Settings, generate a new "API Key".
  • (4) Set up the Payment Settings.

Requesting Payment

<?php
require 'vendor/autoload.php'; // Where your vendor directory is

$bb = new BlockBee\Checkout($api_key, $parameters, $blockbee_params);
$payment_address = $bb->payment_request($redirect_url, $value);

Where:

  • $api_key is the API Key provided by our Dashboard.
  • $parameters is any parameter you wish to send to identify the payment, such as ['order_id' => 1234]
  • $blockbee_params parameters that will be passed to BlockBee _(check which extra parameters are available here: https://docs.blockbee.io/#operation/payment)
  • $redirect_url URL in your platform, where the user will be redirected to following the payment. Should be able to process the payment using the success_token.
  • $value amount in currency set in Payment Settings you want to receive from the user.

Getting notified when the user completes the Payment

When receiving payments, you have the option to receive them in either the notify_url or the redirect_url, but adding the redirect_url is required (refer to our documentation at https://docs.blockbee.io/#operation/paymentipn).

Requesting Deposit

<?php
require 'vendor/autoload.php'; // Where your vendor directory is

$bb = new BlockBee\Checkout($api_key, $parameters, $blockbee_params);
$payment_address = $bb->deposit_request($notify_url);

Where:

Getting notified when the user makes a deposit

When receiving deposits, you must provide a notify_url where our system will send an IPN every time a user makes a deposit (refer to our documentation at https://docs.blockbee.io/#operation/depositipn).

Help

Need help?
Contact us @ https://blockbee.io/contacts/

Changelog

1.0.0

  • Initial Release