pacerit/bitbaypay-api-php

This package is abandoned and no longer maintained. No replacement package was suggested.

Implementation of BitBayPay REST API

1.0.2 2020-04-01 13:57 UTC

This package is auto-updated.

Last update: 2023-01-15 13:20:35 UTC


README

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.