Download the PHP package joeymckenzie/givebutter-php without Composer
On this page you can find all versions of the php package joeymckenzie/givebutter-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joeymckenzie/givebutter-php
More information about joeymckenzie/givebutter-php
Files in joeymckenzie/givebutter-php
Package givebutter-php
Short Description PHP API wrapper for Givebutter's public API.
License MIT
Informations about the package givebutter-php
This package was heavily inspired by openai-php/client. Consider giving it a start to support the PHP community!
🧈 Givebutter PHP
Givebutter PHP is a plug 'n play HTTP client for Givebutter's public API.
Lookging for Laravel integration? I've got you covered! See joeymckenzie/givebutter-laravel for details.
Table of Contents
- Getting started
- Notes
- Usage
- Campaigns
- Campaign Members
- Campaign Teams
- Contacts
- Tickets
- Transactions
- Payouts
- Funds
- Testing
Getting started
The client is available as a composer packager that can be installed in any project using composer:
Since the client is compatible with any PSR-18 HTTP client, any commonly used HTTP client can be used thanks
to our dependency on php-http/discovery
. Once installed, you may start interacting
with Givebutter's API:
For a comprehensive set of examples, take a look at the examples directory.
Notes
There's some current discrepancies between the API documentation and what the API actually returns, which several resources drifting from their schema definition. I do the best I can without internal knowledge of the API to adhere to the response schema, though it may be possible there will be breaking changes.
Due to the API response structure and the lack of resource enveloping, the response fields themselves may be null
at any point. One should always check for errors before attempting to use any properties on the responses:
Usage
Campaigns
Create a campaign
Creates a campaign from a specified payload.
Get all campaigns
Gets a list of available campaigns. Optionally, accepts a scope parameter.
Get a campaign
Gets a single campaign.
Update a campaign
Updates a campaign from a specified payload.
Delete a campaign
Deletes a campaign.
Campaign Members
Get all campaign members
Gets a list of available campaign members.
Get a campaign member
Gets a single campaign member.
Delete a campaign member
Deletes a campaign member.
Campaign Teams
Get all campaign teams
Gets a list of available campaign teams.
Get a campaign team
Gets a single campaign team.
Contacts
Create a contact
Creates a contact from a specified payload.
Get all contacts
Gets a list of available contacts. Optionally, accepts a scope parameter.
Get a contact
Gets a single contact.
Update a contact
Updates a contact from a specified payload.
Archive a contact
Archives a contact.
Restore a contact
Gets an archived contact.
Tickets
Get all tickets
Gets a list of tickets.
Get a ticket
Gets a single ticket.
Transactions
Create a transaction
Creates a transaction from a specified payload.
Get all transactions
Gets a list of transactions.
Get a transactions
Gets a single transactions.
Payouts
Get all payouts
Gets a list of payouts.
Get a payout
Gets a single payout.
Plans
Get all plans
Gets a list of plans.
Get a plan
Gets a single plan.
Funds
Create a fund
Creates a fund from a specified payload.
Get all funds
Gets a list of all available funds
Get a fund
Gets a single fund.
Update a fund
Updates a fund from a specified payload.
Delete a fund
Deletes a fund.
Testing
The package provides a fake implementation of the Givebutter\Client
class that allows you to fake the API responses.
To test your code, ensure you swap the Givebutter\Client
class with the Givebutter\Testing\ClientFake
class in your
test case. Fake responses are returned in the order they are provided while creating the fake client. All responses
have a fake()
method that allows you to easily create a response object by only providing the parameters relevant
for your test case.
After the requests have been sent, there are various methods to ensure that the expected requests were sent:
To write tests expecting the API request to fail, you may provide a Throwable
object as the response.
Givebutter PHP is an open-sourced software licensed under the MIT license.