cartalyst / stripe-laravel Goto Github PK
View Code? Open in Web Editor NEWCartalyst Stripe package integration for Laravel.
License: BSD 3-Clause "New" or "Revised" License
Cartalyst Stripe package integration for Laravel.
License: BSD 3-Clause "New" or "Revised" License
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].
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
I'm not finding much of anything is documentation and examples for Laravel 5.
Is there something being worked on, or am I missing it? All I see is https://cartalyst.com/manual/stripe/1.0#laravel
I would like to use connect in stripe.
Create new accounts and connect them to my platform.
https://stripe.com/docs/connect
Is there any possibility with this library?
From which version cartalyst/stripe-laravel support SCA?
Thanks
Please update for Laravel 5.8. You already have it in your master, please make a release.
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
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!
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
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()
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.
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.
Would appreciate if you can add support for Laravel 5.7.
Thanks.
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.
Charge card one time only
Sometimes it charge card more than one time.
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.*
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
?
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.*"
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
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?
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?
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"
}
Can anyone let me know how can I charge a customer later on via cron job?
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
what is The card unique identifier? is this the Token? How do i get the cardID?
Retrieves the details of an existing credit card.
$card = $stripe->cards()->find('cus_4EBumIjyaKooft', 'card_4DmaB3muM8SNdZ');
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.
I'm getting following error on Laravel 5.5. I have tried to reinstall both laravel and cartalyst but no luck.
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.
Will there be a v11.0.0 tag soon? ;)
Stripe is changing the payment methods introducing SCA: https://stripe.com/docs/strong-customer-authentication
Is this package ready?
Stripe has integrated payment intents in order to be able to manage SCA, but it's needed some method from stripe api that i can't find on cartalyst.com like \Stripe\Paymentintent
I've searched all over the website but I wasn't able to find anything
Any plans for a release with support for Laravel 5.4?
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
Cartalyst\Stripe\Exception\MissingParameterException : The statement descriptor must be at most 22 characters. 1 year period with auto renew is 29 characters long.
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!
Stripe SCA compliant payments
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."
I've followed the official manual so not sure what's the issue, to be honest
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.
Hello,
If a card issuer declines a payment, Stripe provides some decline codes:
https://stripe.com/docs/declines/codes
Is there any way to get that codes?
Thanks!
Hello,
Is there any way to get the Charge ID when the card is declined?
Thanks!
I'm running:
However, when I follow the docs to create a subscription, I get an unknown source
error.
See: https://cartalyst.com/manual/stripe/2.0#create-a-subscription
Seems latest Stripe API docs no longer has a source
field as a parameter.
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:
php artisan tinker
use Stripe
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
php artisan tinker
Cartalyst\Stripe\Laravel\Facades\Stripe::make('<LIVE_SECRET_KEY_HERE>')
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.
In this part of the doc "Create a setup intent"
the provided example code I think is wrong and refer to payment methods.
It's very unlikely the actual package needs any modification for support for Laravel 5.1, but the composer package still insists on 5.0.
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
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.