Code Monkey home page Code Monkey logo

stripe's People

Contributors

alexander-rieder avatar alexrayan avatar brunogaspar avatar casinelli avatar drsii avatar eaarranz avatar francoisburdy avatar garbee avatar geekpivot avatar grahamcampbell avatar joecohens avatar mathewpeterson avatar monove avatar nemanja95neki avatar nitsuj102284 avatar patapoof avatar squigg avatar suwardany avatar zejdcicak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stripe's Issues

ALL phpdoc is wrong!

All of your code is documented as returning \GuzzleHttp\Message\ResponseInterface but it doesn't. It returns an array...

Question: Calls for Managed Accounts.

I can't seem to find any documentation about making calls for managed accounts.
I can make calls for other accounts using my API. The documentation shows how this can be done like below...
(As CURL - With Headers)

curl https://api.stripe.com/v1/charges/{CHARGE_ID}/refunds \
   -u {PLATFORM_SECRET_KEY}: \
   -H "Stripe-Account: {CONNECTED_STRIPE_ACCOUNT_ID}" \
   -d amount=1000

(Using Stripe PHP Lib)

\Stripe\Customer::create(
  array("description" => "[email protected]"),
  array("stripe_account" => CONNECTED_STRIPE_ACCOUNT_ID)
);

I'm trying to get this working using Laravel 5.2

I have tried the following, but seems to ignore the param.

Stripe::transfers()->all([],[
    'stripe_account' => $stripe_id
]);

Many thanks!

Failed Charge::create() identifier not passed to Exception

Hi!
Is there a possibility of passing a charge identifier to a CardErrorException object?

As it is now, a failed response returns a charge identifier as part of error array but is not being passed to an exception by the package.
Here's a logged body of the response:
[ "error" => [ "message" => "Your card was declined." "type" => "card_error" "code" => "card_declined" "charge" => "ch_18wLSEFL3W3Xf0ocVrORvj1iu" ] ]

I suppose it could be a fairly common scenario when an application would like to internally record a failed charge as well (since it gets created within Stripe) for the logging purposes.

I was looking into Stripe documentation regarding the Error response and it doesn't mention any additional parameters besides type, message, code, and param. But it does, in fact, return "charge" as part of failed charge response.

I'm planning on adding this to my cloned package, but wondering if this is something that can be added in the future release of this master package as well?

Best regards,
Alex

attachStripeCustomer issue

Hi I kept getting a error when trying to connect a stripe customer to a user in my system for example I tried this method

  $customer = Stripe::customer('cus_4pO9BTWtRuwr4l');
    $ent = User::where('email', $customer['email'])->first();
    $ent->attachStripeCustomer($customer);

But I keep getting a error saying that a Cartalyst/Stripe/Api/Response was expected but a Cartalyst/Stripe/Api/Customer was given . so I was able to fix this by changing the AttachStripeCustomer method in the BillableTrait and BillableInterface to

    public function attachStripeCustomer(ResponseClassInterface $customer, $sync = true)
    {
        // Store the Stripe Customer Id
        $this->stripe_id = $customer['id'];
        $this->save();

        // Should we syncronize the data with Stripe?
        if ($sync)
        {
            // Syncronize the data
            $this->syncWithStripe();
        }
    }

with use statement

use Guzzle\Service\Command\ResponseClassInterface ;

I Also change the BillableInterface function definition .

Stripe Package not found

Hey guys,

i've been struggling with this for a couple hours now. Looks like the Stripe package is not included in your statis build.

http://packages.cartalyst.com/#!/stripe 

returns nothing

When I run

composer update/install
I get the following error.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package cartalyst/stripe could not be found in any version, there may be a typo in the package name.

Bad assumption in exception handler

Type error: Argument 1 passed to Cartalyst\Stripe\Exception\Handler::__construct() must be an instance of GuzzleHttp\Exception\ClientException, instance of GuzzleHttp\Exception\ConnectException given

Iterator For Pagination

Would it not be better to return an iterator for the pagination instead of trying to load everything into memory, which will end in a mess for very large data sets.

Guzzle 6

Could you please release a version of this package with support for Guzzle 6?

storeSubscription usage problem in SubscriptionGateway.php

Hey guys,

notice a problem in using storeSubscription. problem happens in this line:

protected function storeSubscription($response, array $attributes = [], Closure $callback = null)
{
    // Get the subscription id
    $stripeId = $response['id']; <--------------------------

In some cases the passed in object is a response and in some cases the object is a subscription.
response's id is a stripe_id however

    $subscription = $this->storeSubscription($response, [
        'ended_at'    => null,
        'canceled_at' => null,
    ]);

a subscription's id is a db id.

    $this->storeSubscription($subscription, [
        'trial_ends_at' => $period,
    ]);

USD getting converted from cents to dollars in Utility class

Working on a Stripe payment integration in several projects and it looks like the amount passed to Charges class POST processing is being converted from cents to dollars in case of currency being USD.
Upon further search, I noticed that Utility has an array of currencies to be excluded from conversion within the needsAmountConversion() method. However, USD is not in that array.
`

{
    $hasCurrency = isset($parameters['currency']);
    $currencies = [
        'BIF', 'DJF', 'JPY', 'KRW', 'PYG',
        'VND', 'XAF', 'XPF', 'CLP', 'GNF',
        'KMF', 'MGA', 'RWF', 'VUV', 'XOF',
    ];

    return ! $hasCurrency || ($hasCurrency && ! in_array($parameters['currency'], $currencies));
}

`

Is this something intentional? How would cents be sent for processing then?

If I want to send $0.50, shouldn't it be 50 for amount value? Amount field expects an integer ("A positive integer in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a 0-decimal currency) representing how much to charge the card. The minimum amount is $0.50 US or equivalent in charge currency.").
As of now, I added USD to the array of $currencies, but I'd appreciate any feedback on this.

Refunds

The stripe API supports using refunds without knowing their charge ID, but cartalyst does not. This makes it impossible to lookup the charge ID if we only know the refund ID, for example.

GuzzleClient not found

Hi I was getting a error during composer update , The theme compiling post command would fail it said that GuzzleClient with missing in src/Api/Stripe.php .
So I don't know weather to change line 316

$client = new GuzzleClient; to $client = new Client;

or change the import to

use Guzzle\Service\Client as GuzzleClient;

or

use Guzzle\Service\GuzzleClient;

Please tag a new version for the AmountConverter changes

The current version (v1.0.3) has a critical bug in it in regards to transforming the amount float into the stripe integer. If you try using a number like 79.99 it transforms it into 7998 and sends that number to stripe.

You have already fixed this with the AmountConverter class but a new version hasn't been tagged yet so cartalyst/stripe-billing-laravel hasn't picked up the change yet.

Catchable Fatal Error

I am attempting to create a customer and am getting the following message:

Catchable fatal error: Argument 1 passed to Cartalyst\Stripe\Exception\Handler::__construct() must be an instance of GuzzleHttp\Exception\ClientException, instance of GuzzleHttp\Exception\RequestException given, called in C:\xampp\htdocs\vendor\cartalyst\stripe\src\Api\Api.php on line 156 and defined in C:\xampp\htdocs\vendor\cartalyst\stripe\src\Exception\Handler.php on line 73

My code is:

$apiKey = 'my_test_api_key';
$apiVersion = '2015-10-16';
$stripe = new Stripe($apiKey, $apiVersion);
$customer = $stripe->customers()->create([
    'email' => $email, //[email protected]
    'description' => $name, //Selma Tucker
]);

quick questions regarding stripe connect

Hi cartalyst,

Does this support Stripe Connect?
https://stripe.com/docs/connect/migrating

Which API version is supported?
I am using 2015-04-07 and wonder if anything will break if I upgrade?
You're upgrading to the latest API version from 2015-04-07.

As stripe documentation suggests:
To start using managed accounts you must first activate your account as a platform. You must also be on at least version “2014-12-17” of the API. If you’re on an older version, please upgrade before migrating to managed accounts.

Why would you want to migrate? Recipients will be deprecated by the end of 2015—we will not break any existing integrations, but we won’t be documenting or maintaining it anymore. Secondly, the new APIs come with a lot of new functionality. If you’ve ever found yourself wishing that recipients worked better (e.g. tax reporting, improved identity verification), you might want to check out the new APIs.

Would love to hear your thoughts on this guys. Let me know if I can assist in any way.

Sam

Guide

Hi, do you have any guide on how to use the library? Thanks!!

Create account

How do you create an account?

I need to use Stripe Connect, and create an account on behalf of the user.

Documentation outdated.

Documentation says:

Migrations

Now you need to migrate your database, but before doing that, you'll need to generate a migration that suits your billable table and to do this you just need to run the following command:

php artisan stripe:table users

however the actual artisan command is

php artisan stripe:migrator users

Class 'Cartalyst\Stripe\Stripe' not found

Hi, forgive me if this is a Symfony2 issue or other, but I've been using cartalyst/stripe in a production application in Symfony2 quite successfully for several months and I'm suddenly having problems, even though I haven't made any changes in my source code. My composer.json specifies "cartalyst/stripe": "1.0.*@dev". After my last composer update, which included an update to this package (but not an update to the symfony framework), my application can no longer find the class Cartalyst\Stripe\Stripe. The exception language is 'Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load class "Stripe" from namespace "Cartalyst\Stripe". Did you forget a "use" statement for another namespace?" at [redacted]/app/cache/prod/appProdProjectContainer.php line 449'. All other vendor files seem to be loading fine, and I see a class called Stripe in namespace Cartalyst\Stripe in my cartalyst vendor directory. Any ideas of what might be going on here? I couldn't find any obvious changes in either the Stripe file or the composer.json for this repository that would trigger this issue, but maybe I'm missing something.

migration issue

HI Ive just created the new migration file which created a migration file named MigrationCartalystVersion1_0_0 but when I try to run the migration I get a error saying the file dose not exists and the error is in line 301 in vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php
The reason for the error its looking for a file named MigrationCartalystVersion100 So I tried to change the file name and class to remove the underscores but that did not help. The only way I could run it was to rename the file and class. When Looking at line 301 in the migrator class it only take the first 4 underscores so I dont know why this is happening.

:)

Stack Trace http://laravel.io/bin/jWNyk

Extending stripe with custom payment processing gateway

It might beg the question why the hell would I want to use something other than Stripe, but unfortunately we don't have Stripe. We do, however, have other processing systems, but charging money is somewhat cumbersome anyway. Because of the laws and regulations regarding private data, you'd have to get a license for storing credit card information, which is obviously not that easy. Not to mention the lack of decent and usable gateways whatsoever.

Most of suitable gateways have the following procedure:

  1. You define a form with encrypted client key signature, amount, invoice id, callback url, etc. And set gateway's payment url as the form action.
  2. Customer submits the form which results in redirect to the gateway. (Or you can submit it via js script call)
  3. Now the customer fills in credit card info and confirms the payment. After that it might redirect you to the bank's 3dsecure verification page. After checking your 3dsecure password the bank will redirect you back to the gateway's payment page with validation result.
  4. Gateway proceeds with payment and submits post webhook with payment status and shows success/failure page (with another redirect link back to our site).

This must be done every time you want to charge user, meaning no planned charges or saved cards.

What I want to do is too keep all the infrastructure of stripe package (invoices, charges, subscriptions, plans, etc), but to rewrite actual charging steps. I.e. it won't involve cards, and payment process/validation will be slightly different. Instead of just charging saved customer card I'll need to be sending an invoice with payment link.

Could you please point me to the right direction, if it's possible.

BindingResolutionException

Target [Cartalyst\Stripe\ConfigInterface] is not instantiable

Get this exception when using your laravel package. The interface is never bound to a concretion?

Update to Guzzle 5

It makes sense to upgrade to Guzzle 5 as it's way more faster, the only issue is that the required Guzzle package (guzzlehttp/guzzle-services) doesn't have a stable release as of yet, it's on 0.5 at this moment, which isn't that bad, but the lack of documentation makes it a bit of a challenge :)

Adding a card: user_id cannot be null - It isn't

Hi ya guys,

I am adding a card. Stripe is accepting it fine. However, I am trying to store the returned data to the migrated Cards Model.

I am getting an SQL error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'users_id' cannot be null (SQL: insert into `cards` (`users_id`, `stripe_id`, `brand`, `funding`, `last_four`, `exp_month`, `exp_year`, `updated_at`, `created_at`) values (, card_14Vpoe20GnW0HilOq2P6D9hw, Visa, credit, 4242, 1, 2017, 2014-08-26 19:41:16, 2014-08-26 19:41:16))

I am passing the users_id through and have checked it is in the array being passed. I can't seem to figure out why it isn't accepting it.

Any ideas to why this isn't working? Many thanks guys.

Cards Model

use Platform\Attributes\Models\Entity;
class Cards extends Entity {

    /**
     * Relate Users
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function users()
    {
        return $this->belongsTo('\Movo\Users\Admin\Users', 'users_id', 'user_id');
    }
}

User Model

use Cartalyst\Stripe\Billing\BillableTrait;
use Cartalyst\Stripe\Billing\BillableInterface;

class User extends Entity implements GroupableInterface, PermissibleInterface, PersistableInterface, UserInterface, PresentableInterface, BillableInterface {

    use BillableTrait;
    /**
     * Relate Cards
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function cards()
    {
        return $this->hasMany('\Movo\Cart\Models\Cards', 'users_id', 'user_id');
    }
}

Store Card Method

public function storeCard() {

//        dd(Input::all());

        $customerID = Input::get('stripeID');
        $cardToken = Input::get('stripeToken');
        $card = Input::get('card');
        $id = Input::get('users_id');

        $update_card = new $this->cards([
            'users_id'      => $id,
            'stripe_id'     => $card['stripe_id'],
            'brand'         => $card['brand'],
            'funding'       => $card['funding'],
            'last_four'     => $card['last_four'],
            'exp_month'     => $card['exp_month'],
            'exp_year'      => $card['exp_year'],
        ]);

        $update_card['users_id'] = $id;

        $user = $this->users->find($id);

        // Save the card
        $user->cards()->save($update_card);

        // Send the card data to Stripe
        Stripe::cards()->create([
            'customer' => $customerID,
            'card'     => $update_card,
        ]);

        return $this->showForm('update', $id);
    }

WAMP - GuzzleHttp \ Exception \ RequestException cURL error 60: SSL certificate problem

I am using WAMP 2.5 with PHP 5.5.12 and Apache 2.4.9 with Windows 8.1.

I am working on Laravel 4.2 project and recently I've installed this package using composer. I am trying to create token using your package's sample code https://cartalyst.com/manual/stripe/1.0#tokens , with localhost. The sample code is as below :

$stripe = new Stripe;
$stripe = Stripe::make('my-stripe-test-public-key');

$token = $stripe->tokens()->create([
'card' => [
'number' => '4012888888881881',
'exp_month' => '05',
'cvc' => '123',
'exp_year' => '2016'
],
]);

But I'm getting this error :

GuzzleHttp \ Exception \ RequestException

cURL error 60: SSL certificate problem: unable to get local issuer certificate

I've tried different solutions like setting
curl.cainfo="cacert.pem" in php.ini also used ca-bundle.crt with the same, restarted WAMP many times but any solution is not working.

I've open_ssl module and cURL enabled in php as well as in apache. Can you please provide me any solution??

fileUpload returns guzzle object

When doing a call like this

$response = $stripe->fileUploads()->create($file,'identity_document');

$response is a guzzle object instead of the fileUpload object.

Currently, in order to get the contents I must do

json_decode($response->getBody()->getContents());

Idempotent key length is 0, which is outside accepted lengths

On my live server, when I'm trying to create a customer I receive the following error:

Idempotent key length is 0, which is outside accepted lengths. Idempotent Keys must be 1-255 characters long. If you're looking for a decent generator, try using a UUID defined by IETF RFC 4122.

I'm not trying to set an idempotency key. However if I try to set an idempotency key I receive the same error message.

I'm using
cartalyst/stripe v2.0.5
cartalyst/stripe-laravel v4.0.1

This is my code
\Stripe::customers()->create([ 'source' => $request->get('stripeToken'), 'email' => $user->email);

Same code works on my development machine with the same version of composer packages.

Floats for storing money?

Why is float being used to store currency values over a decimal field? Float storage is known to not accurately represent currency since it doesn't work in base 10.

If things are going to be stored in cents, then an integer field type should be used. Otherwise a decimal type should be used since it can accurately store currencies.

Is it possible to charge a specific users card?

I've started to use the Library with Laravel 5.1, its very good and it's helped me a lot.

Once thing I can't see in the code or documentation is how to charge a specific users card. Is this possible to do?

Using Alias throws exception

This used to work for me

Stripe::charge($charge_id);

currently throws error Undefined variable: pluralMethod

Where as using it this way still works.

return Stripe::charges()->find([
            'id' => $charge_id,
        ]);

Billable all gone?

While I agree with the intention that @brunogaspar is recommending with this commit, fd3aee2 I do find it a touch scary that this was done before the other package was available.

Wouldn't bumping the major version be a good idea with this breaking change as well to not break anything targeting 0.2.0?

Looking forward to the new package, when its ready.

[Proposal] Create customer's recurring profile along with credit card details and subscription plan

As per Stripe document https://stripe.com/docs/subscriptions#subscribing-a-customer-to-a-plan , if I provide the credit card details and plan while creating a new customer, the card will be charged immediately and will return the response once done. My project requirement is the same. I want to subscribe the customer to a recurring plan while creating him and also want the first payment must be done immediately that I may mark him as verified and he should be able to login to my system.

Is it possible using your package?

Pagination

Hi guys, is there a pagination example anywhere? The docs are inconclusive about it.

Just below this section it states you can use this to create pagination.

Stripe::customersIterator()

Doesn't state: a) how many is in the page b) which page your on c) how to query a specific pages?

https://cartalyst.com/manual/stripe/1.0#usage-2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.