Skip to content

Commit

Permalink
Setup accountId (#88)
Browse files Browse the repository at this point in the history
* Update angular-demo to NS6

* Update demo to NS6

* Update android-sdk to 10.2.1

* Remove dev-typescript

* migrate API

* restore SDK 8.7.0

* Use androidx

* fix namespace

* fix app start

* remove bundle and uglify

* Restore 10.2.1 SDK

* Fix merge issue

* Update defs

* Enable multidex

* Bump minSDK version

* Update {N} version on travis

* Remove useless template

* Rename _android var to _widget

* fix commas

* Implements createPaymentMethod

* Add debug run

* Add stripe3ds2 typings

* Init PaymentConfiguration before CustomerSession

* Fix requestPayment on Android

* Cleans

* Update typings

* Update xcode and node versions

* Fix frame is undefined

* Add webpack configs to demos

* confirmPaymentIntent uses StripePaymentIntentParams

* Add create intent endpoint

* Demo Intent

* PaymentConfiguration.init called once

* Update paymentIntent conf

* Update ios podfile to 16.0.6

* Fix creditcard view

* Fix paymentContextDidCreatePaymentResultCompletion

* add debug demo.ios

* Remove deleted createCardSources attribute

* tmp paymentWithAuthent

* Changelog

* Remove unused import

* Fix authentification context

* Add status

* Factorize StripeIntent

* Clean component

* cleans

* Remove source and use payment method

* remove source

* Restore keys

* Update SDK in README

* Fix semicolons

* trailing spaces

* cleans

* refactor stripeIntent for Android

* Update README

* tslint

* Exclude platforms from tslint

* Handle automatic and manual payment intent flows

* fix tslint

* Update README and Changelog

* feedbacks

* cleans

* requiresCapture helper

* Bump version

* Fix ios contextMethod from modals

* fix linter

* Remove confirmPaymentIntent from index.d.ts

* Fix keyUpdateListener.onKeyUpdateFailure error

* Push last PR updates

* Fix missing properties in index.d.ts

* Ability to set the accountId
  • Loading branch information
jeremypele authored and RobertGardner committed Nov 7, 2019
1 parent cb6d563 commit d87f593
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog
==============================

## 6.1.0 (2019, November 6)
### Updates
- Ability to set accountId `stripe.setStripeAccount('xxx')`

## 6.0.0 (2019, August 25)
### Updates
Expand Down
3 changes: 2 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { View } from "tns-core-modules/ui/core/view";

export declare class Stripe {
constructor(apiKey: string);
setStripeAccount(accountId: string): void;
createToken(card: CardCommon, cb: (error: Error, token: Token) => void): void;
createPaymentMethod(card: CardCommon, cb: (error: Error, pm: PaymentMethod) => void): void;
retrievePaymentIntent(clientSecret: string, cb: (error: Error, pm: StripePaymentIntent) => void): void;
Expand Down Expand Up @@ -180,4 +181,4 @@ export declare const enum StripeRedirectState {
InProgress = 1,
Cancelled = 2,
Completed = 3
}
}
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-stripe",
"version": "6.0.0",
"version": "6.1.0",
"description": "NativeScript Stripe sdk",
"main": "stripe",
"typings": "index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/stripe.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export class Stripe {
);
}

setStripeAccount(accountId: string) {
this._stripe.setStripeAccount(accountId);
}

createToken(card: CardCommon, cb: (error: Error, token: Token) => void): void {
if (!card) {
if (typeof cb === 'function') {
Expand Down
4 changes: 4 additions & 0 deletions src/stripe.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export class Stripe {
STPPaymentConfiguration.sharedConfiguration().publishableKey = apiKey;
}

setStripeAccount(accountId: string) {
STPPaymentConfiguration.sharedConfiguration().stripeAccount = accountId;
}

createToken(card: CardCommon, cb: (error: Error, token: Token) => void): void {
if (!card) {
if (typeof cb === 'function') {
Expand Down

0 comments on commit d87f593

Please sign in to comment.