GithubHelp home page GithubHelp logo

flutter_stripe_payment's People

Contributors

alexstuckey avatar andhieka avatar brauliolomeli avatar davidme-stripe avatar eliudio avatar j-j-gajjar avatar jackliu-gulu avatar jacobsjj2 avatar jnblanchard avatar jonasbark avatar kalegd avatar milewski avatar pauldemarco avatar philiplindberg avatar riscait avatar rodydavis avatar sandeep-phadke avatar sante85 avatar sebghatyusuf avatar vytautas-pranskunas- 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

flutter_stripe_payment's Issues

MainActivity cannot be cast to io.flutter.app.FlutterActivity

Can this plugin work with non Kotlin projects?

I've added the kotlin version to my build script
buildscript {
ext.kotlin_version = '1.2.21'

and the path to my dependencies
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

To make Kotlin plugins work and this has been fine so far.

But when I change my MainActivity extend from FlutterActivity to FlutterFragmentActivity I get a run time error
java.lang.ClassCastException: MainActivity cannot be cast to io.flutter.app.FlutterActivity

Any thoughts here? I'd like to use this plugin with Google Pay https://stripe.com/docs/google-pay and Apple Pay https://stripe.com/apple-pay

Stripe Native causing built fail on iOS.

Getting this after updating to 0.3.0

[!] CocoaPods could not find compatible versions for pod "stripe_payment":
In Podfile:
stripe_payment (from .symlinks/plugins/stripe_payment/ios)

Specs satisfying the stripe_payment (from .symlinks/plugins/stripe_payment/ios) dependency were found, but they required a higher minimum deployment target.
Tried running pod install and pod update. Same error message.

I am on CocoaPods 1.8.1

Help would be much appreciated.

Compile error on iOS

I see a compile error when I try to run on iOS.

It builds fine when I run the demo app( i.e only stripe_payment package in my pubspec )
Fails when I have multiple packages in my pubspec.

Error:
Launching lib/main.dart on iPhone Xs in debug mode... Xcode build done. 16.0s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED ** Xcode's output: ↳ In file included from /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.m:9: /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:30:68: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] - (void)addCardViewControllerDidCancel:(STPAddSourceViewController *)addCardViewController; ^ /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:30:68: note: insert '_Nullable' if the pointer may be null - (void)addCardViewControllerDidCancel:(STPAddSourceViewController *)addCardViewController; ^ _Nullable /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:30:68: note: insert '_Nonnull' if the pointer should never be null - (void)addCardViewControllerDidCancel:(STPAddSourceViewController *)addCardViewController; ^ _Nonnull /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:39:59: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] - (void)addCardViewController:(STPAddSourceViewController *)addCardViewController ^ /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:39:59: note: insert '_Nullable' if the pointer may be null - (void)addCardViewController:(STPAddSourceViewController *)addCardViewController ^ _Nullable /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:39:59: note: insert '_Nonnull' if the pointer should never be null - (void)addCardViewController:(STPAddSourceViewController *)addCardViewController ^ _Nonnull /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:40:43: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] didCreateSource:(STPSource *)source ^ /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:40:43: note: insert '_Nullable' if the pointer may be null didCreateSource:(STPSource *)source ^ _Nullable /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:40:43: note: insert '_Nonnull' if the pointer should never be null didCreateSource:(STPSource *)source ^ _Nonnull /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:41:32: warning: block pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] completion:(STPErrorBlock)completion; ^ /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:41:32: note: insert '_Nullable' if the block pointer may be null completion:(STPErrorBlock)completion; ^ _Nullable /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:41:32: note: insert '_Nonnull' if the block pointer should never be null completion:(STPErrorBlock)completion; ^ _Nonnull /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:36:9: warning: parameter 'token' not found in the function declaration [-Wdocumentation] @param token the Stripe token that was created. @see STPToken ^~~~~ /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.h:36:9: note: did you mean 'source'? @param token the Stripe token that was created. @see STPToken ^~~~~ source /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.m:40:20: warning: incompatible pointer types initializing 'STPCardParams *' with an expression of type 'STPPaymentMethodCardParams *' [-Wincompatible-pointer-types] STPCardParams *cardParams = paymentCell.cardParams; ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.m:42:32: error: property 'managedAccountCurrency' not found on object of type 'STPAddSourceViewController *' cardParams.currency = self.managedAccountCurrency; ^ 6 warnings and 1 error generated. Could not build the application for the simulator. Error launching application on iPhone Xs. Exited (sigterm)

This is the output of flutter doctor:

`flutter doctor -v
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132,
locale en-US)
• Flutter version 1.7.8+hotfix.4 at /Users/../flutter
• Framework revision 20e59316b8 (3 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version
28.0.3)
• Android SDK at /Users/../Library/Android/sdk
• Android NDK location not configured (optional; useful for native
profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1136-b06)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.7.5

[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4

[!] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.3.0

[✓] Connected device (1 available)
• iPhone Xs • DCEF324A-8135-4355-81FA-B972772B42A4 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)

! Doctor found issues in 1 category.`

I guess this issue is ok, I am not using Android studio at the moment.

pubspec:
`dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_local_notifications:

cupertino_icons: ^0.1.2
firebase_auth: ^0.14.0
firebase_core: ^0.4.0+8
cloud_firestore: ^0.12.9
google_sign_in: ^4.0.6
firebase_messaging: ^5.1.2
url_launcher: ^5.0.1
flutter_auth_buttons: ^0.3.1
geolocator: ^5.1.1
stripe_payment: ^0.1.0
cloud_functions: ^0.4.1`

Unresolved References

Hi all!

Firstly thanks for the great work on the plugin! Its really awesome!

Was just wondering if I am having an issue with just my instance (Aka I have done something horribly wrong). Or if this is a known issue. I am also a complete android noob and this is only really my first time ever using it (Sorry about that).

When trying to build the app for android I get a whole bunch of unresolved references. As can be seen here.

Furthermore, when i open stripe-payment/java/de.johnasbark.stripepayment/StripeDialog I can see a whole bunch of Unresolved References. As can be seen here.

Also, as per the footnote in the readme, i have extended my main activity to look as such:
public class MainActivity extends FlutterFragmentActivity {

Any feedback would be appreciated! Thanks for taking the time! You guys are awesome 👍🏼

Future is not returned

Hello,

I am really loving this plugin, but there is one thing, that does not allow me to fully separate business logic and views in BLoC pattern - when user clicks on "Cancel" button there is no future returned in method StripePayment.addSource().

You can try yourself, code is really simple:

String paymentMethodId = await StripePayment.addSource();
print(paymentMethodId);

Try cancelling - nothing is returned and printed.

The same goes for StripePayment.setupPayment and StripePayment.confirmPayment, if additional SCA steps is needed and user presses cancel.

I worked around the problem, but the solution is not so elegant, and it involves adding some business logic to views.

Thanks again for the plugin, I hope this could be resolved!

cant get stripe package from pub

error on get packages:
The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.

depends on stripe_payment >=0.0.9 which requires SDK version >=2.1.0 <3.0.0, version solving failed.

pub get failed (1)

my pubspec.yaml
version: 1.0.0+1

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

StripePayment.confirmPayment does not works

I try to call confirmPayment method but nothing happened.
The console is: W/ActivityThread( 5126): handleWindowVisibility: no activity for token android.os.BinderProxy@e33aec

My code:
StripePayment.setSettings(StripeSettings(publishableKey: "pk_test_xxxxxxxxxxxxxx"));
StripePayment.confirmPayment(paymentMethodId, paymentIntentId).then((String token) {
print(token);
}).catchError(print);

conflict library with gogle services

I have this problem
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[1.3.1
,2.3]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.nimbusds:nimbus-jose-jwt:7.8 -> net.minidev:json-smart@[1.3.1,2.3], but json-smart version was 2
.3.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.nimbusds:[email protected]
-- Project 'app' depends onto net.minidev:[email protected]
-- Project 'app' depends on project 'stripe_payment' which depends onto com.stripe:[email protected]
-- Project 'app' depends onto com.stripe:[email protected]
-- Project 'app' depends onto com.stripe:[email protected]

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s
Finished with error: Gradle task assembleDebug failed with exit code 1

pubspec.yml

shared_preferences: 0.5.2+1
firebase_core: ^0.4.0
firebase_messaging: 5.1.5
flutter_local_notifications: 0.8.3
stripe_payment: 0.3.1

build.gradle
buildscript {
repositories {
google()
jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.1'
    classpath 'com.google.gms:google-services:4.3.2'
}

}

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def appName = localProperties.getProperty('flutter.appName')
if (appName == null) {
appName = ''
}

def flutterAppId = localProperties.getProperty('flutter.appId')
if (flutterAppId == null) {
flutterAppId = ''
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '4'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '0.0.4'
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

lintOptions {
    disable 'InvalidPackage'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId flutterAppId
    minSdkVersion 19
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
}
buildTypes {
    release {
        signingConfig signingConfigs.release
        resValue "string", "app_name", appName
    }
}

}

flutter {
source '../..'
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "androidx.core:core:1.0.1"
}

apply plugin: 'com.google.gms.google-services'

app integration fail

app/build.gradle

defaultConfig {
multiDexEnabled true
....
}

googleServices.disableVersionCheck = true

pubspec.yml

stripe_payment: 0.3.1
firebase_core: ^0.4.0
firebase_messaging: 5.1.5

if you test in your example project,

build fail

iOS works but Android app fails to compile for v0.2.1

If I move back to v0.1.0 everything works; however, when using v0.2.1, Android app fails to compile with the below error. I am using FlutterFragmentActivity as per the documentation.

Error:

  • What went wrong:
    Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException:
java.lang.RuntimeException
at org.objectweb.asm.ClassReader.accept(ClassReader.java:632)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:144)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar(DesugaringClassAnalyzer.java:92)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:63)
at com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.lambda$getInitalGraphData$4(DesugarIncrementalTransformHelper.java:150)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Fails to start on android

e: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/incremental/components/ExpectActualTracker
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetPublicMethods(Class.java:2902)
	at java.lang.Class.getMethods(Class.java:1615)
	at org.jetbrains.kotlin.container.CacheKt.getSetterInfos(Cache.kt:64)
	at org.jetbrains.kotlin.container.CacheKt.traverseClass(Cache.kt:59)
	at org.jetbrains.kotlin.container.CacheKt.access$traverseClass(Cache.kt:1)
	at org.jetbrains.kotlin.container.ClassTraversalCache.getClassInfo(Cache.kt:29)
	at org.jetbrains.kotlin.container.CacheKt.getInfo(Cache.kt:38)
	at org.jetbrains.kotlin.container.InstanceComponentDescriptor.getRegistrations(Components.kt:24)
	at org.jetbrains.kotlin.container.ComponentRegistry.buildRegistrationMap(Registry.kt:26)
	at org.jetbrains.kotlin.container.ComponentRegistry.addAll(Registry.kt:36)
	at org.jetbrains.kotlin.container.ComponentStorage.composeDescriptors(Storage.kt:124)
	at org.jetbrains.kotlin.container.ComponentStorage.compose(Storage.kt:118)
	at org.jetbrains.kotlin.container.StorageComponentContainer.compose(Container.kt:55)
	at org.jetbrains.kotlin.container.DslKt.composeContainer(Dsl.kt:24)
	at org.jetbrains.kotlin.resolve.TargetPlatformKt.createContainer(TargetPlatform.kt:145)
	at org.jetbrains.kotlin.frontend.java.di.InjectionKt.createContainerForLazyResolveWithJava(injection.kt:85)
	at org.jetbrains.kotlin.frontend.java.di.InjectionKt.createContainerForTopDownAnalyzerForJvm(injection.kt:128)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.createContainer(TopDownAnalyzerFacadeForJVM.kt:172)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:85)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:83)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:377)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:68)
	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:96)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:368)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:133)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:58)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:103)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:303)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:85)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:213)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:37)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:74)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:87)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.execIncrementalCompiler(CompileServiceImpl.kt:512)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.access$execIncrementalCompiler(CompileServiceImpl.kt:96)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:399)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:96)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:889)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:96)
	at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:916)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:888)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:398)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.incremental.components.ExpectActualTracker
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.jetbrains.kotlin.cli.jvm.plugins.PluginURLClassLoader$SelfThenParentURLClassLoader.findClass(PluginURLClassLoader.kt:50)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 65 more


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':stripe_payment:compileDebugKotlin'.
> Internal compiler error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
Finished with error: Gradle build failed: 1

Fails to start on android

Hi,

I tried to run my flutter app and it crashes at start up. I am using Flutter 1.0.0 .
I added classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.10" to root level build.gradle file.
Please let me know if you need more info.

Thanks,
Chandu

EXCEPTION CAUGHT BY WIDGETS LIBRARY

Hi, I ran the example code on iOS and the following message is shown.


flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown attaching to the render tree:
flutter: type 'Future<dynamic>' is not a subtype of type 'Future<String>' where
flutter:   Future is from dart:async
flutter:   Future is from dart:async
flutter:   String is from dart:core
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      StripeSource.addSource (package:stripe_payment/stripe_payment.dart:11:51)
flutter: #1      _MyAppState.initState (file:///Users/adrian/Documents/development/flutter/First_Flutter_Project/stripe_api/lib/main.dart:21:18)
flutter: #2      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3743:58)
flutter: #3      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3609:5)
flutter: #4      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2899:14)
flutter: #5      Element.updateChild (package:flutter/src/widgets/framework.dart:2702:12)
flutter: #6      RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:857:16)
flutter: #7      RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:828:5)
flutter: #8      RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:774:17)
flutter: #9      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2214:19)
flutter: #10     RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:773:13)
flutter: #11     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:662:7)
flutter: #12     runApp (package:flutter/src/widgets/binding.dart:704:7)
flutter: #13     main (file:///Users/adrian/Documents/development/flutter/First_Flutter_Project/stripe_api/lib/main.dart:6:3)
flutter: #14     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
flutter: #15     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════

Also another question, is the billing address support coming along in the next update or no?

SCA and 2FA

Hi,

I'm using this plugin in our app and I saw the changes made to use the new SCA regulations.
I have some questions on how the 2FA authentication should be implemented after creating the payment intent.

I have worked for payment providers before and would like to be involved in the development if possible. How is the roadmap going to provide full support for 2FA?

Invalid publishable key

Always getting the invalid publishable key message, though I set my test key correctly on the example app

Error calling Charge.create from backend with the token provided

The token provided by the plugin is always something like "pm_1FQtc6Ghe41SsGqRwgiAqtr4"

in the backend calling the Charge API

 Map<String, Object> chargeParams = new HashMap<>();
        chargeParams.put("amount", 999);
        chargeParams.put("currency", "eur");
        chargeParams.put("description", "some description");
        chargeParams.put("source","pm_1FQtc6Ghe41SsGqRwgiAqtr4");
        try {
            charge = Charge.create(chargeParams);
        } catch (StripeException e) {
            e.printStackTrace();
        }

will always throw the error:

com.stripe.exception.InvalidRequestException: You cannot create a charge with a PaymentMethod. Use the Payment Intents API instead.; request-id: req_z0pj936iwJInrw

What's the future for this library?

Great library, I was using it until ran into issues on Flutter 1.5 upgrades (not exclusively because of this library). However, I can see that the last meaningful contribution was a few months ago so I'm wondering if the author(s) intend on continuing with this plugin and what type of roadmap (if any) that they have.

Thanks!

Running into lots of Unresolved References

Flutter Doctor: Everything is good
Attempt to integrate this package into my existing project which didn't include Kotlin support in the first place. (Using Android Studio)
I've changed the MainActivity from extending FlutterActivity to FlutterFragmentActivity and figure out that I needed kotlin. I added the following lines of code and manipulated for a long time but didn't help.

build.gradle
buildscript {
ext.kotlin_version = '1.3.30'
repositories {
google()
jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.0.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}

}

build.gradle(App)
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

Error:
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (4, 12): Unresolved reference: google
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (5, 17): Unresolved reference: fragment
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (17, 31): Unresolved reference: fragment
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (25, 18): Unresolved reference: arguments
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (31, 5): 'onCreateView' overrides nothing
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (36, 5): 'onViewCreated' overrides nothing
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (37, 15): Unresolved reference: onViewCreated
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (40, 21): Unresolved reference: arguments
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (41, 9): Unresolved reference: dialog
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (49, 5): 'onCreate' overrides nothing
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (51, 15): Unresolved reference: onCreate
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (53, 9): Unresolved reference: setStyle
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (53, 27): Unresolved reference: fragment
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (59, 32): Unresolved reference: view
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (65, 17): Unresolved reference: view
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\java\de\jonasbark\stripepayment\StripeDialog.kt: (66, 17): Unresolved reference: view
.
.
.
e: C:\Users...\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-0.1.0\android\src\main\kotlin\de\jonasbark\stripepayment\StripePaymentPlugin.kt: (29, 25): Unresolved reference: show

Issues with Androidx

I have been trying to build for android with this library but running into a bunch of AndroidX related issues, seems like casting registrar.activity() as androidx.fragment.app.FragmentActivity does not work but I am not sure of what another solution could be?

Has anyone had a similar issue, is there any simple way to fix it? Happy to PR and investigate otherwise...

Thanks!

build.gradle

stripe android 10.2.1 not exist on maven central, right is 10.2.0

Project crash after import

I followed the instructions you provided for install, but i get this error from the log:

Execution failed for task ':stripe_payment:compileDebugKotlin'.

and a huge Stacktrace error:
java.lang.AbstractMethodError: org.jetbrains.kotlin.android.synthetic.AndroidExtensionPropertiesComponentContainerContributor.addDeclarations(Lorg/jetbrains/kotlin/container/StorageComponentContainer;Lorg/jetbrains/kotlin/resolve/TargetPlatform;)V
at org.jetbrains.kotlin.frontend.di.InjectionKt.configureModule(injection.kt:56)
at org.jetbrains.kotlin.frontend.di.InjectionKt.configureModule(injection.kt:72)
(...)

Do you have any idea how to fix this?

StripePayment.confirmPayment does not handle promise

After I click on Complete Authen or Failed Authen The code after that does not run. I can not handle anything after this.

await StripePayment.confirmPayment(paymentMethodId, paymentIntentResponse.client_secret]);
//print('This line has never printed')
or
StripePayment.confirmPayment(paymentMethodId, paymentIntentResponse.client_secret]).then((token){
//print('This line has never printed')
});

Missing Apple Pay native payment confirmation

Great job implementing native payments in Objective-C!

What is missing is the functionality to call back iOS and tell it wether the native payment was successful (see for example https://github.com/rbii-incorporated/stripe_native StripeNative.confirmPayment without which the Apple Pay just keeps spinning until it times out.

I am totally new to Objective-C (and honestly got too much on my plate right now to learn a new framework) but I've done a stub with #45) perhaps somebody could finish it (or re-implement) completely and I'll test it?

Basically when a native payment is completed (https://developer.apple.com/documentation/passkit/pkpaymentauthorizationcontrollerdelegate/2867952-paymentauthorizationcontroller?language=objc) a handler is provided to call back with the result.

Can somebody implement it or give me some pointers?

Crash on iOS after upgrade to Flutter 1.0.0

Before Flutter version 1.0.0, the plugin was working just fine.

After the upgrade, when I invoke StripeSource.addSource() I get:

*** First throw call stack:
(
0   CoreFoundation                      0x00000001123461bb __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x00000001118e4735 objc_exception_throw + 48
2   CoreFoundation                      0x0000000112364f44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3   CoreFoundation                      0x000000011234aed6 ___forwarding___ + 1446
4   CoreFoundation                      0x000000011234cda8 _CF_forwarding_prep_0 + 120
5   stripe_payment                      0x00000001118c8fc3 -[StripePaymentPlugin openStripeCardVC:result:] + 291
6   stripe_payment                      0x00000001118c8d43 -[StripePaymentPlugin handleMethodCall:result:] + 227
7   Flutter                             0x000000010f3ee9a2 __45-[FlutterMethodChannel setMethod<…>

I am using latest version stripe_payment: ^0.0.7

Flutter doctor:

[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.1 18B75, locale en-BG)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)

[Android] HttpException

Hi

I have a problem just when I add flutter_stripe_payement on pubspec.yaml on Android. If I remove the package, everything works. The version use is 0.1.0

Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:54226/ws

I have no idea to resolve this bug, can you help me ? Apparently it's a problem with the proxy but I don't know where is exactly the bug and how to fix it.

I don't have Android device, I use simulator for my test.
On iOs everything work correctly.

flutter doctor -v

[✓] Flutter (Channel dev, v1.3.9, on Mac OS X 10.14.3 18D109, locale fr-BE)
• Flutter version 1.3.9 at /Users/user/Documents/flutter-sdk
• Framework revision f91df4abe1 (3 days ago), 2019-03-09 21:19:28 -0500
• Engine revision 4e54bc93ca
• Dart version 2.2.1 (build 2.2.1-dev.1.0 2fb6cd9f5f)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/user/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 1.9.4
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.3.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] VS Code (version 1.32.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.24.0
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!

flutter -v --bug-report run

[ +9 ms] Installing build/app/outputs/apk/app.apk...
[ ] executing: /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -t -r /Users/user/Documents/app/flutter/app/build/app/outputs/apk/app.apk
[+2848 ms] Success
[ ] Installing build/app/outputs/apk/app.apk... (completed in 2,8s)
[ +4 ms] executing: /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell echo -n 5722f961e14385d9255634f7674007ce01ea460a > /data/local/tmp/sky.com.company.app.sha1
[ +21 ms] Android SDK built for x86 startApp
[ +1 ms] executing: /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true com.company.app/com.company.app.MainActivity
[ +118 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.company.app/.MainActivity (has extras) }
[ ] Waiting for observatory port to be available...
[+1432 ms] Observatory URL on device: http://127.0.0.1:44475/
[ +1 ms] executing: /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5554 forward tcp:0 tcp:44475
[ +10 ms] 54226
[ ] Forwarded host port 54226 to device port 44475 for Observatory
[ +5 ms] Connecting to service protocol: http://127.0.0.1:54226/
[ +37 ms] Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri =http://127.0.0.1:54226/ws
[ +2 ms] "flutter run" took 23 990ms.
[ ] "flutter run" took 23 990ms.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:24:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:413:7)
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:549:18)
#3 _asyncThenWrapperHelper. (dart:async/runtime/lib/async_patch.dart:77:64)
#4 _rootRunUnary (dart:async/zone.dart:1132:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#9 Future._complete (dart:async/future_impl.dart:473:7)
#10 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#11 _AsyncAwaitCompleter.complete (dart:async/runtime/lib/async_patch.dart:28:18)
#12 _completeOnAsyncReturn (dart:async/runtime/lib/async_patch.dart:294:13)
#13 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#14 _asyncThenWrapperHelper. (dart:async/runtime/lib/async_patch.dart:77:64)
#15 _rootRunUnary (dart:async/zone.dart:1132:38)
#16 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#17 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#18 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#19 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#20 Future._complete (dart:async/future_impl.dart:473:7)
#21 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#22 _AsyncAwaitCompleter.complete (dart:async/runtime/lib/async_patch.dart:28:18)
#23 _completeOnAsyncReturn (dart:async/runtime/lib/async_patch.dart:294:13)
#24 AndroidDevice.targetPlatform (package:flutter_tools/src/android/android_device.dart)
#25 _asyncThenWrapperHelper. (dart:async/runtime/lib/async_patch.dart:77:64)
#26 _rootRunUnary (dart:async/zone.dart:1132:38)
#27 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#28 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#29 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#30 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#31 Future._complete (dart:async/future_impl.dart:473:7)
#32 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#33 _AsyncAwaitCompleter.complete. (dart:async/runtime/lib/async_patch.dart:33:20)
#34 _rootRun (dart:async/zone.dart:1124:13)
#35 _CustomZone.run (dart:async/zone.dart:1021:19)
#36 _CustomZone.bindCallback. (dart:async/zone.dart:947:23)
#37 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#38 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#39 _runPendingImmediateCallback (dart:isolate/runtime/lib/isolate_patch.dart:115:13)
#40 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:172:5)

If you need more data, ask me.

Flutter Stripe payment integration not working

I am trying to implement stripe payment plugin for flutter and add the plugin in pubspec.yaml same as flutter stripe payment example but it gives me below error... I am using in the new fresh application.

Performing hot restart...
Syncing files to device Android SDK built for x86...
Restarted application in 2,713ms.
E/flutter ( 4683): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 4683): MissingPluginException(No implementation found for method setPublishableKey on channel stripe_payment)
E/flutter ( 4683): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 4683):
E/flutter ( 4683): #1 StripeSource.setPublishableKey (package:stripe_payment/stripe_payment.dart:21:14)
E/flutter ( 4683): #2 _MyAppState.initState (file:///E:/workstation/stripe_app/lib/main.dart:20:18)
E/flutter ( 4683): #3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3763:58)
E/flutter ( 4683): #4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3629:5)
E/flutter ( 4683): #5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2919:14)
E/flutter ( 4683): #6 Element.updateChild (package:flutter/src/widgets/framework.dart:2722:12)
E/flutter ( 4683): #7 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:881:16)
E/flutter ( 4683): #8 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:852:5)
E/flutter ( 4683): #9 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:798:17)
E/flutter ( 4683): #10 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2235:19)
E/flutter ( 4683): #11 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:797:13)
E/flutter ( 4683): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:689:7)
E/flutter ( 4683): #13 runApp (package:flutter/src/widgets/binding.dart:728:7)
E/flutter ( 4683): #14 main (file:///E:/workstation/stripe_app/lib/main.dart:6:3)
E/flutter ( 4683): #15 _startIsolate. (dart:isolate/runtime/libisolate_patch.dart:289:19)
E/flutter ( 4683): #16 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
E/flutter ( 4683): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 4683): MissingPluginException(No implementation found for method addSource on channel stripe_payment)
E/flutter ( 4683): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 4683):
E/flutter ( 4683): #1 StripeSource.addSource (package:stripe_payment/stripe_payment.dart:12:41)
E/flutter ( 4683):
E/flutter ( 4683): #2 _MyAppState.initState (file:///E:/workstation/stripe_app/lib/main.dart:21:18)
E/flutter ( 4683): #3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3763:58)
E/flutter ( 4683): #4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3629:5)
E/flutter ( 4683): #5 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2919:14)
E/flutter ( 4683): #6 Element.updateChild (package:flutter/src/widgets/framework.dart:2722:12)
E/flutter ( 4683): #7 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:881:16)
E/flutter ( 4683): #8 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:852:5)
E/flutter ( 4683): #9 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:798:17)
E/flutter ( 4683): #10 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2235:19)
E/flutter ( 4683): #11 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:797:13)
E/flutter ( 4683): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:689:7)
E/flutter ( 4683): #13 runApp (package:flutter/src/widgets/binding.dart:728:7)
E/flutter ( 4683): #14 main (file:///E:/workstation/stripe_app/lib/main.dart:6:3)
E/flutter ( 4683): #15 _startIsolate. (dart:isolate/runtime/libisolate_patch.dart:289:19)
E/flutter ( 4683): #16 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

Default Flutter counter app hanfs on startup after adding dependency to stripe_paymet in pubspec.yaml

I've tried to integrate this plugin to our Flutter project and noticed that app just hangs on startup. It says in the console that it is installed to my physical device, but then nothing happens, no screen, IDE shows that app process is running, no errors/warnings in the console:

alex@bitch:/mnt/ssd2/projects/test_stripe$ flutter clean
Deleting 'build/'.
Deleting '/mnt/ssd2/projects/test_stripe/.dart_tool/'.
alex@bitch:/mnt/ssd2/projects/test_stripe$ flutter run
Launching lib/main.dart on VKY L29 in debug mode...
Initializing gradle...                                              0.8s
Resolving dependencies...                                           1.5s
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        26.1s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                         3.2s

To reproduce I've created a new Flutter project, default counter app, migrated it to AndroidX. When I add to pubspec.yaml dependency stripe_payment: ^0.1.0 then I cannot start the app anymore.
I've shared this simple project on GitHub https://github.com/AlexanderArendar/test_stripe.git

My flutter doctor output is:

alex@bitch:/mnt/ssd2/projects/test_stripe$ flutter doctor -v
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Linux, locale en_US.UTF-8)
    • Flutter version 1.7.8+hotfix.3 at /mnt/ssd2/flutter
    • Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /home/alex/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /mnt/ssd2/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)
    • All Android licenses accepted.

[✓] Android Studio (version 3.4)
    • Android Studio at /mnt/ssd2/android-studio
    • Flutter plugin version 37.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)

[✓] IntelliJ IDEA Community Edition (version 2019.1)
    • IntelliJ at /mnt/ssd2/IDE/idea-IC-191.7479.19
    • Flutter plugin version 37.1.3
    • Dart plugin version 191.7830

[✓] Connected device (1 available)
    • VKY L29 • 6PM7N17B28000085 • android-arm64 • Android 9 (API 28)

• No issues found!

Probably I've missed something very stupid simple...? Could you advice?

Package Documentation For Charges

The documentation doesn't explain how to charge an added credit card. What should happen after the user presses Done on the Add a Card window?

Google pay fails with OR-IDL-01 in live environment

Another thing: I seem to be having problems with Google Pay when I use the live key, but it works with test key. (Very weird as I'd think Google Pay doesn't know about stripe keys).

In live environment i get: OR-IDL-01 and in test environment it just works.

Any clues?

stripe payment with the error MissingPluginException (MissingPluginException(No implementation found for method setPublishableKey on channel stripe_payment))

hi can help me on this ? i have face this issue for few days and no clues on this. others element is working fine, when implementing flutter_stripe then the error shows me

MissingPluginException (MissingPluginException(No implementation found for method 
setPublishableKey on channel stripe_payment))

MainActivity file

public class MainActivity extends FlutterFragmentActivity {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    GeneratedPluginRegistrant.registerWith(this)
  }
}

build.gradle in android > app

defaultConfig {
    (https://developer.android.com/studio/build/application-id.html).
    applicationId "app.app"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
 }

build.gradle in Android folder

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.2.0'
    }

    subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'androidx.core'
                        && !details.requested.name.contains('androidx') ) {
                    details.useVersion "1.0.1"
                }
            }
        }
    }
}

implementation

void initState() {
    super.initState();
    initAction();
    StripeSource.setPublishableKey("mykey");
}

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v1.9.0, on Microsoft Windows [Version 10.0.18362.356], locale en-MY)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[√] Android Studio (version 3.4)
[√] VS Code (version 1.38.1)
[√] Connected device (1 available)

• No issues found!

Android crash on launch for brand new project

First, thank you for working on this project! It has worked great for me on iOS but i've been having difficulties getting it to launch properly on Android

To eliminate all external variables I've generated a brand new project using flutter create and added only this package as a dependency as follows:

dependencies:
  flutter:
    sdk: flutter
    
  stripe_payment:

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

I then modified the android build.gradle to enable multidex to get it building properly and modified the minSdkVersion as follows:


    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.stripe_test"
        minSdkVersion 19
        targetSdkVersion 28
        multiDexEnabled true
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }


dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    def multidex_version = "2.0.1"
    implementation "androidx.multidex:multidex:$multidex_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

The app build fine but crashes immediately on launch.

I was able to get it working properly using the example in this repo but couldn't reverse engineer why it was working on this repo but not on the brand new installation.

Any idea what I'm doing wrong here?

Problem with fcm notifications and stripe plugin

Hey, flutter stripe payment is a good plugin but I have some problems with the Firebase Notifications, because without the stripe plugin the notifications are working well, but when I add the plugin the notifications are not working when the app is terminated and the console return this exception:

E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): kotlin.TypeCastException: null cannot be cast to non-null type androidx.fragment.app.FragmentActivity
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at de.jonasbark.stripepayment.StripePaymentPlugin$Companion.registerWith(StripePaymentPlugin.kt:16)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at de.jonasbark.stripepayment.StripePaymentPlugin.registerWith(Unknown Source:2)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:18)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at com.apps.scode.flutter_notifications.Application.registerWith(Application.java:18)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.startBackgroundIsolate(FlutterFirebaseMessagingService.java:164)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.onMethodCall(FirebaseMessagingPlugin.java:134)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:645)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at android.os.MessageQueue.next(MessageQueue.java:386)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at android.os.Looper.loop(Looper.java:175)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at android.app.ActivityThread.main(ActivityThread.java:7625)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
E/MethodChannel#plugins.flutter.io/firebase_messaging(14533): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
E/ (14533): [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
E/flutter (14533): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, null cannot be cast to non-null type androidx.fragment.app.FragmentActivity, null)

Can't install package

Getting the following when I try to add the package

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `stripe_native` depends upon `Stripe`, which does not define modules. To opt into those targets generating module maps (which
is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or
specify `:modular_headers => true` for particular dependencies.

I've tried using use_modular_headers! which didn't help and couldn't work out how to specify specifically for the stripe package?

Any advice? Thanks :)

Application crashes after install

Just after including this package in the pubspec.yaml file like this:

stripe_payment: "^0.0.6"

Whenever the application starts, it immediately crashes. Here is the log. If I remove it from the pubspec file, the application goes back to working as it should.

Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 3.2s
Resolving dependencies... 17.4s
Running 'gradlew assembleDebug'... 48.1s
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk... 2.4s

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.