Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Latest commit

 

History

History
77 lines (63 loc) · 2.94 KB

README.md

File metadata and controls

77 lines (63 loc) · 2.94 KB

BitBayPay API

GitHub tag (latest by date) GitHub Packagist PHP from Packagist StyleCI Build Status

Implementation of BitBayPay REST API - https://docs.bitbaypay.com/v1.0.0-en/reference

Requirements

  • PHP - ^7.2

Installation

You can install this package by composer:

composer require pacerit/bitbaypay-api-php

Usage

Example call of "payments" API method:

$client = new BitBayPay();

$parameters = [
    BitBayPayInterface::PARAMETER_DESTINATION_CURRENCY => 'PLN',
    BitBayPayInterface::PARAMETER_PRICE                => '1000',
    BitBayPayInterface::PARAMETER_ORDER_ID             => 'randomstring',
    // This parameters below, are not required.
    // BitBayPayInterface::PARAMETER_SOURCE_CURRENCY      => '',
    // BitBayPayInterface::PARAMETER_COVERED_BY           => '',
    // BitBayPayInterface::PARAMETER_KEEP_SOURCE_CURRENCY => '',
    // BitBayPayInterface::PARAMETER_SUCCESS_CALLBACK_URL => '',
    // BitBayPayInterface::PARAMETER_FAILURE_CALLBACK_URL => '',
    // BitBayPayInterface::PARAMETER_NOTIFICATIONS_URL    => '',
];

$response = $client->setPublicKey("YOUR_PUBLIC_KEY")
    ->setPrivateKey("YOUR_PRIVATE_KEY")
    ->createPayment($parameters);

Example response:

[
    "paymentId" => "8418c539-f271-4287-b252-d3e3ee12f455",
    "url"       => "https://checkout.bitbay.net/payment/8418c539-f271-4287-b252-d3e3ee12f455"
]

Available functions

Changelog

Go to the Changelog for a full change history of the package.

Testing

You must provide your own credentials for testing environment:

BITBAYPAY_TEST_PUBLIC_KEY=
BITBAYPAY_TEST_PRIVATE_KEY=

Run tests:

composer test

Security Vulnerabilities

If you discover a security vulnerability within package, please send an e-mail to Wiktor Pacer via kontakt@pacerit.pl. All security vulnerabilities will be promptly addressed.

License

This package is open-source software licensed under the MIT license.