{"id":16465624,"url":"https://github.com/peterfox/bitpayclient","last_synced_at":"2025-10-27T12:31:50.550Z","repository":{"id":13776792,"uuid":"16471869","full_name":"peterfox/bitpayclient","owner":"peterfox","description":"An OOP PHP client for interacting with the BitPay API","archived":false,"fork":false,"pushed_at":"2016-10-16T22:58:48.000Z","size":204,"stargazers_count":2,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T05:31:43.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterfox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-03T06:50:41.000Z","updated_at":"2015-08-08T19:14:44.000Z","dependencies_parsed_at":"2022-09-22T14:25:02.725Z","dependency_job_id":null,"html_url":"https://github.com/peterfox/bitpayclient","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfox%2Fbitpayclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfox%2Fbitpayclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfox%2Fbitpayclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfox%2Fbitpayclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterfox","download_url":"https://codeload.github.com/peterfox/bitpayclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238497506,"owners_count":19482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T11:34:40.180Z","updated_at":"2025-10-27T12:31:50.170Z","avatar_url":"https://github.com/peterfox.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"BitPayClient\n=========\n\nThe purpose of this library is to be an object orientated alternative to the official [BitPay PHP library].\n\nThe library is designed to make it easier to integrate BitPay in to more heavy PHP frameworks that use composer as a package manager such as Symfony2 and Laravel.\n\nThe library is written by myself, [Peter Fox].\n\nVersion\n----\n\n1.1.0 - 16th March 2014 - Allows for throwing exception when an error api response is returned\n1.0.0 - 5th Feburary 2014\n\nInstallation\n--------------\n\nAdd to your projects composer.json\n\n```json\n{\n    \"require\": {\n        \"peterfox/bitpayclient\":\"1.0.*\"\n    }\n}\n```\n\nThen run composer install or composer update to install this package.\n\nUsage\n------\n\nThe most basic use is as follows:\n\n```php\n$client = new BitPayClient('YOUR-API-KEY');\n\n$invoiceResponse = $client-\u003ecreateInvoice(0.0001, 'BTC');\n```\n\nYou can supply further parameters for creating an invoice via a third array parameter (to see all possible parameters read the BitPay API):\n\n```php\n$client = new BitPayClient('YOUR-API-KEY');\n\n$invoiceResponse = $client-\u003ecreateInvoice(0.0001, 'BTC', ['redirectUrl' =\u003e 'http://somewhere']);\n```\n\nYou can also supply a PosData value as an array and it will be sent as a Base64 encoded string (please note that other data will be modified to be base64 as well):\n\n```php\n$client = new BitPayClient('YOUR-API-KEY');\n\n$invoiceResponse = $client-\u003ecreateInvoice(0.0001, 'BTC', ['posData' =\u003e ['some_id' =\u003e 100]]);\n```\n\nThe library also allows for making responses from Array (like from a $_POST):\n\n```php\n$client = new BitPayClient('YOUR-API-KEY');\n\n$invoiceData = [\n            'id'=\u003e 'CNRWBUPUZs9foP2ysZBBc',\n            'url'=\u003e 'https://bitpay.com/invoice?CNRWBUPUZs9foP2ysZBBc',\n            'status' =\u003e 'new',\n            'btcPrice' =\u003e '0.0001',\n            'price' =\u003e 0.0001,\n            'currency' =\u003e 'BTC',\n            'invoiceTime' =\u003e 1391301679184,\n            'expirationTime' =\u003e 1391302579184,\n            'currentTime' =\u003e 1391302121888\n            ];\n\n$invoiceResponse = $client-\u003egetInvoiceFromArray($invoiceData);\n```\nThere's also the functionality of getting an invoice from BitPay's API if you so wish:\n```php\n$client = new BitPayClient('YOUR-API-KEY');\n\n$invoiceGetResponse = $client-\u003egetInvoice('CNRWBUPUZs9foP2ysZBBc');\n```\n\nTesting\n--------\n\nAfter cloning and installing this repo you can run */vendor/bin/phpunit* in the root of the project and test it.\n\nYou will have to create a file called apikey.txt in the root directory of the project containing your api to actually run these tests.\n\nThe testing of this project uses [PHP-VCR] which is useful for running the tests multiple times as testCreateInvoice_LimitExceeded() test will cause BitPay to send you an email as a warning which can be a bit tedious. The fixtures are all stored in test/fixtures/.\n\nLicense\n----\n\nGNU GPL Version 3\n\n[BitPay PHP library]:https://github.com/bitpay/php-client\n[PHP-VCR]:https://github.com/php-vcr/php-vcr\n[bitpay]:http://www.bitpay.com\n[Peter Fox]:http://www.peterfox.me\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfox%2Fbitpayclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterfox%2Fbitpayclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfox%2Fbitpayclient/lists"}