@rebilly/framepay-react 5.6.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +2 -2
- package/CHANGELOG.md +13 -0
- package/README.md +17 -17
- package/build/lib/components/elements/applepay-element.js +3 -3
- package/build/lib/components/elements/bank-element.js +2 -2
- package/build/lib/components/elements/base-element.js +3 -3
- package/build/lib/components/elements/card-element.js +2 -2
- package/build/lib/components/elements/googlepay-element.js +3 -3
- package/build/lib/components/elements/iban-element.js +2 -2
- package/build/lib/components/elements/paypal-element.js +3 -3
- package/build/lib/components/injector.js +22 -22
- package/build/lib/components/provider.js +4 -4
- package/build/lib/constants.js +3 -3
- package/build/lib/context.js +3 -3
- package/build/lib/framepay-error.js +2 -2
- package/build/lib/get-framepay-api.d.ts +1 -0
- package/build/lib/get-framepay-api.js +14 -0
- package/package.json +2 -2
- package/src/lib/components/elements/applepay-element.tsx +2 -2
- package/src/lib/components/elements/bank-element.spec.tsx +15 -15
- package/src/lib/components/elements/bank-element.tsx +1 -1
- package/src/lib/components/elements/base-element.tsx +2 -2
- package/src/lib/components/elements/card-element.spec.tsx +12 -12
- package/src/lib/components/elements/card-element.tsx +1 -1
- package/src/lib/components/elements/googlepay-element.tsx +2 -2
- package/src/lib/components/elements/iban-element.spec.tsx +12 -12
- package/src/lib/components/elements/iban-element.tsx +1 -1
- package/src/lib/components/elements/paypal-element.tsx +2 -2
- package/src/lib/components/injector.spec.tsx +6 -6
- package/src/lib/components/injector.tsx +22 -22
- package/src/lib/components/provider.tsx +3 -3
- package/src/lib/constants.ts +2 -2
- package/src/lib/context.ts +2 -2
- package/src/lib/framepay-error.ts +1 -1
- package/src/lib/get-framepay-api.ts +11 -0
- package/test/e2e/fixtures/apple-pay.js +1 -1
- package/test/e2e/fixtures/bank-separate.js +3 -3
- package/test/e2e/fixtures/card-separate-brands.js +5 -5
- package/test/e2e/fixtures/card-separate-rebilly-fields.js +3 -3
- package/test/e2e/fixtures/card-separate.js +3 -3
- package/test/e2e/fixtures/checkout-combined.js +3 -3
- package/test/e2e/fixtures/google-pay.js +1 -1
- package/test/e2e/fixtures/iban.js +2 -2
- package/test/e2e/fixtures/multiple-methods.js +2 -2
- package/test/e2e/fixtures/paypal.js +1 -1
- package/types/context.d.ts +1 -1
- package/types/elements.d.ts +9 -9
- package/types/injector.d.ts +8 -8
- package/types/rebilly/api.d.ts +8 -8
- package/types/rebilly/init-framepay-events.d.ts +4 -0
- package/types/rebilly/payment-methods.d.ts +1 -1
- package/types/rebilly/settings.d.ts +2 -2
- package/build/lib/get-rebilly-api.d.ts +0 -1
- package/build/lib/get-rebilly-api.js +0 -14
- package/src/lib/get-rebilly-api.ts +0 -11
- package/types/rebilly/init-rebilly-events.d.ts +0 -4
|
@@ -3,7 +3,7 @@ import { FRAMEPAY_SCRIPT_LINK } from '../constants';
|
|
|
3
3
|
import { ContextProvider } from '../context';
|
|
4
4
|
import { injectScript, injectStyle } from '../dom-util';
|
|
5
5
|
import FramePayError from '../framepay-error';
|
|
6
|
-
import
|
|
6
|
+
import getFramepayApi from '../get-framepay-api';
|
|
7
7
|
|
|
8
8
|
export default class Provider extends React.Component<
|
|
9
9
|
ProviderProps,
|
|
@@ -18,7 +18,7 @@ export default class Provider extends React.Component<
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
readonly state: FramePayContext = {
|
|
21
|
-
api:
|
|
21
|
+
api: getFramepayApi(),
|
|
22
22
|
error: null,
|
|
23
23
|
ready: false,
|
|
24
24
|
};
|
|
@@ -52,7 +52,7 @@ export default class Provider extends React.Component<
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
async onApiReady() {
|
|
55
|
-
const api =
|
|
55
|
+
const api = getFramepayApi();
|
|
56
56
|
try {
|
|
57
57
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
58
58
|
const { injectStyle, children, ...settings } = this.props;
|
package/src/lib/constants.ts
CHANGED
|
@@ -18,14 +18,14 @@ export const REACT_VERSION = React.version;
|
|
|
18
18
|
*/
|
|
19
19
|
export const FRAMEPAY_SCRIPT_LINK: string =
|
|
20
20
|
process.env.FRAMEPAY_SCRIPT_LINK ||
|
|
21
|
-
'https://framepay.rebilly.com/
|
|
21
|
+
'https://framepay.rebilly.com/framepay.js';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Remote FramePay style CDN link.
|
|
25
25
|
*/
|
|
26
26
|
export const FRAMEPAY_STYLE_LINK: string =
|
|
27
27
|
process.env.FRAMEPAY_STYLE_LINK ||
|
|
28
|
-
'https://framepay.rebilly.com/
|
|
28
|
+
'https://framepay.rebilly.com/framepay.css';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Supported FramePay card types
|
package/src/lib/context.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { REACT_VERSION } from './constants';
|
|
3
|
-
import
|
|
3
|
+
import getFramepayApi from './get-framepay-api';
|
|
4
4
|
|
|
5
5
|
const defaultContextValue = {
|
|
6
|
-
api:
|
|
6
|
+
api: getFramepayApi(),
|
|
7
7
|
error: null,
|
|
8
8
|
ready: false,
|
|
9
9
|
};
|
|
@@ -10,7 +10,7 @@ export const defaultErrorMessages = {
|
|
|
10
10
|
[ERROR_CODES.initializeError]: `
|
|
11
11
|
FramePay initialize error\r\n
|
|
12
12
|
See https://github.com/Rebilly/framepay-react/tree/alpha#the-framepay-context-framepayprovider\r\n
|
|
13
|
-
See https://rebilly.
|
|
13
|
+
See https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.initialize`,
|
|
14
14
|
} as DefaultErrorMessages;
|
|
15
15
|
|
|
16
16
|
class ErrorBuilder {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Just simple wrapper of remote FramePay api
|
|
3
|
+
*/
|
|
4
|
+
const remoteApi = (): FramepayApi => {
|
|
5
|
+
// @ts-ignore todo setup typescript config correctly
|
|
6
|
+
return typeof window !== 'undefined' ? window.Framepay : undefined;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default function getFramepayApi(): FramepayApi {
|
|
10
|
+
return remoteApi();
|
|
11
|
+
}
|
|
@@ -43,7 +43,7 @@ class App extends Component {
|
|
|
43
43
|
<div>
|
|
44
44
|
{ReactVersion()}
|
|
45
45
|
<div>
|
|
46
|
-
<h3>FramePay version: {this.props.
|
|
46
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
47
47
|
<div className="flex-wrapper">
|
|
48
48
|
{prettyDebugRender(this.state)}
|
|
49
49
|
<this.props.ApplePayElement />
|
|
@@ -52,7 +52,7 @@ class CardElementComponent extends Component {
|
|
|
52
52
|
e.preventDefault();
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
|
-
* @see https://rebilly.
|
|
55
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
58
|
|
|
@@ -76,7 +76,7 @@ class CardElementComponent extends Component {
|
|
|
76
76
|
];
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
this.props.
|
|
79
|
+
this.props.Framepay.createToken(this.formNode, { billingAddress })
|
|
80
80
|
.then((data) => {
|
|
81
81
|
this.deepUpdateState({ token: { error: false, data } });
|
|
82
82
|
})
|
|
@@ -93,7 +93,7 @@ class CardElementComponent extends Component {
|
|
|
93
93
|
return (
|
|
94
94
|
<div>
|
|
95
95
|
<h2>{this.props.title}</h2>
|
|
96
|
-
<h3>FramePay version: {this.props.
|
|
96
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
97
97
|
<div className="flex-wrapper">
|
|
98
98
|
{prettyDebugRender(this.state)}
|
|
99
99
|
<div className="example-2">
|
|
@@ -75,7 +75,7 @@ class CardElementComponent extends Component {
|
|
|
75
75
|
e.preventDefault();
|
|
76
76
|
/**
|
|
77
77
|
*
|
|
78
|
-
* @see https://rebilly.
|
|
78
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
79
79
|
*
|
|
80
80
|
*/
|
|
81
81
|
const billingAddress = {
|
|
@@ -98,7 +98,7 @@ class CardElementComponent extends Component {
|
|
|
98
98
|
];
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
this.props.
|
|
101
|
+
this.props.Framepay.createToken(this.formNode, { billingAddress })
|
|
102
102
|
.then((data) => {
|
|
103
103
|
this.deepUpdateState({ token: { error: false, data } });
|
|
104
104
|
})
|
|
@@ -113,7 +113,7 @@ class CardElementComponent extends Component {
|
|
|
113
113
|
|
|
114
114
|
handleUpdateSettings() {
|
|
115
115
|
this.setState({ button: 'update' });
|
|
116
|
-
this.props.
|
|
116
|
+
this.props.Framepay.update({
|
|
117
117
|
...params,
|
|
118
118
|
card: { brands: { allowed: null } },
|
|
119
119
|
});
|
|
@@ -121,7 +121,7 @@ class CardElementComponent extends Component {
|
|
|
121
121
|
|
|
122
122
|
handleRestoreSettings() {
|
|
123
123
|
this.setState({ button: 'restore' });
|
|
124
|
-
this.props.
|
|
124
|
+
this.props.Framepay.update({
|
|
125
125
|
...params,
|
|
126
126
|
});
|
|
127
127
|
}
|
|
@@ -130,7 +130,7 @@ class CardElementComponent extends Component {
|
|
|
130
130
|
return (
|
|
131
131
|
<div>
|
|
132
132
|
<h2>{this.props.title}</h2>
|
|
133
|
-
<h3>FramePay version: {this.props.
|
|
133
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
134
134
|
<div className="flex-wrapper">
|
|
135
135
|
{prettyDebugRender(this.state)}
|
|
136
136
|
<div className="example-2">
|
|
@@ -75,10 +75,10 @@ class CardElementComponent extends Component {
|
|
|
75
75
|
e.preventDefault();
|
|
76
76
|
/**
|
|
77
77
|
*
|
|
78
|
-
* @see https://rebilly.
|
|
78
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
79
79
|
*
|
|
80
80
|
*/
|
|
81
|
-
this.props.
|
|
81
|
+
this.props.Framepay.createToken(this.formNode, {
|
|
82
82
|
billingAddress: {
|
|
83
83
|
emails: [
|
|
84
84
|
{
|
|
@@ -104,7 +104,7 @@ class CardElementComponent extends Component {
|
|
|
104
104
|
return (
|
|
105
105
|
<div>
|
|
106
106
|
<h2>{this.props.title}</h2>
|
|
107
|
-
<h3>FramePay version: {this.props.
|
|
107
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
108
108
|
<div className="flex-wrapper">
|
|
109
109
|
{prettyDebugRender(this.state)}
|
|
110
110
|
<div className="example-2">
|
|
@@ -82,7 +82,7 @@ class CardElementComponent extends Component {
|
|
|
82
82
|
e.preventDefault();
|
|
83
83
|
/**
|
|
84
84
|
*
|
|
85
|
-
* @see https://rebilly.
|
|
85
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
86
86
|
*
|
|
87
87
|
*/
|
|
88
88
|
const billingAddress = {
|
|
@@ -105,7 +105,7 @@ class CardElementComponent extends Component {
|
|
|
105
105
|
];
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
this.props.
|
|
108
|
+
this.props.Framepay.createToken(this.formNode, { billingAddress })
|
|
109
109
|
.then((data) => {
|
|
110
110
|
this.deepUpdateState({ token: { error: false, data } });
|
|
111
111
|
})
|
|
@@ -122,7 +122,7 @@ class CardElementComponent extends Component {
|
|
|
122
122
|
return (
|
|
123
123
|
<div>
|
|
124
124
|
<h2>{this.props.title}</h2>
|
|
125
|
-
<h3>FramePay version: {this.props.
|
|
125
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
126
126
|
<div className="flex-wrapper">
|
|
127
127
|
{prettyDebugRender(this.state)}
|
|
128
128
|
<div className="example-2">
|
|
@@ -69,7 +69,7 @@ class CardElementComponent extends Component {
|
|
|
69
69
|
e.preventDefault();
|
|
70
70
|
/**
|
|
71
71
|
*
|
|
72
|
-
* @see https://rebilly.
|
|
72
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
73
73
|
*
|
|
74
74
|
*/
|
|
75
75
|
const billingAddress = {
|
|
@@ -92,7 +92,7 @@ class CardElementComponent extends Component {
|
|
|
92
92
|
];
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
this.props.
|
|
95
|
+
this.props.Framepay.createToken(this.formNode, { billingAddress })
|
|
96
96
|
.then((data) => {
|
|
97
97
|
this.deepUpdateState({ token: { error: false, data } });
|
|
98
98
|
})
|
|
@@ -111,7 +111,7 @@ class CardElementComponent extends Component {
|
|
|
111
111
|
return (
|
|
112
112
|
<div>
|
|
113
113
|
<h2>{this.props.title}</h2>
|
|
114
|
-
<h3>FramePay version: {this.props.
|
|
114
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
115
115
|
<div className="flex-wrapper">
|
|
116
116
|
{prettyDebugRender(this.state)}
|
|
117
117
|
<div className="example-2">
|
|
@@ -43,7 +43,7 @@ class App extends Component {
|
|
|
43
43
|
<div>
|
|
44
44
|
{ReactVersion()}
|
|
45
45
|
<div>
|
|
46
|
-
<h3>FramePay version: {this.props.
|
|
46
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
47
47
|
<div className="flex-wrapper">
|
|
48
48
|
{prettyDebugRender(this.state)}
|
|
49
49
|
<this.props.GooglePayElement />
|
|
@@ -44,7 +44,7 @@ class IBANlementComponent extends Component {
|
|
|
44
44
|
e.preventDefault();
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
|
-
* @see https://rebilly.
|
|
47
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
50
|
|
|
@@ -68,7 +68,7 @@ class IBANlementComponent extends Component {
|
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
this.props.
|
|
71
|
+
this.props.Framepay.createToken(this.formNode, { billingAddress })
|
|
72
72
|
.then((data) => {
|
|
73
73
|
this.deepUpdateState({
|
|
74
74
|
events: { ...emptyEvents },
|
|
@@ -74,14 +74,14 @@ class PaymentFormComponent extends Component {
|
|
|
74
74
|
e.preventDefault();
|
|
75
75
|
/**
|
|
76
76
|
*
|
|
77
|
-
* @see https://rebilly.
|
|
77
|
+
* @see https://www.rebilly.com/docs/dev-docs/framepay-global-reference/#framepay.createtoken
|
|
78
78
|
*
|
|
79
79
|
*/
|
|
80
80
|
const billingAddress = {
|
|
81
81
|
...this.state.billingAddress,
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
this.props.
|
|
84
|
+
this.props.Framepay.createToken(this.formNode, {
|
|
85
85
|
// method: this.state.paymentElements[this.state.paymentElement],
|
|
86
86
|
billingAddress,
|
|
87
87
|
})
|
|
@@ -39,7 +39,7 @@ class App extends Component {
|
|
|
39
39
|
<div>
|
|
40
40
|
{ReactVersion()}
|
|
41
41
|
<div>
|
|
42
|
-
<h3>FramePay version: {this.props.
|
|
42
|
+
<h3>FramePay version: {this.props.Framepay.version}</h3>
|
|
43
43
|
<div className="flex-wrapper">
|
|
44
44
|
{prettyDebugRender(this.state)}
|
|
45
45
|
<this.props.PaypalElement />
|
package/types/context.d.ts
CHANGED
package/types/elements.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* framepay-react react element types
|
|
3
3
|
*/
|
|
4
|
-
interface
|
|
4
|
+
interface FramepayProps extends FramepayApi {
|
|
5
5
|
readonly error: FramePayErrorCode | null;
|
|
6
6
|
readonly ready: boolean;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
interface PaymentComponentProps extends
|
|
10
|
-
readonly
|
|
9
|
+
interface PaymentComponentProps extends FramepayProps {
|
|
10
|
+
readonly Framepay: FramepayProps;
|
|
11
11
|
readonly id?: string;
|
|
12
12
|
readonly onReady?: () => void;
|
|
13
13
|
readonly onChange?: (data: PaymentElementOnChangeEventData) => void;
|
|
@@ -33,18 +33,18 @@ interface CardProps extends PaymentComponentProps {
|
|
|
33
33
|
readonly elementType?: CardPaymentElementTypes;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
interface ApplePayProps extends
|
|
37
|
-
readonly
|
|
36
|
+
interface ApplePayProps extends FramepayProps {
|
|
37
|
+
readonly Framepay: FramepayProps;
|
|
38
38
|
readonly id?: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
interface GooglePayProps extends
|
|
42
|
-
readonly
|
|
41
|
+
interface GooglePayProps extends FramepayProps {
|
|
42
|
+
readonly Framepay: FramepayProps;
|
|
43
43
|
readonly id?: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
interface PaypalProps extends
|
|
47
|
-
readonly
|
|
46
|
+
interface PaypalProps extends FramepayProps {
|
|
47
|
+
readonly Framepay: FramepayProps;
|
|
48
48
|
readonly id?: string;
|
|
49
49
|
}
|
|
50
50
|
|
package/types/injector.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface FramePayComponentProps {
|
|
2
|
-
//
|
|
3
|
-
readonly
|
|
2
|
+
// Framepay Api
|
|
3
|
+
readonly Framepay: FramepayProps;
|
|
4
4
|
|
|
5
5
|
// Card Components
|
|
6
6
|
readonly CardCvvElement: React.ElementType;
|
|
@@ -23,7 +23,7 @@ export interface FramePayComponentProps {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface FramePayCardProps {
|
|
26
|
-
readonly
|
|
26
|
+
readonly Framepay: FramepayProps;
|
|
27
27
|
readonly CardCvvElement: React.ElementType;
|
|
28
28
|
readonly CardElement: React.ElementType;
|
|
29
29
|
readonly CardExpiryElement: React.ElementType;
|
|
@@ -31,28 +31,28 @@ export interface FramePayCardProps {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface FramePayBankProps {
|
|
34
|
-
readonly
|
|
34
|
+
readonly Framepay: FramepayProps;
|
|
35
35
|
readonly BankAccountNumberElement: React.ElementType;
|
|
36
36
|
readonly BankAccountTypeElement: React.ElementType;
|
|
37
37
|
readonly BankRoutingNumberElement: React.ElementType;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export interface FramePayIBANProps {
|
|
41
|
-
readonly
|
|
41
|
+
readonly Framepay: FramepayProps;
|
|
42
42
|
readonly IBANElement: React.ElementType;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export interface FramePayApplePayProps {
|
|
46
|
-
readonly
|
|
46
|
+
readonly Framepay: FramepayProps;
|
|
47
47
|
readonly ApplePayElement: React.ElementType;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export interface FramePayGooglePayProps {
|
|
51
|
-
readonly
|
|
51
|
+
readonly Framepay: FramepayProps;
|
|
52
52
|
readonly GooglePayElement: React.ElementType;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export interface FramePayPaypalProps {
|
|
56
|
-
readonly
|
|
56
|
+
readonly Framepay: FramepayProps;
|
|
57
57
|
readonly PaypalElement: React.ElementType;
|
|
58
58
|
}
|
package/types/rebilly/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The api is something that should be passed
|
|
3
|
-
* to the createToken
|
|
3
|
+
* to the createToken Framepay api method
|
|
4
4
|
*/
|
|
5
5
|
interface BillingAddress {
|
|
6
6
|
readonly firstName: string;
|
|
@@ -23,17 +23,17 @@ interface BillingAddress {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
interface TokenExtraData {
|
|
26
|
-
readonly method?: PaymentMethods; // @see https://rebilly.
|
|
26
|
+
readonly method?: PaymentMethods; // @see https://www.rebilly.com/docs/dev-docs/api/Payment-tokens/PostToken/
|
|
27
27
|
readonly billingAddress?: BillingAddress;
|
|
28
28
|
readonly leadSource?: object;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type
|
|
31
|
+
type FramepayEventDelegate = (arg: object) => void;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* The FramePay api interface (external api)
|
|
35
35
|
*/
|
|
36
|
-
interface
|
|
36
|
+
interface FramepayApi {
|
|
37
37
|
readonly initialize: (settings: FramePaySettings) => void;
|
|
38
38
|
readonly card: CardPaymentElement;
|
|
39
39
|
readonly bankAccount: BankPaymentMethod;
|
|
@@ -47,12 +47,12 @@ interface RebillyApi {
|
|
|
47
47
|
) => void;
|
|
48
48
|
|
|
49
49
|
readonly on: (
|
|
50
|
-
event:
|
|
51
|
-
callback:
|
|
50
|
+
event: initFramepayEvents,
|
|
51
|
+
callback: FramepayEventDelegate
|
|
52
52
|
) => void;
|
|
53
53
|
|
|
54
54
|
readonly off: (
|
|
55
|
-
event:
|
|
56
|
-
callback:
|
|
55
|
+
event: initFramepayEvents,
|
|
56
|
+
callback: FramepayEventDelegate
|
|
57
57
|
) => void;
|
|
58
58
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Settings
|
|
3
3
|
*
|
|
4
4
|
* The settings is something that
|
|
5
|
-
* you could pass to the
|
|
6
|
-
* or
|
|
5
|
+
* you could pass to the Framepay.initialize(settings) method
|
|
6
|
+
* or Framepay.update(settings) method
|
|
7
7
|
*/
|
|
8
8
|
interface FramePaySettingsStyles {
|
|
9
9
|
readonly base?: object;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function getRebillyApi(): RebillyApi;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Just simple wrapper of remote FramePay api
|
|
5
|
-
*/
|
|
6
|
-
var remoteApi = function () {
|
|
7
|
-
// @ts-ignore todo setup typescript config correctly
|
|
8
|
-
return typeof window !== 'undefined' ? window.Rebilly : undefined;
|
|
9
|
-
};
|
|
10
|
-
function getRebillyApi() {
|
|
11
|
-
return remoteApi();
|
|
12
|
-
}
|
|
13
|
-
exports.default = getRebillyApi;
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXJlYmlsbHktYXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi9nZXQtcmViaWxseS1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7R0FFRztBQUNILElBQU0sU0FBUyxHQUFHO0lBQ2Qsb0RBQW9EO0lBQ3BELE9BQU8sT0FBTyxNQUFNLEtBQUssV0FBVyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7QUFDdEUsQ0FBQyxDQUFDO0FBRUYsU0FBd0IsYUFBYTtJQUNqQyxPQUFPLFNBQVMsRUFBRSxDQUFDO0FBQ3ZCLENBQUM7QUFGRCxnQ0FFQyJ9
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Just simple wrapper of remote FramePay api
|
|
3
|
-
*/
|
|
4
|
-
const remoteApi = (): RebillyApi => {
|
|
5
|
-
// @ts-ignore todo setup typescript config correctly
|
|
6
|
-
return typeof window !== 'undefined' ? window.Rebilly : undefined;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default function getRebillyApi(): RebillyApi {
|
|
10
|
-
return remoteApi();
|
|
11
|
-
}
|