diff --git a/composer.json b/composer.json index 857838c..f9275cc 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ "require": { "php": ">=5.6.4", "laravel/framework": "5.3.*", - "zondicons/blade-bridge": "^0.1.0" + "zondicons/blade-bridge": "^0.1.0", + "stripe/stripe-php": "^4.3" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/composer.lock b/composer.lock index 26f218e..c9f68df 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "aa61d5762f0cbc8027e79c0b940a6b7d", - "content-hash": "50e4deb4c8728b5460bf609f167ef2b2", + "hash": "8cdff7401ffaa77e712fc773720a0a25", + "content-hash": "4283a0ebb9e0602a14c02b45b50cb2d7", "packages": [ { "name": "classpreloader/classpreloader", @@ -1027,6 +1027,61 @@ ], "time": "2016-10-02 15:51:17" }, + { + "name": "stripe/stripe-php", + "version": "v4.3.0", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "234bcbd7483873c8762a67dfbdf2e6594b0a2ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/234bcbd7483873c8762a67dfbdf2e6594b0a2ecc", + "reference": "234bcbd7483873c8762a67dfbdf2e6594b0a2ecc", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~0.6.1", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ], + "time": "2016-11-30 19:16:32" + }, { "name": "swiftmailer/swiftmailer", "version": "v5.4.3", diff --git a/tests/unit/Billing/StripePaymentGatewayTest.php b/tests/unit/Billing/StripePaymentGatewayTest.php new file mode 100644 index 0000000..9ea1ddb --- /dev/null +++ b/tests/unit/Billing/StripePaymentGatewayTest.php @@ -0,0 +1,29 @@ + [ + "number" => "4242424242424242", + "exp_month" => 1, + "exp_year" => date('Y') + 1, + "cvc" => "123" + ] + ], ['api_key' => config('services.stripe.secret')])->id; + + // Create a new charge for some amount using a valid token + $paymentGateway->charge(2500, $token); + + // Verify that the charge was completed successfully + } +}