bitmoney / php-api-client
Bitmoney PHP API client
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Package info
bitbucket.org/paweljendrusik/bitmoney-php-api-client
pkg:composer/bitmoney/php-api-client
Requires
- php: >=5.3.0
- guzzlehttp/guzzle: ^6.3
- sainsburys/guzzle-oauth2-plugin: ^3.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2024-11-15 05:32:51 UTC
README
Installation
Run following command To install stable version of API client for PHP:
php composer.phar require bitmoney/php-api-client
Usage
First of all, you should instantiate Client object:
<?php
$client = new \Bitmoney\Api\Client($clientId, $clientSecret);
Creating new transaction request
To create new transaction request:
<?php
// ... create client
$params = [
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'john.doe@gmail.com',
'price' => 10,
'currency' => 'EUR',
'wallet' => '1DGeaqRLd7Ko75MXdxtRsMfTuBuduMHANP',
'merchant' => 'bankcontract',
'ip' => '65.222.1.139',
];
$newPaymentRequest = \Bitmoney\Api\Request\NewTransactionRequest::build($params);
$newPaymentResponse = $client->newTransaction($newPaymentRequest);
Checking transaction details
To check transaction details:
<?php
// ... create client
$paymentReceipt = $client->transactionDetails($transactionId);
Requesting merchants list
To request list of avaliable merchants:
<?php
// ... create client
$requestMerchantsResponse = $client->paymentMethods();