Download the PHP package starteed/crowdfunding without Composer

On this page you can find all versions of the php package starteed/crowdfunding. 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 crowdfunding

Starteed SELF PHP API wrapper

Official Starteed SELF PHP API wrapper: help to read public data of Starteed SELF campaigns.

Widely inspired by Sparkpost PHP API wrapper.

Still in alpha version.

Authentication is provided with API key: contact our support to get one.

Installation

Install Composer first

curl -sS https://getcomposer.org/installer | php

Starteed SELF requires a php-http client: we suggest Guzzle6.

composer require php-http/guzzle6-adapter

Next install the package.

composer require starteed/crowdfunding

Setting up a Request Adapter

Because of dependency collision, we have opted to use a request adapter rather than requiring a request library. This means that your application will need to pass in a request adapter to the constructor of the Starteed SELF Library (we chose HttpPlug). Please visit their repo for a list of supported clients and adapters. If you don't currently use a request library, you will need to require one and create a client from it and pass it along. The example below uses the GuzzleHttp Client Library.

A Client can be setup like so:

Localization

Localization is provided by Accept-Language header: you can pass a dash or underscore value (e.g.: it_IT or it-IT) or just the language ISO code in the configuration array.

$http_client = new GuzzleAdapter(new Client);
$starteed = new Crowdfunding($http_client, [
    'platform' => 'myplatform.starteed.com',
    'language' => 'en_US'
]);

Note that if the language locale is not available all the results will be translated with default language as fallback

Campaigns

Paginated results

/**
 * @var Starteed\Resources\CampaignResource[] $campaigns
 */
$campaigns = $starteed->campaigns()->all();

// Grabbing first element of the data array
$campaign = $campaigns()->data[0];

$campaign->translation->title
# My campaign title

$campaign->goal
# 15000

$campaign->currency
#{
#    "id": 1,
#    "code": "EUR",
#    "symbol": "€",
#    "label": "Euro"
#}

$campaign->currency->label
# Euro

Retrieve by ID

$campaign = $starteed->campaigns()->retrieve(1);

$campaign->translation->title
# My campaign title

$campaign->goal
# 15000

$campaign->duration
#{
#    "start": 1476264100,
#    "end": 1479427200,
#    "is_non_stop": false
#}

Rewards

Paginated results

/**
 * @var Starteed\Resources\RewardResource[] $rewards
 */
$rewards = $starteed->campaigns()->retrieve(1)->rewards->all();

// Grabbing first element of the data array
$reward = $campaigns()->data[0];

$reward->image
# "rewards/57fcce15a573a.jpg"

$reward->is_active
# true

$reward->estimated_shipping
# 1476662400

$reward->translation->description
# The reward description chosen by campaign admin

Retrieve by ID

$reward = $starteed->campaigns()->retrieve(1)->rewards()->retrieve(2);

$reward->amount
# 50

FAQs

Paginated results

/**
 * @var Starteed\Resources\FaqResource[] $faqs
 */
$faqs = $starteed->campaigns()->retrieve(1)->faqs->all();

// Grabbing first element of the data array
$faq = $faqs[0];

$faq->translation->question
# "Is this a question?"

$faq->translation->answer
# "It looks like it!"

Retrieve by ID

$faq = $starteed->campaigns()->retrieve(1)->faqs()->retrieve(2);

$faq->translation->question
# "Are donations deductible?"

$faq->translation->answer
# "Yes, of course: you will receive a receipt via email once the donation is confirmed!"

Donors

Paginated results

/**
 * @var Starteed\Resources\DonorResource[] $donors
 */
 $donors = $starteed->campaigns()->retrieve(1)->donors()->all();

// Grabbing first element of the data array
$donor = $donors[0];

$supporter->firstname
# "John"

$supporter->lastname
# "Doe"

Retrieve by ID

$donnor = $starteed->campaigns()->retrieve(1)->donors()->retrieve(2);

$donor->email
# "[email protected]"

All versions of crowdfunding with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
php-http/discovery Version ^1.1
php-http/httplug Version ^1.0
php-http/message Version ^1.0
symfony/event-dispatcher Version ^3.2
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 starteed/crowdfunding contains the following files

Loading the files please wait ....