Implementation of BitBayPay REST API - https://docs.bitbaypay.com/v1.0.0-en/reference
- PHP - ^7.2
You can install this package by composer:
composer require pacerit/bitbaypay-api-php
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"
]
- Start payment - https://api.bitbaypay.com/rest/bitbaypay/payments
- Get currency pairs - https://api.bitbaypay.com/rest/bitbaypay/stores/markets
- Get currency settings - https://api.bitbaypay.com/rest/bitbaypay/stores/currenciesSettings
- Payments list - https://api.bitbaypay.com/rest/bitbaypay/payments/search
- Payment details - https://api.bitbaypay.com/rest/bitbaypay/payments/{paymentId}
Go to the Changelog for a full change history of the package.
You must provide your own credentials for testing environment:
BITBAYPAY_TEST_PUBLIC_KEY=
BITBAYPAY_TEST_PRIVATE_KEY=
Run tests:
composer test
If you discover a security vulnerability within package, please send an e-mail to Wiktor Pacer via [email protected]. All security vulnerabilities will be promptly addressed.
This package is open-source software licensed under the MIT license.