Giter Club home page Giter Club logo

flutter_stripe_demo's Introduction

flutter_stripe_demo's People

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

Watchers

 avatar  avatar  avatar  avatar

flutter_stripe_demo's Issues

How to replace nikesPriceId

I'm getting this error because of nikesPriceId, where do I find it in stripe to replace ?

{"error":{"code":"resource_missing","doc_url":"https://stripe.com/docs/error-codes/resource-missing","message":"No such price: 'price_1HFw3QAQHy2zYPZft7bbrtWZ'","param":"line_items[0][price]","type":"invalid_request_error"}}
E/flutter ( 9306): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: DioError [DioErrorType.RESPONSE]: Http status error [400]

No redirect

Hello,

I've implemented your solution that is really awesome however I'm facing an issue with the return URL, I can see on the stripe checkout page after a payment that the system is blocked to a loading with
'your payment is in progress, when finished you will be redirected automatically' but it's blocked.
I wonder if the localhost URL is not blocking that.
Do you have any idea?

Christophe

Feature request: get transaction data in success page

Excellent work and it is very helpful.

A feature request:

I think it would make a complete example if you can show how to use the stripe js library to get the transaction details upon a successful transaction.

Thank you

resource_missing error

I am getting the following error:

flutter: {"error":{"code":"resource_missing","doc_url":"https://stripe.com/docs/error-codes/resource-missing","message":"No such price: 'price_1HFw3QAQHy2zYPZft7bbrtWZ'","param":"line_items[0][price]","type":"invalid_request_error"}} [VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: DioError [DioErrorType.RESPONSE]: Http status error [400] #0 Server.createCheckout (package:flutter_stripe_demo/checkout/server_stub.dart:37:7) <asynchronous suspension> #1 redirectToCheckout (package:flutter_stripe_demo/checkout/stripe_checkout_mobile.dart:8:21) <asynchronous suspension>

What could I do to fix this issue?

flutter web

How can I detect the subscription button click on the checkout page and also help me with payment receipt in flutter web.

Thank you in advance !!

`invalid_request_error` while calling https://api.stripe.com/v1/checkout/sessions

This is what I am passing to my body

final body = {
      'payment_method_types': ['card'],
      'line_items': [
        {
          'price': 'price_1Ivaf4IicCqYtLEx7HJ1f67q',
          'quantity': 1,
        }
      ],
      'mode': 'payment',
      'success_url': 'http://localhost:8080/#/success',
      'cancel_url': 'http://localhost:8080/#/cancel',
    };

and I am getting this error

{
  "error": {
    "message": "Invalid request: unsupported Content-Type text/plain; charset=utf-8. If error persists and you need assistance, please contact [email protected].",
    "type": "invalid_request_error"
  }
}

NOTE: web part is running fine.

JS Error with a live key

When running this in iOS simulator with a live key, it gives error:

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript, JavaScript string was: 'var stripe = Stripe('<Stripe key>');

stripe.redirectToCheckout({
  sessionId: 'cs_live_a0tCIGOAnW9bEG4L0gNpHHwEvN9Rg22CrV21lYQIvSvn2l7SlhzvBgTKiq'
}).then(function (result) {
  result.error.message = 'Error'
});
'
Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=IntegrationError: Live Stripe.js integrations must use HTTPS. For more information: https://stripe.com/docs/security/guide#tls, WKJavaScriptExceptionColumnNumber=184970, WKJavaScriptExceptionSourceURL=https://js.stripe.com/v3/, NSLocalizedDescription=A JavaScript exception occurred}, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:1<…>

Backend Function Clarity

Is the purpose of the backend functions simply to dynamically retrieve the secret key and prices id to fill the body (price, quantity, payment method) and headers (client secret key) of the function below in order to create a checkout session and retrieve a session id?

try { final result = await Dio().post( "https://api.stripe.com/v1/checkout/sessions", data: body, options: Options( headers: {HttpHeaders.authorizationHeader: auth}, contentType: "application/x-www-form-urlencoded", ), ); return result.data['id'];

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.