triniwiz / nativescript-stripe

Apache License 2.0
49 stars 34 forks source link

createSource support #105

Closed MohammedBashiru closed 4 years ago

MohammedBashiru commented 4 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

We need support for creating Sources Reference from SDK https://stripe.com/docs/mobile/ios/sources

RobertGardner commented 4 years ago

What are you trying to do? According to the Stripe documentation, you use Payment Intents on the mobile app to create payment sources. See Accept a payment. This interaction is supported by NS-Stripe. (See also, Transitioning to the Payment Methods API, which says "The Payment Methods API replaces the existing Tokens and Sources APIs as the recommended way for integrations to collect and store payment information.")

Also, the Stripe iOS sample illustrating the Basic Integration does not use STPSource directly.

If you could provide more details about what you are trying to do, I may be able to help.

MohammedBashiru commented 4 years ago

thank you @RobertGardner.

Our web app uses the stripe.js to create source, which then the source id is sent to the backed to create a source object for the customer.

I did not find similar API in the nativescript-stripe plugin. Similar was to create payment Token but our API is only implemented for stripe source.

sure the Payment Methods API is the recommended but our back-end API is already implemented with the Sources API.

I have already submitted PR for the source implemented if that's OK by you.

RobertGardner commented 4 years ago

Thanks for doing this. I have some comments on the PR.

MohammedBashiru commented 4 years ago

@RobertGardner can I get your lint and any other setup so that I don't have to miss any errors when making changes.

if you don't like to share here please email me. mohammedbashiru63@gmail.com

thanks

RobertGardner commented 4 years ago

Yes, no problem sharing it publicly. The lint rules are in the repository, at the root, as tslint.json.

The lint rules don't include everything I commented on. Some of those come from the formatter I use. I code with VS Code and use the standard TypeScript formatter with no changes (except preferring double quotes for historical reasons -- I may change that some day since the repository is somewhat inconsistent). These won't cause build failures, but I'd prefer they be used on all code submitted to the repository for consistency.

I also have VS Code set up to highlights all lint errors while I'm editing, so they're easy to catch.

MohammedBashiru commented 4 years ago

Seems we have similar setup, yet I couldn't catch those petty errors.

The comments were very helpful and I wish i can get a setup like that for my other projects.

RobertGardner commented 4 years ago

Added in v6.4.0 for credit cards.