stripe-payments

How to get the charge Id after subscribing a customer to a plan with recurring payment?

百般思念 提交于 2020-01-06 07:11:10
问题 I have successfully created a customer in stripe with a subscription of plan .After successful payment I am not able to get the charge Id because after subscribing a customer to a plan.It automatically generates an invoice.So what is the way that I can get that particular charge stripe Id from stripe and store it in my system database. 回答1: Getting the charge ID for a subscription (or an invoice) can be done via their webhooks integration. You need to expose an API in your app where Stripe

Where do I call the “payment was successful” message from?

◇◆丶佛笑我妖孽 提交于 2020-01-06 05:43:08
问题 I have integrated Stripe into my site. The code below is copied directly from stripe's documentation. Although there are minor differences between this code and my implementation, such differences are not relevant to the question as both my code and the code is shown work correctly First I install relevant files. composer.json { "require": { "stripe/stripe-php": "*" } } Then I make a checkout in JavaScript. (This one charges $9.99 for "Example Charge" but you get the idea. Below is a simple

Cannot Catch Errors in Stripe payment gateway in Codeigniter 3

心不动则不痛 提交于 2020-01-06 04:35:11
问题 I am very new to stripe payment gateway integration. I am facing a problem on catching errors. I saw their official documentation for catching errors, but nothing is working. My payment is working fine and when I enter the correct information stripe takes my payment and successfully redirect to the success page, but the problem happens when I tried with wrong information it doesn't give me any error just shows HTTP 500 error (In production environment). When I set error_reporting(E_ALL) then

Stripe Integration - Dynamically adding attr value in to the hidden_field

元气小坏坏 提交于 2020-01-05 10:26:10
问题 I'm working on integrating Stripe with my Rails project, and have it working to the point where when a new user signs up they are added as a customer in Stripe. I'm having some problems sending the plan_id to them, however. The URL of the sign up form includes the plan_id as a parameter depending on which plan is selected from the pricing table, for example: http://localhost:3000/users/sign_up?plan_id=1 The sign up form includes the following hidden field, which should pass the plan_id to

Stripe returning token but can access it

半城伤御伤魂 提交于 2020-01-05 09:08:56
问题 I am getting a stripe token back from my stripe.tokens.create now I can assign it to a variable inside it but I need to call that variable outside the callback. I was thinking global variable but then thought it might not work. I know the code examples I have found use req.body.stripeToken but my req.body comes back with a blank object {} . I can not find any guides on this for Node.js only stuff like Ruby and PHP. 来源: https://stackoverflow.com/questions/46669259/stripe-returning-token-but

Stripe Rails: Invalid integer: 1.06

邮差的信 提交于 2020-01-04 06:03:09
问题 I can't get my head around this one. My form passes a params of 106 which is £1.06 . Charging the card: amount = params[:amount].to_f begin charge = Stripe::Charge.create( :amount => amount / 100, :currency => "gbp", :source => token, :description => "Example charge" ) rescue Stripe::CardError => e # The card has been declined end How to prevent: Invalid integer: 1.06 Where does the integer comes from? I have converted that to float . 回答1: According to Stripe API Reference amount parameter

Laravel: Stripe No API key provided. (HINT: set your API key using Stripe::setApiKey()

有些话、适合烂在心里 提交于 2020-01-04 01:50:31
问题 Yes, I know, there is an exact same question there but the "solution" is not approved nor specified as it should. So: 1) I installed the stripe library v.3.0 by php composer.phar require stripe/etc and it installed ok, (otherwise I wouldn't have actually received that error) 2) I have the public test key in the blade Form in the Head section alright 3) Then at the controller I included inside the public function that receives the data from the Form the following: (no problem not my real

Passing csrf token to Stripe

孤者浪人 提交于 2020-01-03 09:07:15
问题 I am using stripe.js for stripe payments. I need to setup a callback wenhook to receive the request from stripe. Since the webhook is posted to by stripe - I have marked it as csrf_excempt . Is there any risk with making this view csrf_excempt ? If I should have csrf protection on this view, how can I pass and get back the csrf tokens from stripe? 回答1: That's not going to work. Definitely disable csrf for the callback from Stripe. Even if you.. passed the csrf_token to stripe found a way to

Is it possible to get a count of subscribers for a plan from the Stripe API?

丶灬走出姿态 提交于 2020-01-02 18:17:12
问题 I am using the Stripe.net library to make calls against the Stripe API. I would like to get a total count of subscribers for various Plans but I am not sure if this is possible with the current API and/or the Stripe.NET Library at all. Can anyone provide any insight as to whether or not this is possible? 回答1: There's no direct call for this, but it's easy enough to accomplish. The "List all customers" API call ( StripeCustomerService 's List() method in Stripe.Net) returns the full JSON

Assign metadata to invoice in Stripe subscriptions

好久不见. 提交于 2020-01-02 08:47:08
问题 here is my code to create a subscription: $subscription = \Stripe\Subscription::create(array( "customer" => $customer->id, //customer id from previous lines after creating customer "plan" => 'premium-plan', 'metadata' => ['user_id' => $userId] )); here is my code to update plans: $subscriptionUpdate = \Stripe\Subscription::retrieve($subscriptionIdFromDatabase); $subscriptionUpdate->plan = 'best-premium-plan'; $subscriptionUpdate->save(); How can I add metadata to an invoice if the user wants