Giter Club home page Giter Club logo

stripe-laravel's People

Contributors

brunogaspar avatar cborgia avatar grahamcampbell 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  avatar  avatar

stripe-laravel's Issues

Update for guzzlehttp 6

On Laravel 5.1

Guzzlehttp 6 is the latest and stripe-laravel's dependency on 5 is stopping other packages being installed.

php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: remove cartalyst/stripe-laravel v2.0.3
- Conclusion: don't install cartalyst/stripe-laravel v2.0.0
- Conclusion: don't install guzzlehttp/guzzle 6.0.2|install cartalyst/stripe-laravel v2.0.0
- Conclusion: remove guzzlehttp/guzzle 5.3.0|install guzzlehttp/guzzle 6.0.2
- Installation request for simplesoftwareio/simple-sms ^2.0 -> satisfiable by simplesoftwareio/simple-sms[2.0.0].
- Conclusion: don't install cartalyst/stripe-laravel v2.0.2|install guzzlehttp/guzzle 6.0.2
- Conclusion: don't install cartalyst/stripe-laravel v2.0.3|install guzzlehttp/guzzle 6.0.2
- cartalyst/stripe-laravel v2.0.1 requires cartalyst/stripe 1.0.* -> satisfiable by cartalyst/stripe[v1.0.3, v1.0.0, v1.0.1, v1.0.2].
- cartalyst/stripe v1.0.3 requires guzzlehttp/guzzle ~5.2 -> satisfiable by guzzlehttp/guzzle[5.3.0, 5.2.0].
- cartalyst/stripe v1.0.3 requires guzzlehttp/guzzle ~5.2 -> satisfiable by guzzlehttp/guzzle[5.3.0, 5.2.0].
- cartalyst/stripe v1.0.2 requires guzzlehttp/guzzle ~5.2 -> satisfiable by guzzlehttp/guzzle[5.3.0, 5.2.0].
- cartalyst/stripe v1.0.1 requires guzzlehttp/guzzle ~5.2 -> satisfiable by guzzlehttp/guzzle[5.3.0, 5.2.0].
- cartalyst/stripe v1.0.0 requires guzzlehttp/guzzle ~5.2 -> satisfiable by guzzlehttp/guzzle[5.3.0, 5.2.0].
- Can only install one of: guzzlehttp/guzzle[6.0.0, 5.3.0].
- Can only install one of: guzzlehttp/guzzle[6.0.0, 5.2.0].
- simplesoftwareio/simple-sms 2.0.0 requires guzzlehttp/guzzle ~6 -> satisfiable by guzzlehttp/guzzle[6.0.0, 6.0.1, 6.0.2].
- Conclusion: don't install cartalyst/stripe-laravel v2.0.1|don't install guzzlehttp/guzzle 6.0.1|keep guzzlehttp/guzzle 5.3.0
- Installation request for cartalyst/stripe-laravel 2.0.* -> satisfiable by cartalyst/stripe-laravel[v2.0.0, v2.0.1, v2.0.2, v2.0.3].

Cartalyst Stripe Terminal

Hi,
The Cartalyst library that this depends on has recently (2.2) added Terminal ability.
Would you know how to do something like this \Stripe\Terminal\ConnectionToken::create() using this library?
Thanks

Laravel 5.8

Please update for Laravel 5.8. You already have it in your master, please make a release.

SCA with version 8.* available?

I am using a strip with laravel and now I want to update the payment process with SCA so for this I want to implement the payment intent process

The current version of the strip is 2.0
and the current version of laravel- strip is 8.*

Can you please tell me that payment intent is available in the above versions or i need to update the composer to get the latest t changes regarding the payment intent.

Please suggest how can I migrate charge API to payment intent API

Thanks

Are you going to update this package for matching SCA in September 2019?

Starting in September 2019, a new regulation called Strong Customer Authentication (SCA) will require businesses in Europe to request additional authentication for online payments. The Payment Intents API fully supports SCA—including exemption logic—and ensure that you only ask customers to provide additional authentication when strictly necessary.

THE PAYMENT INTENTS API IS SCA-READY

https://stripe.com/docs/payments/payment-intents

Are you going to add this support in this package by anytime soon? Or if you have already prepared any other package for the same, can you please share the link?

Thanks!

How to use EphemeralKey

$stripe = Stripe::make('my_security_key');

$customer = $stripe->customers()->create([
'email' => 'my_email',
]);

$key = $stripe->EphemeralKey()->create(['customer' => $customer['id']]);

return $key;

image

NPM Install results in: Invalid package name

I've been using the Cartalyst stripe-laravel package for years now in my Laravel project with Composer. But we've just started working with NPM and I'm running into an issue with "npm install" throwing an error on the package name.

"cartalyst/stripe-laravel": name can only contain URL-friendly characters

npm install
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "cartalyst/stripe-laravel": name can only contain URL-friendly characters

Here's the salient section of composer.json. If I remove the "cartalyst/stripe-laravel": "^13.0", line the npm install runs fine.

"require": {
    "php": "^7.4",
    "algolia/algoliasearch-client-php": "^2.4",
    "algolia/scout-extended": "^1.9",
    "arku/nova-multiselect": "dev-master",
    "cartalyst/stripe-laravel": "^13.0",
    "davidpiesse/nova-maintenance-mode": "^0.0.5",

Any ideas?

Thank you.

Evelyn

Stripe::account()->create($account) failing

I'm running Stripe::account()->create($account) in test mode with every possible field it could need, and I'm getting:

FatalErrorException in Handler.php line 123:
Call to undefined method Cartalyst\Stripe\Exception\ApiLimitExceededException::setErrorCode()

Updating a connected account

I have created a connected account setting managed attribute to true.
I can see It información my connected accounts list but stripe says i have to verify it using API.
How can I do that? Reading documentation i have found how to update charges. But not about accounts.

Bump version for Laravel 5.3

Can we get an official release that is compatible with Laravel 5.3? As far as I can tell it should just need the Laravel version bumped up in composer.json.

Using idempotency_key

When using your package to create a charge I had an issue where a user could click the submit button multiple times and submit multiple charges.

I read in the official Stripe documentation that you can set a idempotency_key on the Charge object to avoid such situations.

So, I tried the following:

$charge = $stripe->charges()->create([
    'amount' => $amount,
    'currency' => $currency,
    'card' => $token,
    'description' => $description,
    'statement_descriptor' => 'Newable Ventures',
    'receipt_email' => $user->email
  ], [
        "idempotency_key" => $user->id
  ]);

I also see that the package uses a Stripe config file at vendor\cartalyst\stripe\src\Config.php

This file contains the following:

/**
 * {@inheritdoc}
 */
public function setIdempotencyKey($idempotencyKey)
{
    $this->idempotencyKey = $idempotencyKey;

    return $this;
}

So, you can set it, however when I send the request I do not see the additional key anywhere.

Sometimes I get the card to be charged multiple times instead of only one

Your Environment

  • AWS Elastic Beanstalk
  • OS and Version: 64bit Amazon Linux/2.9.0
  • PHP Version: 7.3
  • Stripe Laravel Version: V3
  • Laravel Version: 5.8

Expected behavior

Charge card one time only

Actual behavior

Sometimes it charge card more than one time.

Steps to reproduce

       try {
            $charge = Stripe::charges()->create([
                'currency' => 'GBP',
                'amount'   => $request->amount,
                'source' => $request->stripeToken,
                'receipt_email' => env('RECEIPT_EMAIL', '[email protected]'),
                'metadata' => [
                    'job_id' => $request->id,
                ], 

            ]);
            // save this info to your database
            JobController::setStatus($request->id, 'booked');
            JobController::setMeta($request->id, 'paymentMethod', 'credit'); 

            // If new user
            if($request->customerEmail)  {
                JobController::setCustomer($request->id, $request->customerEmail);
            }

            //send book emails
            EmailBookController::send($request->id);

            // SUCCESSFUL
            return 'success';
        } catch (CardErrorException $e) {
            // save info to database for failed
            return response()->json([
                'error' => [
                    'message' => $e->getMessage()
                ]
                ], 422);
        }`

*If your issue requires any specific steps to reproduce, please outline them here.*

Question About Branches

Aliasing your master to 2.0 and having a 2.0 branch as well is wrong surely? What does composer even do for working out which branch is wanted for 2.0.*@dev?

Payment Error : Sending credit card numbers directly to the Stripe API is generally unsafe

In Laravel 5.1, we implemented version 3.0 of this package. It was working fine but from some time whenever I will go for payment module it shows below error. please check attached screenshot. It was working fine but from last 2 to 3 weeks ti shows this error and payment becomes fail. Right now we are working on a production server with live API.

PHP Version : PHP Version 7.0.22-0ubuntu0.16.04.1

Laravel Version : 5.1

Package Version : "cartalyst/stripe-laravel": "3.0.*"

capture

Creating a charge with application fee in a connected account

I have successfully create a charge to a connected account to my connect platform with this code.
$stripe = Stripe::make('');

	$charge = $stripe->charges()->create([
	    'currency' => 'EUR',
	    'amount'   => 100,
        'source' => "tok_es",
        "application_fee" => 1,
	],[
        'stripe_account' => '<connected account id>'
    ]);

It works fine. But I have a problem when I try to add an application fee. I'm trying this code.

  $stripe = Stripe::make('<test key>');

	$charge = $stripe->charges()->create([
	    'currency' => 'EUR',
	    'amount'   => 100,
        'source' => "tok_es",
        "application_fee" => 1,
	],[
        'stripe_account' => '<connected account id>'
    ]);

I get following error.

Can only apply an application_fee when the request is made on behalf of another account (using an OAuth key, the Stripe-Account header, or the destination parameter).

How can I collect application fees?

Best regards

Guzzle 6.0

The fact that the Laravel 5.1 version seems to require Guzzle 5.3 is causing problems for me. Any plans on updating the Guzzle version for the 3.0 Cartalyst version?

cartalyst/stripe v1.0.0 requires guzzlehttp/guzzle ~5.2

I have guzzlehttp/guzzle installed on my application (6.1,as a dependency of another package) and cartalyst/stripe-laravel will not install. I need cartalyst/stripe v1.0.0 installed which is asking for guzzlehttp/guzzle ~5.2

Any thoughts on how to get the 2 to play nice and allow me to install on my Laravel 5.1 application?

statement_descriptor provided, bank still shows "Stripe"

Currently using v. 5.0.*. I've provided a statement_descriptor in my API call to create a charge for a customer, but the bank still reflects the default "Stripe".

 $charge = $this->stripe->charges()->create([
     'customer' => $this->account->Stripe_CustomerID,
     'source' => $card->StripeCardID,
     'currency' => 'USD',
     'amount' => $amount,
     'statement_descriptor' => "Example.com"
]);

The Stripe log shows the statement_descriptor also.

{
  "customer": "cus_B8****Js2Gi",
  "source": "card_1A*****i5YemL",
  "currency": "USD",
  "amount": "5499",
  "statement_descriptor": "Example.com"
}

Issue on exception handling

Hello,

I am using laravel. We are unable to handle exception.

Here is my code

try {
$card = $stripe->cards()->create('stripeid', [
'number' => '4242424242424242',
'exp_month' => '05',
'cvc' => '123',
'exp_year' => '2018'
]);

} catch (Cartalyst\Stripe\Exception\NotFoundException $e) {
$message = $e->getMessage();
}
catch (Cartalyst\Stripe\Exception\BadRequestException $e) {
$message = $e->getMessage();
}
catch (Cartalyst\Stripe\Exception\InvalidRequestException $e) {
$message = $e->getMessage();
}
catch (Cartalyst\Stripe\Exception\CardErrorException $e) {
$message = $e->getMessage();
}

catch (Cartalyst\Stripe\Exception\NotFoundException $e) {
$message = $e->getMessage();
}

What is wrong with code

Update for Laravel 5.1

While issue #2 was said to be resolved nearly two months ago, installation still fails using Laravel 5.1.x:

composer require cartalyst/stripe-laravel ~2.0
./composer.json has been updated
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install cartalyst/stripe-laravel v2.0.2
    - Conclusion: don't install cartalyst/stripe-laravel v2.0.1
    - Conclusion: remove laravel/framework v5.1.8
    - Installation request for guzzlehttp/guzzle == 6.0.2.0 -> satisfiable by guzzlehttp/guzzle[6.0.2].
    - Installation request for cartalyst/stripe-laravel ~2.0 -> satisfiable by cartalyst/stripe-laravel[v2.0.0, v2.0.1, v2.0.2].
    - Conclusion: don't install laravel/framework v5.1.8
    - cartalyst/stripe-laravel v2.0.0 requires illuminate/support 5.0.* -> satisfiable by illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4].
    - don't install illuminate/support v5.0.22|don't install laravel/framework v5.1.8
    - don't install illuminate/support v5.0.25|don't install laravel/framework v5.1.8
    - don't install illuminate/support v5.0.26|don't install laravel/framework v5.1.8
    - don't install illuminate/support v5.0.28|don't install laravel/framework v5.1.8
    - don't install illuminate/support v5.0.33|don't install laravel/framework v5.1.8
    - don't install illuminate/support v5.0.0|don't install laravel/framework v5.1.8
    - don't install illuminate/support v5.0.4|don't install laravel/framework v5.1.8
    - Installation request for laravel/framework == 5.1.8.0 -> satisfiable by laravel/framework[v5.1.8].

Installation failed, reverting ./composer.json to its original content.

SKU price conversion disagrees with documentation.

I'm using Laravel 5.2 with the appropriate stripe-laravel version, and have run into an issue. In the documentation it states that the price being passed for a SKU should be a positive integer representing the amount of the smallest currency unit. In my case, using USD, I would submit 100, which should be $1. However, the currency conversion in the package converted this to be $100, or 10000 cents. Any time I would pass an integer, I would consistently be submitting 100 times the price I intended.

The conversion did work fine for a decimal, though the feature is undocumented.

Stripe API Key is not defined - Laravel

I've installed everything according to documentation and I get this message when I try to create a card using an array. What can cause it?

ENV has STRIPE_KEY and STRIPE_SECRET

Use STRIPE_KEY from database.

Hello! Thank you for the package! It's very useful and saves me a lot of headaches.
I'd like to be able to change Stripe Credentials from the web interface so I need to put them in the database and use them this way. Is it possible to achieve this with this package?

Thank you in advance!

SCA not working

Your Environment

  • OS and Version: CentOS 7
  • PHP Version: 7.3
  • Stripe Laravel Version: 2.4.2

Expected behaviour

Stripe SCA compliant payments

Actual behaviour

All transactions are marked as not compliant, getting this message "Your account has payments (like this one) in live mode using the Charges API, which does not support the authentication requirements of SCA."

Steps to reproduce

I've followed the official manual so not sure what's the issue, to be honest

Use multiple Stripe accounts

I'm wanting to use this package rather than the native Stripe API that I'm currently using, but the problem is I have two Stripe accounts: one US-based and one UK-based.

My site deals with transactions for both accounts. How would I go about switching between them on a transaction-by-transaction basis?

Any advice much appreciated.

UnauthorizedException when using Stripe LIVE keys

I don't know what I'm missing here. I've used this package for one of our app. We didn't encountered any errors using a Stripe TEST account until recently we made a go for this on a Stripe LIVE account. Somehow, an UnauthorizedException from this package is thrown.

Environment: Laravel 5.1
Stripe-laravel v3.0.2
Service Providers is set up properly. Added in config/app.php

$providers =[
     ...
     'Cartalyst\Stripe\Laravel\StripeServiceProvider' 
];

...

$aliases = [
     ...
     'Stripe' => 'Cartalyst\Stripe\Laravel\Facades\Stripe',
];

Added keys in config/services.php

return [
    ....
    'stripe' => [
         'model'  => App\User::class,
         'key'    => '<LIVE_PK_KEY_HERE>',
         'secret' => '<LIVE_SECRET_KEY_HERE>',
    ]
    ...

Steps made:

  1. php artisan tinker
  2. use Stripe
  3. Stripe::customers()->all()

Returns below:
Cartalyst\Stripe\Exception\UnauthorizedException with message 'Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.'

OR

  1. php artisan tinker
  2. Cartalyst\Stripe\Laravel\Facades\Stripe::make('<LIVE_SECRET_KEY_HERE>')
  3. Cartalyst\Stripe\Laravel\Facades\Stripe::customers()->all(),

Returns same error above.

I can conclude that this package is at fault and that my TLS is updated and is working with the code snippet below and its result:

<?php
// Include stripe-php as you usually do, either with composer as shown,
// or with a direct require, as commented out.
require_once("vendor/autoload.php");
// require_once("/path/to/stripe-php/init.php");

\Stripe\Stripe::setApiKey("<LIVE_SECRET_KEY_HERE>");
\Stripe\Stripe::$apiBase = "https://api-tls12.stripe.com";
try {
  \Stripe\Charge::all();
  echo "TLS 1.2 supported, no action required.";
} catch (\Stripe\Error\ApiConnection $e) {
  echo "TLS 1.2 is not supported. You will need to upgrade your integration.";
}
?>

OUTPUTS: TLS 1.2 supported, no action required.

Documentation for Payment intent

There does not seem to be documentation on how to use payment intent to comply with SCA. Or I missed it... Does it exist? It would help to understand how to make the Stripe integration SCA compliant. Thank you

Catching exceptions

I'm developing an application using laravel and Crudbooster.
I want to catch card exceptions.
I have this code.
try{
$stripe = Stripe::make($key);

	       	$token = $stripe->tokens()->create([
	            'card' => [
	                'number'    => $cobro->tarjeta,
	                'exp_month' => $card_date[0],
	                'cvc'       => $cobro->cvv,
	                'exp_year'  => '20'.$card_date[1],
	            ],
	        ]);

	        //Log::info('token: '.print_r($token, true));

	       	$charge = $stripe->accountId('acct_XXXXXXXXXX')->charges()->create([
	            'currency' => 'EUR',
	            'amount'   => $cobro->importe,
	            'source' => $token['id'],
	            'description' => $cobro->descripcion,
	            //'source' => 'tok_es',
	            "application_fee" => $application_fee,
	        ]);
       		
       	}catch(Cartalyst\Stripe\Exception\CardErrorException $e){
       		Log::error("Se ha procudido una excepcion ".$e->getMessage());
       	}

But exception is not catched and Whoops error of laravel is shown

"bindShared" is deprecated

It's been deprecated for a while, but was officially deprecated in 5.1 and was removed in 5.2.

Please use "singleton" instead.

I can send a PR after you've done the branch merge from our other PR @brunogaspar.

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.