Skip to content

added stripe files #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions stripe-php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Mac OS X dumps these all over the place.
.DS_Store

# Ignore the SimpleTest library if it is installed to /test/.
/test/simpletest/

# Ignore the /vendor/ directory for people using composer
/vendor/

# If the vendor directory isn't being commited the composer.lock file should also be ignored
composer.lock
12 changes: 12 additions & 0 deletions stripe-php/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: php

php:
- 5.2
- 5.3
- 5.4
- 5.5

before_script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then wget http://iweb.dl.sourceforge.net/project/simpletest/simpletest/simpletest_1.1/simpletest_1.1.0.tar.gz; tar xf simpletest_1.1.0.tar.gz -C test; else composer install --dev --prefer-source; fi"

script: php test/Stripe.php
125 changes: 125 additions & 0 deletions stripe-php/CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
=== 1.10.1 2013-12-02

* Add new ApplicationFee

=== 1.9.1 2013-11-08

* Fix a bug where a null nestable object causes warnings to fire.

=== 1.9.0 2013-10-16

* Add support for metadata API.

=== 1.8.4 2013-09-18

* Add support for closing disputes.

=== 1.8.3 2013-08-13

* Add new Balance and BalanceTransaction

=== 1.8.2 2013-08-12

* Add support for unsetting attributes by updating to NULL.
Setting properties to a blank string is now an error.

=== 1.8.1 2013-07-12

* Add support for multiple cards API (Stripe API version 2013-07-12: https://stripe.com/docs/upgrades#2013-07-05)

=== 1.8.0 2013-04-11

* Allow Transfers to be creatable
* Add new Recipient resource

=== 1.7.15 2013-02-21

* Add 'id' to the list of permanent object attributes

=== 1.7.14 2013-02-20

* Don't re-encode strings that are already encoded in UTF-8. If you
were previously using plan or coupon objects with UTF-8 IDs, they
may have been treated as ISO-8859-1 (Latin-1) and encoded to UTF-8 a
2nd time. You may now need to pass the IDs to utf8_encode before
passing them to Stripe_Plan::retrieve or Stripe_Coupon::retrieve.
* Ensure that all input is encoded in UTF-8 before submitting it to
Stripe's servers. (github issue #27)

=== 1.7.13 2013-02-01

* Add support for passing options when retrieving Stripe objects
e.g., Stripe_Charge::retrieve(array("id"=>"foo", "expand" => array("customer")))
Stripe_Charge::retrieve("foo") will continue to work

=== 1.7.12 2013-01-15

* Add support for setting a Stripe API version override

=== 1.7.11 2012-12-30

* Version bump to cleanup constants and such (github issue #26)

=== 1.7.10 2012-11-08

* Add support for updating charge disputes.
* Fix bug preventing retrieval of null attributes

=== 1.7.9 2012-11-08

* Fix usage under autoloaders such as the one generated by composer
(github issue #22)

=== 1.7.8 2012-10-30
* Add support for creating invoices.
* Add support for new invoice lines return format
* Add support for new list objects

=== 1.7.7 2012-09-14

* Get all of the various version numbers in the repo in sync (no other
changes)

=== 1.7.6 2012-08-31

* Add update and pay methods to Invoice resource

=== 1.7.5 2012-08-23

* Change internal function names so that Stripe_SingletonApiRequst is
E_STRICT-clean (github issue #16)

=== 1.7.4 2012-08-21

* Bugfix so that Stripe objects (e.g. Customer, Charge objects) used
in API calls are transparently converted to their object IDs

=== 1.7.3 2012-08-15

* Add new Account resource

=== 1.7.2 2012-06-26

* Make clearer that you should be including lib/Stripe.php, not
test/Stripe.php (github issue #14)

=== 1.7.1 2012-05-24

* Add missing argument to Stripe_InvalidRequestError constructor in
Stripe_ApiResource::instanceUrl. Fixes a warning when
Stripe_ApiResource::instanceUrl is called on a resouce with no ID
(github issue #12)

=== 1.7.0 2012-05-17

* Support Composer and Packagist (github issue #9)

* Add new deleteDiscount method to Stripe_Customer

* Add new Transfer resource

* Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will
support Basic auth for the indefinite future, but recommends Bearer
auth when possible going forward)

* Numerous test suite improvements
21 changes: 21 additions & 0 deletions stripe-php/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2010-2014 Stripe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
30 changes: 30 additions & 0 deletions stripe-php/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
= Installation

Obtain the latest version of the Stripe PHP bindings with:

git clone https://github.com/stripe/stripe-php

To get started, add the following to your PHP script:

require_once("/path/to/stripe-php/lib/Stripe.php");

Simple usage looks like:

Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$myCard = array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015);
$charge = Stripe_Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;

= Documentation

Please see https://stripe.com/api for up-to-date documentation.

= Tests

In order to run tests you have to install SimpleTest (http://packagist.org/packages/vierbergenlars/simpletest) via Composer (http://getcomposer.org/) (recommended way):

composer.phar update --dev

Run test suite:

php ./test/Stripe.php
1 change: 1 addition & 0 deletions stripe-php/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.10.1
29 changes: 29 additions & 0 deletions stripe-php/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "stripe/stripe-php",
"description": "Stripe PHP Library",
"keywords": [
"stripe",
"payment processing",
"api"
],
"homepage": "https://stripe.com/",
"license": "MIT",
"authors": [
{
"name": "Stripe and contributors",
"homepage": "https://github.com/stripe/stripe-php/contributors"
}
],
"require": {
"php": ">=5.2",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"vierbergenlars/simpletest": "*"
},
"autoload": {
"classmap": ["lib/Stripe/"]
}
}
54 changes: 54 additions & 0 deletions stripe-php/lib/Stripe.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

// Tested on PHP 5.2, 5.3

// This snippet (and some of the curl code) due to the Facebook SDK.
if (!function_exists('curl_init')) {
throw new Exception('Stripe needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Stripe needs the JSON PHP extension.');
}
if (!function_exists('mb_detect_encoding')) {
throw new Exception('Stripe needs the Multibyte String PHP extension.');
}

// Stripe singleton
require(dirname(__FILE__) . '/Stripe/Stripe.php');

// Utilities
require(dirname(__FILE__) . '/Stripe/Util.php');
require(dirname(__FILE__) . '/Stripe/Util/Set.php');

// Errors
require(dirname(__FILE__) . '/Stripe/Error.php');
require(dirname(__FILE__) . '/Stripe/ApiError.php');
require(dirname(__FILE__) . '/Stripe/ApiConnectionError.php');
require(dirname(__FILE__) . '/Stripe/AuthenticationError.php');
require(dirname(__FILE__) . '/Stripe/CardError.php');
require(dirname(__FILE__) . '/Stripe/InvalidRequestError.php');

// Plumbing
require(dirname(__FILE__) . '/Stripe/Object.php');
require(dirname(__FILE__) . '/Stripe/ApiRequestor.php');
require(dirname(__FILE__) . '/Stripe/ApiResource.php');
require(dirname(__FILE__) . '/Stripe/SingletonApiResource.php');
require(dirname(__FILE__) . '/Stripe/AttachedObject.php');
require(dirname(__FILE__) . '/Stripe/List.php');

// Stripe API Resources
require(dirname(__FILE__) . '/Stripe/Account.php');
require(dirname(__FILE__) . '/Stripe/Card.php');
require(dirname(__FILE__) . '/Stripe/Balance.php');
require(dirname(__FILE__) . '/Stripe/BalanceTransaction.php');
require(dirname(__FILE__) . '/Stripe/Charge.php');
require(dirname(__FILE__) . '/Stripe/Customer.php');
require(dirname(__FILE__) . '/Stripe/Invoice.php');
require(dirname(__FILE__) . '/Stripe/InvoiceItem.php');
require(dirname(__FILE__) . '/Stripe/Plan.php');
require(dirname(__FILE__) . '/Stripe/Token.php');
require(dirname(__FILE__) . '/Stripe/Coupon.php');
require(dirname(__FILE__) . '/Stripe/Event.php');
require(dirname(__FILE__) . '/Stripe/Transfer.php');
require(dirname(__FILE__) . '/Stripe/Recipient.php');
require(dirname(__FILE__) . '/Stripe/ApplicationFee.php');
16 changes: 16 additions & 0 deletions stripe-php/lib/Stripe/Account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

class Stripe_Account extends Stripe_SingletonApiResource
{
public static function constructFrom($values, $apiKey=null)
{
$class = get_class();
return self::scopedConstructFrom($class, $values, $apiKey);
}

public static function retrieve($apiKey=null)
{
$class = get_class();
return self::_scopedSingletonRetrieve($class, $apiKey);
}
}
5 changes: 5 additions & 0 deletions stripe-php/lib/Stripe/ApiConnectionError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

class Stripe_ApiConnectionError extends Stripe_Error
{
}
5 changes: 5 additions & 0 deletions stripe-php/lib/Stripe/ApiError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

class Stripe_ApiError extends Stripe_Error
{
}
Loading