Download the PHP package reason-digital/virgin-money-giving-api without Composer

On this page you can find all versions of the php package reason-digital/virgin-money-giving-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package virgin-money-giving-api

Build Status

Coverage Status

README

Provides a PHP library for interacting with the Virgin Money Giving API.

This library will help with pushing and pulling data from the API. Unfortunately the API has quite a few undocumented quirks that this library hopes to stop developers falling into.

Prerequisites

API Keys

To interact with the VGM API you will need to get API keys. To do this you'll need to register on the site (https://developer.virginmoneygiving.com/member/register).

You will need to create an application here on the Apps overview page: /apps/myapps.

Then on your keys overview page you can grab your API key: /apps/mykeys.

For some reason you will need different API keys for different API calls. The list can be found here:

https://developer.virginmoneygiving.com/our_apis

Test data

When testing against the Sandbox there are a few bits of test data already setup:

Charities

Name Resource ID
Charity2 6a5880c9-13e4-4cf4-987e-931f3899b9d5
Cancer Charity 8da32779-1c1b-4d20-8714-df3219836618

Fundraisers

@todo - If there are any

Events

@todo - Grab some default ones

Installation

Install the latest version with:

Usage

Fundraiser search

To use the fundraiser search you'll need to use your fundraiser developer API key. Any other key will return a 403 response.

$response is then an instance of the Responses/FundraiserSearchResponse.php class. This has a hasMatches(): bool method.

Fundraiser account create

To create fundraiser accounts you'll need to use your fundraiser developer API key. Any other key will return a 403 response.

There are a few gotchas with this API call. First is that the callback url you pass to createFundraiserAccount needs to match what you have setup in your VMG account or you wont get an access code back with the response. Instead you'll get the following response:

OAuth access token not created. Error Code: <-2001> Message: <Invalid redirect_uri> Description: <N/A>

If the callback url matches then you'll get the following response:

Token expires in 1500 seconds

This access code is valid for 1500 seconds and allows to to create a fundraising page on the fundraisers behalf.

There are some fields that have validation. They can be found here: Models/FundraiserTest.php

$fundraiserResponse is then an instance of the Responses/FundraiserCreateResponse.php class.

This has the Fundraiser and also the access code returned.

Fundraiser page create (with token)

NOTE: First off you'll need an access token to create a page on behalf of the user. This is only available when you have created the users account programmatically as above.

If you don't have this, then the below will not work.

First off we're assuming you have the following:

Then

$pageCreateResponse is then an instance of the Responses/PageCreateResponse.php class.

This has the Page and the page URI. accessed via: $pageCreateResponse->getPageURI();

Running tests

Travis CI is setup to run tests on PRs and master. To run tests locally you will need to pull down the repo with the dev dependencies by running:

composer self-update composer install --prefer-source --no-interaction --dev

Once installed running phpunit will run tests.

Roadmap


All versions of virgin-money-giving-api with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ~6.0
rap2hpoutre/convert-accent-characters Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package reason-digital/virgin-money-giving-api contains the following files

Loading the files please wait ...