Giter VIP home page Giter VIP logo

stripe-ios-binding's Introduction

Stripe for Xamarin.iOS

Stripe for Xamarin.iOS

A Xamarin.iOS binding library for Stripe library.

About

This project is maintained by Naxam Co.,Ltd.
We specialize in developing mobile applications using Xamarin and native technology stack.

Looking for developers for your project?


Installation

Install-Package Naxam.Stripe.iOS

Usage

Plz follow the official guide here.

License

Stripe binding library for iOS is released under the MIT license. See LICENSE for details.

Get our showcases on AppStore/PlayStore

Try our showcases to know more about our capabilities.

Contact us if interested.



Follow us for the latest updates
Twitter URL Twitter Follow

stripe-ios-binding's People

Contributors

bratsche avatar gfbriggs avatar kyhosy avatar tuyen-vuduc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stripe-ios-binding's Issues

Update to stripe 12.2.0

Hello there can you please update he binding version?
Also could you add some instructions on how can we do it locally?

Issue with generated protocol property (STPSourceProtocol)

Add to the demo the below code to get an exception, not sure what is needed but it can't cast STPCard to STPSourceProtocol.

public void PaymentContext(STPPaymentContext paymentContext, STPPaymentResult paymentResult, STPErrorBlock completion)
{
    // Specified cast is not valid
    var stripeID = paymentResult.Source.StripeID;
}

Let me know if you have any idea.

Wrong date format in the binding?

Adding a package with version 13.1 of the SDK results in error:

The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_CanceledAt`. Use `Foundation.NSDate` instead.

The app terminates immediately, rendering the SDK useless. Is there a way to fix this?

Full error log:

Loaded assembly: /Users/rsroka/Library/Developer/CoreSimulator/Devices/FCE60162-EF0D-4507-B828-FCC140D51911/data/Containers/Bundle/Application/8E2C19D3-7E23-4A8B-882F-35346DF25840/ecarupiOS.app/Naxam.Stripe.iOS.dll [External]
2018-12-10 14:19:47.574785+0100 ecarupiOS[41286:1499047] System.AggregateException: One or more errors occurred. ---> ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_CanceledAt`. Use `Foundation.NSDate` instead.
  at Registrar.Registrar.ToSignature (System.Type type, Registrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x0037a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2542 
  at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2436 
  at Registrar.Registrar.ComputeSignature (S
ystem.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2423 
  at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:882 
  at Registrar.Registrar+ObjCMethod.ValidateSignature (System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:870 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_CanceledAt`. Use `Foundation.NSDate` instead.
  at Registrar.Registrar.ToSignature (System.Type type, Reg
istrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x0037a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2542 
  at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2436 
  at Registrar.Registrar.ComputeSignature (System.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2423 
  at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in /Li
brary/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:882 
  at Registrar.Registrar+ObjCMethod.ValidateSignature (System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:870 <---

---> (Inner Exception #1) ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_created`. Use `Foundation.NSDate` instead.
  at Registrar.Registrar.ToSignature (System.Type type, Registrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x0037a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2542 
  at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registra
r+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2436 
  at Registrar.Registrar.ComputeSignature (System.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2423 
  at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:882 
  at Registrar.Registrar+ObjCMethod.ValidateSignature (System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:870 <---

STPSourceProtocol.StripeID is throwing a null reference exception

I had the same issue with this, let's see if we can fix it.

In implementing STPBackendAPIAdapter.SelectDefaultCustomerSource and accessing the parameter STPSourceProtocol source for the property StripeID throws a NullReferenceException, if you debug at that point you can see an STPCard with the values but accessing the property will throw. Cast is also not possible.

I have worked around the problem using source.ValueForKeyPath(new NSString("stripeID")); and worked.

Let me know if you have any ideas.

All architectures binary must be provided.

Thank you for your work :-)

I guess you didn't try it with the Simulator, but how are you handling the different architectures?
The solution is to build a fat binary for all architectures, see in my repo here, https://github.com/xplatsolutions/Stripe-Xamarin-iOS-Bindings/tree/master/FromSource.

The ideal would be to have one library for simulator and one for device and change using a build script or with your CI-CD platform.

Let me know how would you prefer to tackle this.

P.S. I think it's better to build two framework and not carry the static library binary only because I noticed resources will be missing, I will add the frameworks in my repo if you want or let me know how we can connect, my email is [email protected] :-)

STPSource is not inherited from ISTPAPIResponseDecodable and ISTPSourceProtocol

Hi NAXAM.
I'm Ky. Mobile developer of mobile Xamarin. I had project using Stride payment sdk, so i use package Naxam.Stripe.iOS 11.3.0.
And i found that STPSource is not inherited from ISTPAPIResponseDecodable and ISTPSourceProtocol on dll.
It means: STPSource can't found property StripeID ( ISTPSourceProtocol has StripeID).
It's very serious, because we will can't access to some properties or has a correct type from STPSource to make a charge payment with backend-api.
So i had investigated in the project binding find something:
Code on Apidefinition.cs

[BaseType(typeof(NSObject))]
[DisableDefaultCtor]
interface STPSource : ISTPAPIResponseDecodable, ISTPSourceProtocol
...

I have solution for the issue.

[BaseType(typeof(NSObject))]
[DisableDefaultCtor]
interface STPSource : STPAPIResponseDecodable, STPSourceProtocol
...

So i hope it will make the binding of stripe is better.

Using STPAddCardViewController

I am trying to open STPAddCardViewController (I need customer to enter card number and billing info) so that token is calculated.
I updated the sample with my PublishableKey.

code for my class:
`namespace StripeQs
{

public partial class CardViewController : UIViewController, ISTPAddCardViewControllerDelegate
{


    public override void ViewDidLoad()
    {
        base.ViewDidLoad();
        var config = STPPaymentConfiguration.SharedConfiguration();


    }

    public override void DidReceiveMemoryWarning()
    {
        base.DidReceiveMemoryWarning();
        // Release any cached data, images, etc that aren't in use.
    }


    [Export("addCardViewControllerDidCancel:")]
    public void DidCancel(STPAddCardViewController addCardViewController)
    {
        string a = "aaa";
    }


    [Export("addCardViewController:didCreateToken:completion:")]
    public void DidCreateToken(STPAddCardViewController addCardViewController, STPToken token, STPErrorBlock completion)
    {
        string a = "aaa";

    }

    [Export("addCardViewController:didCreateSource:completion:")]
    public void DidCreateSource(STPAddCardViewController addCardViewController, STPSource token, STPErrorBlock completion)
    {
        string a = "aaa";

    }
}

}
`

But when running the app in simulator and entering the card number and billing info following error is produced:
Failed to compute the token reference for the type 'StripeSdk.ISTPSourceProtocol, Naxam.Stripe.iOS, Version=13.0.2.0, Culture=neutral, PublicKeyToken=null' because the assembly couldn't be found in the list of registered assemblies.

please advise what am I doing wrong

Can't launch on device

Hello, I'm trying to use your binding library, and it's crashes on startup.
Application output is :

Launched application 'net.naxam.stripeqs' on 'iPhone (Artem)' with pid 1041
dyld: Library not loaded: @rpath/Stripe.framework/Stripe
Referenced from: /var/containers/Bundle/Application/3169B1E0-7A62-484B-BAB8-4853374F32DF/StripeQs.app/StripeQs
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/3169B1E0-7A62-484B-BAB8-4853374F32DF/StripeQs.app/Frameworks/Stripe.framework/Stripe: code signing blocked mmap() of '/private/var/containers/Bundle/Application/3169B1E0-7A62-484B-BAB8-4853374F32DF/StripeQs.app/Frameworks/Stripe.framework/Stripe'
Application 'net.naxam.stripeqs' terminated.

Can you help me?
Thanks!

Running demo app

Hi,
I am trying to run demo app, and with test PublishableKey

when card number is entered and verification is started I am getting the following error:

Failed to compute the token reference for the type 'StripeSdk.ISTPSourceProtocol, Naxam.Stripe.iOS, Version=13.0.2.0, Culture=neutral, PublicKeyToken=null' because the assembly couldn't be found in the list of registered assemblies.

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.