@openhive-eu/payment 0.0.0-beta.4 → 1.0.0-next.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/dist/components/country-select.d.ts +7 -0
- package/dist/components/ui/button.d.ts +11 -7
- package/dist/components/ui/field.d.ts +4 -24
- package/dist/components/ui/icons.d.ts +2 -0
- package/dist/components/ui/input.d.ts +4 -3
- package/dist/components/ui/radio-group.d.ts +22 -5
- package/dist/components/ui/radio-input.d.ts +11 -0
- package/dist/components/ui/skeleton.d.ts +3 -2
- package/dist/components/ui/spinner.d.ts +2 -2
- package/dist/index.cdn.d.ts +1 -0
- package/dist/index.d.ts +2 -18
- package/dist/index.js +5290 -10102
- package/dist/index.js.gz +0 -0
- package/dist/index.min.js +248 -0
- package/dist/index.min.js.gz +0 -0
- package/dist/lib/api-client.d.ts +2 -4
- package/dist/lib/i18n.d.ts +22 -0
- package/dist/lib/pay-client.d.ts +16 -27
- package/dist/lib/utils.d.ts +2 -0
- package/dist/payment-widget.d.ts +59 -0
- package/dist/react-widget.d.ts +40 -0
- package/dist/react.js +6231 -0
- package/dist/register.d.ts +3 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css.gz +0 -0
- package/package.json +51 -32
- package/README.md +0 -1
- package/dist/components/activity.d.ts +0 -6
- package/dist/components/channel.d.ts +0 -7
- package/dist/components/error-fallback.d.ts +0 -2
- package/dist/components/pay-client-provider.d.ts +0 -5
- package/dist/components/pay-provider.d.ts +0 -8
- package/dist/components/pay-terminal.d.ts +0 -18
- package/dist/components/payment-methods.d.ts +0 -6
- package/dist/components/select-countries.d.ts +0 -6
- package/dist/components/ui/fade-in.d.ts +0 -4
- package/dist/components/ui/label.d.ts +0 -4
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/separator.d.ts +0 -4
- package/dist/index.css +0 -1
- package/dist/index.umd.cjs +0 -58
|
Binary file
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { paths, components } from "./gen/api-schema";
|
|
2
|
-
declare
|
|
3
|
-
declare const setAccessToken: (token: string) => void;
|
|
4
|
-
declare const client: import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
2
|
+
declare function createApiClient(baseUrl: string, token: string, locale?: string): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
5
3
|
type RequestToPay = components["schemas"]["Payment.CreatePaymentInput"];
|
|
6
4
|
type Currency = components["schemas"]["Payment.CreatePaymentInput"]["currency"];
|
|
7
5
|
type Method = components["schemas"]["Payment.CreatePaymentInput"]["method"];
|
|
8
|
-
export {
|
|
6
|
+
export { createApiClient };
|
|
9
7
|
export type { RequestToPay, Currency, Method };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Translations = {
|
|
2
|
+
title: string;
|
|
3
|
+
amount: string;
|
|
4
|
+
amountInvalid: string;
|
|
5
|
+
reference: string;
|
|
6
|
+
choosePaymentMethod: string;
|
|
7
|
+
chooseDeliveryMethod: string;
|
|
8
|
+
emailAddress: string;
|
|
9
|
+
emailInvalid: string;
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
phoneInvalid: string;
|
|
12
|
+
countryCode: string;
|
|
13
|
+
sendPaymentLink: string;
|
|
14
|
+
paymentLinkSent: string;
|
|
15
|
+
emailSentTo: string;
|
|
16
|
+
smsSentTo: string;
|
|
17
|
+
close: string;
|
|
18
|
+
textMessage: string;
|
|
19
|
+
email: string;
|
|
20
|
+
errorFallback: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const getTranslations: (locale: string) => Translations;
|
package/dist/lib/pay-client.d.ts
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
code: string;
|
|
10
|
-
provider: string;
|
|
11
|
-
description: string;
|
|
12
|
-
logoUrl: string;
|
|
13
|
-
}[]>;
|
|
1
|
+
export interface PaymentMethod {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
code: string;
|
|
5
|
+
provider: string;
|
|
6
|
+
description: string;
|
|
7
|
+
logoUrl: string;
|
|
14
8
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
logoUrl: string;
|
|
25
|
-
}[]>;
|
|
26
|
-
setConfig: (newParams: Partial<PayParams>) => void;
|
|
9
|
+
export interface PayClientInterface {
|
|
10
|
+
getPaymentMethods: () => Promise<PaymentMethod[]>;
|
|
11
|
+
}
|
|
12
|
+
export declare class PayClient implements PayClientInterface {
|
|
13
|
+
private baseUrl;
|
|
14
|
+
private token;
|
|
15
|
+
private locale;
|
|
16
|
+
constructor(baseUrl: string, token: string, locale?: string);
|
|
17
|
+
getPaymentMethods: () => Promise<PaymentMethod[]>;
|
|
27
18
|
}
|
|
28
|
-
export { PayClient };
|
|
29
|
-
export type { PayParams, PayClientInterface };
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
+
import { type PayClientInterface } from "./lib/pay-client";
|
|
3
|
+
import type { Currency } from "./lib/api-client";
|
|
4
|
+
export declare class PaymentWidget extends LitElement {
|
|
5
|
+
protected createRenderRoot(): this;
|
|
6
|
+
token: string;
|
|
7
|
+
currency: Currency;
|
|
8
|
+
defaultAmount: string;
|
|
9
|
+
defaultReference: string;
|
|
10
|
+
readOnlyAmount: boolean;
|
|
11
|
+
customerName: string;
|
|
12
|
+
customerEmail: string;
|
|
13
|
+
customerPhone: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
payClientRef: string;
|
|
16
|
+
get payClient(): PayClientInterface | undefined;
|
|
17
|
+
set payClient(client: PayClientInterface | undefined);
|
|
18
|
+
private _payClient?;
|
|
19
|
+
private _amount;
|
|
20
|
+
private _email;
|
|
21
|
+
private _phone;
|
|
22
|
+
private _paymentReference;
|
|
23
|
+
private _method;
|
|
24
|
+
private _channel;
|
|
25
|
+
private _country;
|
|
26
|
+
private _loading;
|
|
27
|
+
private _success;
|
|
28
|
+
private _paymentMethods;
|
|
29
|
+
private _methodsLoading;
|
|
30
|
+
private _methodsError;
|
|
31
|
+
private _initialized;
|
|
32
|
+
private _t;
|
|
33
|
+
private _apiUrl;
|
|
34
|
+
protected willUpdate(_changedProperties: PropertyValues<this>): void;
|
|
35
|
+
firstUpdated(): void;
|
|
36
|
+
private _getPayClient;
|
|
37
|
+
private _fetchPaymentMethods;
|
|
38
|
+
private _validateAmount;
|
|
39
|
+
private get _isValid();
|
|
40
|
+
private _onAmountInput;
|
|
41
|
+
private _onReferenceInput;
|
|
42
|
+
private _onMethodChange;
|
|
43
|
+
private _onChannelChange;
|
|
44
|
+
private _onEmailInput;
|
|
45
|
+
private _onPhoneInput;
|
|
46
|
+
private _onCountryChange;
|
|
47
|
+
private _onSubmit;
|
|
48
|
+
private _onClose;
|
|
49
|
+
private _renderMethods;
|
|
50
|
+
private _renderChannels;
|
|
51
|
+
private _renderForm;
|
|
52
|
+
private _renderSuccess;
|
|
53
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface HTMLElementTagNameMap {
|
|
57
|
+
"openhive-pay": PaymentWidget;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./register";
|
|
3
|
+
import type { RequestToPay, Currency } from "./lib/api-client";
|
|
4
|
+
import type { PayClientInterface } from "./lib/pay-client";
|
|
5
|
+
export type { RequestToPay, Currency };
|
|
6
|
+
export type { PayClientInterface };
|
|
7
|
+
declare module "react" {
|
|
8
|
+
namespace JSX {
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
"openhive-pay": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
|
|
11
|
+
token?: string;
|
|
12
|
+
currency?: string;
|
|
13
|
+
"default-amount"?: string;
|
|
14
|
+
"default-reference"?: string;
|
|
15
|
+
"read-only-amount"?: string;
|
|
16
|
+
"customer-name"?: string;
|
|
17
|
+
"customer-email"?: string;
|
|
18
|
+
"customer-phone"?: string;
|
|
19
|
+
locale?: string;
|
|
20
|
+
}, HTMLElement>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export interface PaymentProps {
|
|
25
|
+
token?: string;
|
|
26
|
+
currency?: Currency;
|
|
27
|
+
defaultAmount?: string;
|
|
28
|
+
defaultReference?: string;
|
|
29
|
+
readOnlyAmount?: boolean;
|
|
30
|
+
customerName?: string;
|
|
31
|
+
customerEmail?: string;
|
|
32
|
+
customerPhone?: string;
|
|
33
|
+
locale?: string;
|
|
34
|
+
payClient?: PayClientInterface;
|
|
35
|
+
onRequestToPay?: (detail: RequestToPay) => void;
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
className?: string;
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
}
|
|
40
|
+
export declare function Payment({ token, currency, defaultAmount, defaultReference, readOnlyAmount, customerName, customerEmail, customerPhone, locale, payClient, onRequestToPay, onClose, className, style, }: PaymentProps): import("react/jsx-runtime").JSX.Element;
|