Skip to content

Commit f0e2071

Browse files
committed
updates
1 parent 57f1da8 commit f0e2071

35 files changed

+1373
-73
lines changed

docs/src/.vuepress/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const { description } = require('../../package')
22

33
module.exports = {
4+
base: '/nativescript-plugins/',
5+
46
/**
57
* Ref:https://v1.vuepress.vuejs.org/config/#title
68
*/

docs/src/api-reference/downloader.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# Downloader
1+
# Downloader
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-downloader
12+
```
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# FancyCamera
1+
# FancyCamera
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-fancycamera
12+
```
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# Fancy Listview
1+
# Fancy Listview
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-fancy-listview
12+
```

docs/src/api-reference/ffmpeg.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# FFMPEG
1+
# FFMPEG
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-ffmpeg
12+
```

docs/src/api-reference/here.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# Here
1+
# Here
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-here
12+
```
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
# ImageOptimize
1+
# ImageOptimize
2+
3+
4+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
5+
| :-------------: |:-------------: |:-------------:| :-----: |
6+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
7+
8+
9+
## Installing
10+
11+
```base
12+
ns plugin add @triniwiz/nativescript-imageoptimize
13+
```
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# NestedScrollview
1+
# NestedScrollview
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-nestedscrollview
12+
```

docs/src/api-reference/popover.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# PopOver
1+
# PopOver
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-popover
12+
```

docs/src/api-reference/socketio.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# SocketIO
1+
# SocketIO
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-socketio
12+
```

docs/src/api-reference/sse.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# SSE
1+
# SSE
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-sse
12+
```
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# Star-Ratings
1+
# Star-Ratings
2+
3+
| Android Device | Android Emulator | iOS Device | iOS Simulator |
4+
| :-------------: |:-------------: |:-------------:| :-----: |
5+
| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:|
6+
7+
8+
## Installing
9+
10+
```base
11+
ns plugin add @triniwiz/nativescript-star-ratings
12+
```

docs/src/api-reference/stripe.md

Lines changed: 130 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,138 @@ export class AppModule { }
4343

4444
## Vue
4545

46+
```ts
47+
import Vue from 'nativescript-vue';
48+
import Pager from 'triniwiz/nativescript-stripe/vue';
49+
50+
Vue.use(Pager);
51+
```
52+
53+
54+
```html
55+
<creditCardView></creditCardView>
56+
```
57+
4658
## React
4759

60+
```tsx
61+
import {creditCardView} from 'triniwiz/nativescript-stripe/react';
62+
return (
63+
<creditCardView/>
64+
)
65+
```
66+
4867
## Svelte
68+
```ts
69+
import "@triniwiz/nativescript-stripe/svelte";
70+
```
71+
```html
72+
<creditCardView></creditCardView>
73+
```
74+
75+
76+
# Usage
77+
78+
IMPORTANT: Make sure you include `xmlns:stripe="nativescript-stripe"` on the Page tag
79+
80+
### Using from view
81+
```xml
82+
<stripe:CreditCardView id="card"/>
83+
```
84+
85+
#### Add extra details to card
86+
87+
JavaScript
88+
```js
89+
const ccView = page.getViewById("card");
90+
const cc = ccView.card;
91+
cc.name = "Osei Fortune";
92+
```
93+
94+
TypeScript
95+
```ts
96+
import { CreditCardView, Card } from 'nativescript-stripe';
97+
const ccView:CreditCardView = page.getViewById("card");
98+
const cc:Card = ccView.card;
99+
cc.name = "Osei Fortune";
100+
```
101+
### Using from code
102+
```ts
103+
import { Card } from 'nativescript-stripe';
104+
const cc = new Card("1111111111111111",2,18,"123");
105+
cc.name = "Osei Fortune";
106+
```
107+
108+
## Standard Integration
109+
110+
The `demo` and `demo-angular` folders contain demos that use the Standard Integration.
111+
They can be used as a starting point, and provide information on how to invoke the
112+
Standard Integration components. For more information, see the README in the
113+
demo folders.
114+
115+
Set Stripe configuration values:
116+
117+
```ts
118+
StripeStandardConfig.shared.backendAPI = <Your API Service>;
119+
StripeStandardConfig.shared.publishableKey = <Your Stripe Key>;
120+
StripeStandardConfig.shared.companyName = <Your Company Name>;
121+
// To support Apple Pay, set appleMerchantID.
122+
StripeStandardConfig.shared.appleMerchantID = <Your Apple Merchant ID>;
123+
```
124+
125+
Create a Customer Session
126+
```ts
127+
let customerSession = new StripeStandardCustomerSession();
128+
```
129+
130+
Create a Payment Session
131+
```ts
132+
let paymentSession = new StripeStandardPaymentSession(page, customerSession, price, "usd", listener);
133+
```
134+
135+
See [Stripe Docs](https://stripe.com/docs/mobile) for more information.
136+
137+
# Strong Customer Authentication
138+
PSD2 regulations in Europe will require [Strong Customer Authentication](https://stripe.com/payments/strong-customer-authentication)
139+
for some credit card purchases. Stripe supports this, though most of the work to make it happen is
140+
required on the backend server and in the mobile app, outside the `@triniwiz/nativescript-stripe` plugin.
141+
142+
To support SCA, follow the instructions for [iOS](https://stripe.com/docs/payments/payment-intents/ios)
143+
and [Android](https://stripe.com/docs/payments/payment-intents/android) on using `PaymentIntents` instead
144+
of tokens when interacting with your backend server. The `@triniwiz/nativescript-stripe` plugin has
145+
cross-platform data structures and method calls that might be helpful. In `index.d.ts` see:
146+
* `PaymentMethod` and related classes
147+
* `StripePaymentIntent` and related classes
148+
* Methods `Stripe.createPaymentMethod`, `Stripe.retrievePaymentIntent`, `Stripe.confirmPaymentIntent` and `Stripe.confirmSetupIntent`
149+
150+
## Handling secondary customer input
151+
SCA requires the customer to enter additional information with some charge cards. Stripe takes care of this
152+
if you properly handle the redirect from the `StripePaymentIntent` returned from the server.
153+
154+
If you're using the [automatic confirmation flow](https://stripe.com/docs/payments/payment-intents/ios#automatic-confirmation-ios), `confirmPaymentIntent` and `confirmSetupIntent` will automatically manage the SCA validation by showing and validating the payment authentification.
155+
156+
If you're using the [manual confirmation flow](https://stripe.com/docs/payments/payment-intents/ios#manual-confirmation-ios), where back-end creates the `PaymentIntent`|`SetupIntent` and requires an Intent authentification from the customer, `authenticatePaymentIntent` and `authenticateSetupIntent` will allow to manage that extra step before sending back the Intent to your server.
157+
158+
## Status
159+
`demo-angular` now supports `SetupIntent` and `PaymentIntent` SCA integration. Any credit card verification will be automatically prompted to the user.
160+
161+
# Known Issues
162+
163+
## `const enum` not found
164+
When building with NativeScript v6+, it builds using the webpack-only flow in "transpileOnly" mode. A webpack [issue](https://github.com/NativeScript/nativescript-dev-webpack/issues/927) means that `const enum` values cannot be found in the final output.
165+
166+
This problem is not present in Angular projects and likely won't be an issue if you do not use any of the exported enums.
167+
168+
Unfortunately, the only fix I've found for this is to follow the advice in that issue and modify `webpack.config.js` in your app to set `transpileOnly` to `false`.
169+
170+
Note: This may no longer be needed once this TypeScript [bug](https://github.com/Microsoft/TypeScript/issues/16671) is fixed.
171+
172+
## API
173+
174+
## TODO
175+
176+
* Android Pay
177+
* Apple Pay (supported by Standard Integration, not by Custom Integration)
178+
49179

50180

51-
## API

nx.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"nx.json": "*"
1515
},
1616
"projects": {
17+
"docs": {
18+
"tags": []
19+
},
1720
"demo": {
1821
"tags": []
1922
},

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"add": "nx g @nativescript/plugin-tools:add-package",
99
"add-angular": "nx g @nativescript/plugin-tools:add-angular",
1010
"config": "nx g @nativescript/plugin-tools:config",
11-
"publish-packages": "nx g @nativescript/plugin-tools:publish"
11+
"publish-packages": "nx g @nativescript/plugin-tools:publish",
12+
"docs:build": "cd docs && vuepress build src"
1213
},
1314
"private": true,
1415
"devDependencies": {
@@ -26,12 +27,18 @@
2627
"@nativescript/plugin-tools": "~1.0.0",
2728
"@nativescript/types": "~7.0.0",
2829
"@nativescript/webpack": "~3.0.0",
30+
"@types/react-reconciler": "^0.18.0",
2931
"@ngtools/webpack": "~10.1.0",
3032
"nativescript-vue": "~2.8.0",
3133
"nativescript-vue-template-compiler": "~2.8.0",
3234
"ng-packagr": "~10.1.0",
35+
"react": "^16.8.6",
36+
"react-nativescript": "~1.0.6",
3337
"rxjs": "~6.6.0",
38+
"svelte": "3.24.1",
39+
"svelte-native": "0.9.0-alpha",
3440
"typescript": "~3.9.7",
41+
"vuepress": "^1.5.3",
3542
"zone.js": "0.11.1"
3643
},
3744
"husky": {

packages/nativescript-stripe/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Nativescript Stripe
22

3-
```javascript
3+
```bash
44
ns plugin add @triniwiz/nativescript-stripe
55
```
66

77
## API documentation
88

9-
[Documentation for the latest stable release]()
9+
[Documentation for the latest stable release](https://triniwiz.github.io/nativescript-plugins/api-reference/stripe.html)
1010

1111
## License
1212

0 commit comments

Comments
 (0)