@tap-payments/apple-pay-button 0.0.15-test → 0.0.17-test
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/build/@types/index.d.ts +1 -0
- package/build/api/app.service.d.ts +1 -1
- package/build/api/app.service.js +2 -2
- package/build/constants/index.d.ts +1 -1
- package/build/constants/index.js +1 -1
- package/build/features/ApplePayButton/ApplePayButton.js +6 -4
- package/build/hooks/useApplePay.d.ts +1 -1
- package/build/hooks/useApplePay.js +2 -2
- package/package.json +1 -1
package/build/@types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import BaseService from './base';
|
|
|
3
3
|
declare class APPService extends BaseService {
|
|
4
4
|
constructor();
|
|
5
5
|
init(publicKey: string, merchantId?: string): Promise<ProfileResponse>;
|
|
6
|
-
appleSession(merchant: MerchantResponse, validationURL: string, merchantRegisteredDomain: string): Promise<any>;
|
|
6
|
+
appleSession(merchant: MerchantResponse, validationURL: string, merchantRegisteredDomain: string, merchantIdentifier: string): Promise<any>;
|
|
7
7
|
tapTokenization(applePaymentData: Record<string, string>, merchant: MerchantResponse): Promise<any>;
|
|
8
8
|
createCharge(publicKey: string, merchant: MerchantResponse, request: ApplePayRequestData, cardToken: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
9
|
}
|
package/build/api/app.service.js
CHANGED
|
@@ -88,7 +88,7 @@ var APPService = (function (_super) {
|
|
|
88
88
|
enumerable: false,
|
|
89
89
|
configurable: true,
|
|
90
90
|
writable: true,
|
|
91
|
-
value: function (merchant, validationURL, merchantRegisteredDomain) {
|
|
91
|
+
value: function (merchant, validationURL, merchantRegisteredDomain, merchantIdentifier) {
|
|
92
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
93
93
|
var body, data;
|
|
94
94
|
return __generator(this, function (_a) {
|
|
@@ -97,7 +97,7 @@ var APPService = (function (_super) {
|
|
|
97
97
|
body = {
|
|
98
98
|
validationUrl: validationURL,
|
|
99
99
|
origin: merchantRegisteredDomain,
|
|
100
|
-
merchantIdentifier:
|
|
100
|
+
merchantIdentifier: merchantIdentifier,
|
|
101
101
|
merchantId: merchant.id,
|
|
102
102
|
merchantName: merchant.name,
|
|
103
103
|
session_token: merchant.session_token
|
package/build/constants/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { useApplePay } from '../../hooks/useApplePay';
|
|
|
17
17
|
import { ButtonStyle, ButtonType, Locale, Scope } from '../../constants';
|
|
18
18
|
import './ApplePayButton.css';
|
|
19
19
|
var ApplePay = React.memo(function (_a) {
|
|
20
|
-
var publicKey = _a.publicKey, merchant = _a.merchant, transaction = _a.transaction, billingContact = _a.billingContact, supportedNetworks = _a.supportedNetworks, onCancel = _a.onCancel, onError = _a.onError, onSuccess = _a.onSuccess, onClick = _a.onClick, metaData = _a.metaData, _b = _a.scope, scope = _b === void 0 ? Scope.TapToken : _b, _c = _a.buttonStyle, buttonStyle = _c === void 0 ? ButtonStyle.WhiteOutline : _c, _d = _a.type, type = _d === void 0 ? ButtonType.PLAIN : _d, _e = _a.locale, locale = _e === void 0 ? Locale.EN : _e, debug = _a.debug;
|
|
20
|
+
var publicKey = _a.publicKey, merchant = _a.merchant, transaction = _a.transaction, billingContact = _a.billingContact, supportedNetworks = _a.supportedNetworks, onCancel = _a.onCancel, onError = _a.onError, onSuccess = _a.onSuccess, onClick = _a.onClick, metaData = _a.metaData, _b = _a.scope, scope = _b === void 0 ? Scope.TapToken : _b, _c = _a.buttonStyle, buttonStyle = _c === void 0 ? ButtonStyle.WhiteOutline : _c, _d = _a.type, type = _d === void 0 ? ButtonType.PLAIN : _d, _e = _a.locale, locale = _e === void 0 ? Locale.EN : _e, debug = _a.debug, merchantIdentifier = _a.merchantIdentifier;
|
|
21
21
|
var _f = useApplePay({
|
|
22
22
|
publicKey: publicKey,
|
|
23
23
|
merchant: merchant,
|
|
@@ -29,7 +29,8 @@ var ApplePay = React.memo(function (_a) {
|
|
|
29
29
|
onCancel: onCancel,
|
|
30
30
|
scope: scope,
|
|
31
31
|
metaData: metaData,
|
|
32
|
-
debug: debug
|
|
32
|
+
debug: debug,
|
|
33
|
+
merchantIdentifier: merchantIdentifier
|
|
33
34
|
}), loading = _f.loading, onApplePayButtonClicked = _f.onApplePayButtonClicked, disabled = _f.disabled;
|
|
34
35
|
React.useEffect(function () {
|
|
35
36
|
if (debug) {
|
|
@@ -48,8 +49,9 @@ var ApplePay = React.memo(function (_a) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
}, []);
|
|
51
|
-
return (_jsx("button", { className:
|
|
52
|
-
'-apple-pay-button-type': type
|
|
52
|
+
return (_jsx("button", { className: 'button-applepay-tap', style: {
|
|
53
|
+
'-apple-pay-button-type': type,
|
|
54
|
+
'-apple-pay-button-style': buttonStyle
|
|
53
55
|
}, onClick: function () {
|
|
54
56
|
onApplePayButtonClicked();
|
|
55
57
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
@@ -5,5 +5,5 @@ interface UseApplePayReturnProps {
|
|
|
5
5
|
onApplePayButtonClicked: () => Promise<void>;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const useApplePay: ({ publicKey, merchant, transaction, billingContact, onCancel, onError, onSuccess, scope, supportedNetworks, metaData, debug }: UseApplePayProps) => UseApplePayReturnProps;
|
|
8
|
+
export declare const useApplePay: ({ publicKey, merchant, transaction, billingContact, onCancel, onError, onSuccess, scope, supportedNetworks, metaData, debug, merchantIdentifier }: UseApplePayProps) => UseApplePayReturnProps;
|
|
9
9
|
export {};
|
|
@@ -50,7 +50,7 @@ import appService from '../api/app.service';
|
|
|
50
50
|
import { ApplePayVersion } from '../constants';
|
|
51
51
|
import { getApplePayPaymentMethod, getApplePayRequest, validateCurrency, validateSupportedNetworks } from '../utils/config';
|
|
52
52
|
export var useApplePay = function (_a) {
|
|
53
|
-
var publicKey = _a.publicKey, merchant = _a.merchant, transaction = _a.transaction, billingContact = _a.billingContact, onCancel = _a.onCancel, onError = _a.onError, onSuccess = _a.onSuccess, scope = _a.scope, supportedNetworks = _a.supportedNetworks, metaData = _a.metaData, debug = _a.debug;
|
|
53
|
+
var publicKey = _a.publicKey, merchant = _a.merchant, transaction = _a.transaction, billingContact = _a.billingContact, onCancel = _a.onCancel, onError = _a.onError, onSuccess = _a.onSuccess, scope = _a.scope, supportedNetworks = _a.supportedNetworks, metaData = _a.metaData, debug = _a.debug, merchantIdentifier = _a.merchantIdentifier;
|
|
54
54
|
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
55
55
|
var _c = useState(null), profileData = _c[0], setProfile = _c[1];
|
|
56
56
|
var _d = useState(false), disabled = _d[0], setDisabled = _d[1];
|
|
@@ -124,7 +124,7 @@ export var useApplePay = function (_a) {
|
|
|
124
124
|
if (debug) {
|
|
125
125
|
console.info("creating merchant session for merchantData: ".concat(JSON.stringify(profileData.merchant), " and validationURL: ").concat(event.validationURL, " and merchant.domain: ").concat(merchant.domain));
|
|
126
126
|
}
|
|
127
|
-
return [4, appService.appleSession(profileData.merchant, event.validationURL, merchant.domain)];
|
|
127
|
+
return [4, appService.appleSession(profileData.merchant, event.validationURL, merchant.domain, merchantIdentifier)];
|
|
128
128
|
case 2:
|
|
129
129
|
merchantSession = (_a.sent()).body;
|
|
130
130
|
if (debug)
|