@tap-payments/apple-pay-button 1.0.4 → 1.0.5-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/README.md CHANGED
@@ -24,72 +24,110 @@ yarn add @tap-payments/apple-pay-button
24
24
 
25
25
  ```javascript
26
26
  import React from 'react'
27
- import { ApplePayButton, ButtonStyle, SupportedNetworks, Scope } from '@tap-payments/apple-pay-button'
27
+ import {
28
+ ApplePayButton,
29
+ ThemeMode,
30
+ SupportedNetworks,
31
+ Scope,
32
+ Environment,
33
+ Locale,
34
+ ButtonType,
35
+ Edges
36
+ } from '@tap-payments/apple-pay-button'
28
37
 
29
38
  const App = () => {
30
- return (
31
- <ApplePayButton
32
- // required (The public Key provided by Tap)
33
- publicKey={'pk_test_xxxxxxxxxxxxxxxzh'}
34
- // required
35
- merchant={{
36
- // required (The merchant domain name)
37
- domain: 'example.com',
38
- // optional (The merchant identifier provided by Tap)
39
- id: '1xxxxx8'
40
- }}
41
- // required
42
- transaction={{
43
- // required (The amount to be charged)
44
- amount: '12',
45
- // required (The currency of the amount)
46
- currency: 'KWD'
47
- }}
48
- // optional (The scope of the SDK and it can be one of these scopes:
49
- // [TapToken,AppleToken], by default it is TapToken)
50
- scope={Scope.TapToken}
51
- // optional (The supported networks for the Apple Pay button and it
52
- // can be one of these networks: [Mada,Visa,MasterCard], by default
53
- // we bring all the supported networks from tap merchant configuration)
54
- supportedNetworks={[SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard]}
55
- // optional (The style of the Apple Pay button and it can be one of
56
- // these styles: [White,WhiteOutline,Black], by default it is WhiteOutline)
57
- buttonStyle={ButtonStyle.WhiteOutline}
58
- // optional (The billing contact information)
59
- billingContact={{
60
- // required
61
- email: {
62
- // required
63
- address: 'test@gmail.com'
64
- },
65
- // required
66
- name: {
67
- // required
68
- first: 'test',
69
- // required
70
- last: 'tester',
71
- // optional
72
- middle: 'test'
73
- },
74
- // required
75
- phone: {
76
- number: '10XXXXXX56',
77
- code: '+20'
78
- }
79
- }}
80
- // optional (A callback function that will be called when you cancel
81
- // the payment process)
82
- onCancel={() => console.log('cancelled')}
83
- // optional (A callback function that will be called when you have an error)
84
- onError={(err) => console.error(err)}
85
- // optional (A async function that will be called after creating the token
86
- // successfully)
87
- onSuccess={async (token) => {
88
- // do your stuff here...
89
- console.log(token)
90
- }}
91
- />
92
- )
39
+ return (
40
+ <ApplePayButton
41
+ // The public Key provided by Tap
42
+ publicKey={'pk_test_xxxxxxxxxxxxxxxzh'}
43
+ //The environment of the SDK and it can be one of these environments
44
+ environment={Environment.Development}
45
+ //to enable the debug mode
46
+ debug
47
+ merchant={{
48
+ // The merchant domain name
49
+ domain: 'example.com',
50
+ // The merchant identifier provided by Tap
51
+ id: '1xxxxx8'
52
+ }}
53
+ transaction={{
54
+ // The amount to be charged
55
+ amount: '12',
56
+ // The currency of the amount
57
+ currency: 'KWD'
58
+ }}
59
+ // The scope of the SDK and it can be one of these scopes:
60
+ // [TapToken,AppleToken], by default it is TapToken)
61
+ scope={Scope.TapToken}
62
+ acceptance={{
63
+ // The supported networks for the Apple Pay button and it
64
+ // can be one of these networks: [Mada,Visa,MasterCard], by default
65
+ // we bring all the supported networks from tap merchant configuration
66
+ supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard]
67
+ supportedCards : ["DEBIT","CREDIT"],
68
+ supportedCardsWithAuthentications : ["3DS","EMV"]
69
+ }}
70
+ // The billing contact information
71
+ customer={{
72
+ id: 'cus_xxx',
73
+ name: [
74
+ {
75
+ //"en or ar",
76
+ lang: Locale.EN,
77
+ // "First name of the customer.",
78
+ first: 'test',
79
+ //"Last name of the customer.",
80
+ last: 'tester',
81
+ // "Middle name of the customer.",
82
+ middle: 'test'
83
+ }
84
+ ],
85
+ // Defines the contact details for the customer & to be used in creating the billing contact info in Apple pay request
86
+ contact: {
87
+ //"The customer's email",
88
+ email: 'test@gmail.com',
89
+ //"The customer's phone number"
90
+ phone: {
91
+ //"The customer's country code",
92
+ countryCode: '+20',
93
+ //"The customer's phone number
94
+ number: '10XXXXXX56'
95
+ }
96
+ }
97
+ }}
98
+ //for styling button
99
+ interface={{
100
+ //The locale of the Apple Pay button and it can be one of these locales:[EN,AR]
101
+ locale: Locale.EN,
102
+ // The theme of the Apple Pay button and it can be one of
103
+ // these values : [light,Dark], by default it is detected from user device
104
+ theme: ThemeMode.DARK,
105
+ // The type of the Apple Pay
106
+ type: ButtonType.BUY,
107
+ // The border of the Apple Pay button and it can be one of these values:[curved,straight]
108
+ edges: Edges.CURVED
109
+ }}
110
+ // optional (A callback function that will be called when you cancel
111
+ // the payment process)
112
+ onCancel={() => console.log('cancelled')}
113
+ // optional (A callback function that will be called when you have an error)
114
+ onError={(err) => console.error(err)}
115
+ // optional (A async function that will be called after creating the token
116
+ // successfully)
117
+ onSuccess={async (token) => {
118
+ // do your stuff here...
119
+ console.log(token)
120
+ }}
121
+ // optional (A callback function that will be called when you button is clickable)
122
+ onReady={() => {
123
+ console.log('Ready')
124
+ }}
125
+ // optional (A callback function that will be called when the button clicked)
126
+ onClick={() => {
127
+ console.log('Clicked')
128
+ }}
129
+ />
130
+ )
93
131
  }
94
132
  ```
95
133
 
@@ -103,70 +141,69 @@ const App = () => {
103
141
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
104
142
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
105
143
  <title>apple pay button</title>
106
- <link rel="stylesheet" href="https://apple-pay-button.b-cdn.net/build-0.0.8-test/main.css" />
107
- <script src="https://apple-pay-button.b-cdn.net/build-0.0.8-test/main.js"></script>
144
+ <link rel="stylesheet" href="https://tap-sdks.b-cdn.net/apple-pay/build-1.0.19/main.css" />
145
+ <script src="https://tap-sdks.b-cdn.net/apple-pay/build-1.0.19/main.js"></script>
108
146
  </head>
147
+
109
148
  <body>
110
149
  <div id="apple-pay-button"></div>
111
150
  <script type="text/javascript">
112
- const { renderApplePayButton, ButtonStyle, Scope, SupportedNetworks } = window.TapSDKs
113
- renderApplePayButton(
151
+ const { render, ThemeMode, SupportedNetworks, Scope, Environment, Locale, ButtonType, Edges } =
152
+ window.TapApplepaySDK
153
+ render(
114
154
  {
115
- // required
116
- publicKey: 'pk_test_xxxxxxxxxxxxxxxzh',
117
- // required
155
+ publicKey: 'pk_test_7xxxxxxxxx',
156
+ environment: Environment.Development,
157
+ scope: Scope.TapToken,
118
158
  merchant: {
119
- // required
120
- domain: 'example.com'
121
- // optional
122
- // id: '123...'
159
+ domain: window.location.hostname,
160
+ id: 'merchant_xxxxxxxxxx'
123
161
  },
124
- // required
125
162
  transaction: {
126
- // required
127
- currency: 'USD',
128
- // required
129
- amount: '100'
163
+ currency: 'SAR',
164
+ amount: '3'
130
165
  },
131
- // optional
132
- scope: Scope.TapToken,
133
- // optional
134
- buttonStyle: ButtonStyle.WhiteOutline,
135
- // optional
136
- supportedNetworks: [SupportedNetworks.Visa, SupportedNetworks.MasterCard],
137
- // optional (The billing contact information)
138
- billingContact: {
139
- // required
140
- email: {
141
- // required
142
- address: 'test@gmail.com'
143
- },
144
- // required
145
- name: {
146
- // required
147
- first: 'test',
148
- // required
149
- last: 'tester',
150
- // optional
151
- middle: 'test'
152
- },
153
- // required
154
- phone: {
155
- number: '10XXXXXX56',
156
- code: '+20'
166
+ acceptance: {
167
+ supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard],
168
+ supportedCards: ['DEBIT', 'CREDIT'],
169
+ supportedCardsWithAuthentications: ['3DS', 'EMV']
170
+ },
171
+
172
+ customer: {
173
+ id: 'cus_xxx',
174
+ name: [
175
+ {
176
+ locale: 'en',
177
+ first: 'test',
178
+ last: 'tester',
179
+ middle: 'test'
180
+ }
181
+ ],
182
+ contact: {
183
+ email: 'test@gmail.com',
184
+ phone: {
185
+ number: '10XXXXXX56',
186
+ countryCode: '+20'
187
+ }
157
188
  }
158
189
  },
159
- // optional
160
- onCancel: () => {
190
+ interface: {
191
+ locale: Locale.EN,
192
+ theme: ThemeMode.DARK,
193
+ type: ButtonType.BUY,
194
+ edges: Edges.CURVED
195
+ },
196
+ onCancel: async () => {
161
197
  console.log('onCancel')
162
198
  },
163
- // optional
164
- onError: (error) => {
199
+ onError: async (error) => {
165
200
  console.log('onError', error)
166
201
  },
167
- // optional
168
202
  onSuccess: async (data) => {
169
203
  console.log('onSuccess', data)
204
+ },
205
+ onReady: async () => {
206
+ console.log('onReady')
170
207
  }
171
208
  },
172
209
  'apple-pay-button'
@@ -178,17 +215,26 @@ const App = () => {
178
215
 
179
216
  ## Configurations
180
217
 
181
- | Name | Type | R/O | Description |
182
- | -------------------- | --------------------- | ---------- | -------------------------------------------------------------------------- |
183
- | publicKey | `string` | `required` | The public Key provided by Tap |
184
- | merchant.id | `string` | `optional` | The merchant identifier provided by Tap |
185
- | merchant.domain | `string` | `required` | The merchant domain name |
186
- | transaction.amount | `string` | `required` | The amount to be charged |
187
- | transaction.currency | `string` | `required` | The currency of the amount |
188
- | scope | `Scope` | `optional` | The scope of the SDK |
189
- | supportedNetworks | `SupportedNetworks[]` | `optional` | The supported networks for the Apple Pay button |
190
- | buttonStyle | `ButtonStyle` | `optional` | The style of the Apple Pay button |
191
- | billingContact | `BillingContact` | `optional` | The billing contact information |
192
- | onCancel | `function` | `optional` | A callback function that will be called when you cancel the process |
193
- | onError | `function` | `optional` | A callback function that will be called when you have an error |
194
- | onSuccess | `function` | `optional` | A async function that will be called after creating the token successfully |
218
+ | Name | Type | R/O | Description |
219
+ | -------------------------------------------- | ------------ | ---------- | ---------------------------------------------------------------------------------------------------------- |
220
+ | publicKey | `string` | `required` | The public Key provided by Tap |
221
+ | environment | `enum` | `optional` | The environment of the SDK and it can be one of these environments `Environment`: [Development,Production] |
222
+ | debug | `boolean` | `optional` | To enable the debug mode |
223
+ | merchant.id | `string` | `required` | The merchant identifier provided by Tap |
224
+ | merchant.domain | `string` | `required` | The merchant domain name |
225
+ | transaction.amount | `string` | `required` | The amount to be charged |
226
+ | transaction.currency | `string` | `required` | The currency of the amount |
227
+ | scope | `enum` | `optional` | The scope of the SDK |
228
+ | acceptance.supportedBrands | `array` | `optional` | The supported networks for the Apple Pay button |
229
+ | acceptance.supportedCards | `array` | `optional` | The supported cards for the Apple Pay button |
230
+ | acceptance.supportedCardsWithAuthentications | `array` | `optional` | The supported cards with authentications for the Apple Pay button |
231
+ | interface.theme | `enum` | `optional` | The theme of the Apple Pay button |
232
+ | interface.locale | `Locale` | `optional` | The locale of the Apple Pay button |
233
+ | interface.type | `ButtonType` | `optional` | The type of the Apple Pay button |
234
+ | interface.edges | `ButtonType` | `optional` | The border of the Apple Pay button |
235
+ | customer | `object` | `optional` | The Customer details information |
236
+ | onCancel | `function` | `optional` | A callback function that will be called when you cancel the process |
237
+ | onError | `function` | `optional` | A callback function that will be called when you have an error |
238
+ | onSuccess | `function` | `optional` | A async function that will be called after creating the token successfully |
239
+ | onClick | `function` | `optional` | A callback function that will be called when the button clicked |
240
+ | onReady | `function` | `optional` | A callback function that will be called when you button is clickable |
@@ -0,0 +1,68 @@
1
+ import { MerchantCapabilities, SupportedNetworks } from '../constants';
2
+ export declare type RequiredShippingContactField = 'postalAddress' | 'name' | 'phoneticName' | 'phone' | 'email';
3
+ export declare type ApplePayPaymentMethodType = 'debit' | 'credit' | 'prepaid' | 'store';
4
+ export interface ApplePayShippingMethod {
5
+ label: string;
6
+ detail: string;
7
+ amount: string;
8
+ identifier: string;
9
+ }
10
+ export interface ApplePayPaymentContact {
11
+ phoneNumber?: string;
12
+ emailAddress?: string;
13
+ givenName?: string;
14
+ familyName?: string;
15
+ phoneticGivenName?: string;
16
+ phoneticFamilyName?: string;
17
+ addressLines?: string[];
18
+ subLocality?: string;
19
+ locality?: string;
20
+ postalCode?: string;
21
+ subAdministrativeArea?: string;
22
+ administrativeArea?: string;
23
+ country?: string;
24
+ countryCode?: string;
25
+ }
26
+ export interface ApplePayPaymentMethod {
27
+ displayName?: string;
28
+ network?: string;
29
+ type?: ApplePayPaymentMethodType;
30
+ billingContact?: ApplePayPaymentContact;
31
+ }
32
+ export interface ApplePayLineItem {
33
+ type?: 'final' | 'pending';
34
+ label?: string;
35
+ amount?: string;
36
+ paymentTiming?: 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
37
+ recurringPaymentStartDate?: Date;
38
+ recurringPaymentIntervalUnit?: 'year' | 'month' | 'day' | 'hour' | 'minute';
39
+ recurringPaymentIntervalCount?: number;
40
+ recurringPaymentEndDate?: Date;
41
+ deferredPaymentDate?: Date;
42
+ automaticReloadPaymentThresholdAmount?: string;
43
+ }
44
+ export interface ApplePayUpdateData {
45
+ newTotal: ApplePayLineItem;
46
+ newLineItems?: ApplePayLineItem[];
47
+ }
48
+ export interface ApplePayRequestData {
49
+ countryCode: string;
50
+ currencyCode: string;
51
+ merchantCapabilities: Array<typeof MerchantCapabilities[keyof typeof MerchantCapabilities]>;
52
+ supportedNetworks: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
53
+ billingContact?: {
54
+ phoneNumber?: string;
55
+ emailAddress?: string;
56
+ givenName: string;
57
+ familyName: string;
58
+ };
59
+ total: {
60
+ label: string;
61
+ amount: number;
62
+ };
63
+ requiredShippingContactFields?: Array<RequiredShippingContactField>;
64
+ supportsCouponCode?: boolean;
65
+ couponCode?: string;
66
+ shippingMethods?: ApplePayShippingMethod[];
67
+ lineItems?: ApplePayLineItem[];
68
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,57 +1,66 @@
1
- import { Scope, ButtonStyle, MerchantCapabilities, SupportedNetworks, ButtonType, Locale, Environment } from '../constants';
2
- export interface ApplePayRequestData {
3
- countryCode: string;
4
- currencyCode: string;
5
- merchantCapabilities: Array<typeof MerchantCapabilities[keyof typeof MerchantCapabilities]>;
6
- supportedNetworks: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
7
- billingContact?: {
8
- phoneNumber: string;
9
- emailAddress: string;
10
- givenName: string;
11
- familyName: string;
12
- };
13
- total: {
14
- label: string;
15
- amount: number;
1
+ import { Scope, SupportedNetworks, ButtonType, Locale, Environment, ThemeMode, Edges } from '../constants';
2
+ import { ApplePayLineItem, ApplePayPaymentContact, ApplePayPaymentMethod, ApplePayShippingMethod, ApplePayUpdateData, RequiredShippingContactField } from './ApplePaySession';
3
+ export * from './ApplePaySession';
4
+ export interface Interface {
5
+ locale?: typeof Locale[keyof typeof Locale];
6
+ theme?: typeof ThemeMode[keyof typeof ThemeMode];
7
+ edges?: typeof Edges[keyof typeof Edges];
8
+ type?: typeof ButtonType[keyof typeof ButtonType];
9
+ }
10
+ export interface Customer {
11
+ id?: string;
12
+ name?: {
13
+ lang: typeof Locale[keyof typeof Locale];
14
+ first: string;
15
+ last: string;
16
+ middle?: string;
17
+ }[];
18
+ contact?: {
19
+ email?: string;
20
+ phone?: {
21
+ countryCode: string;
22
+ number: string;
23
+ };
16
24
  };
25
+ shippingContactFields?: Array<RequiredShippingContactField>;
26
+ }
27
+ export interface Acceptance {
28
+ supportedBrands?: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
29
+ supportedCards?: Array<string>;
30
+ supportedCardsWithAuthentications?: Array<string>;
31
+ supportsCouponCode?: boolean;
32
+ }
33
+ export interface Transaction {
34
+ amount: string;
35
+ currency: string;
36
+ couponCode?: string;
37
+ shipping?: ApplePayShippingMethod[];
38
+ lineItems?: ApplePayLineItem[];
17
39
  }
18
40
  export interface ApplePayButtonProps {
41
+ scope?: typeof Scope[keyof typeof Scope];
19
42
  publicKey: string;
20
43
  environment: typeof Environment[keyof typeof Environment];
21
- merchantIdentifier: string;
22
44
  merchant: {
23
- id?: string;
45
+ id: string;
24
46
  domain: string;
47
+ identifier?: string;
25
48
  };
26
- scope?: typeof Scope[keyof typeof Scope];
27
- supportedNetworks?: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
28
- buttonStyle?: typeof ButtonStyle[keyof typeof ButtonStyle];
29
- billingContact?: {
30
- name: {
31
- first: string;
32
- middle?: string;
33
- last: string;
34
- };
35
- email: {
36
- address: string;
37
- };
38
- phone: {
39
- code: string;
40
- number: string;
41
- };
42
- };
43
- transaction: {
44
- amount: string;
45
- currency: string;
46
- };
49
+ interface?: Interface;
50
+ customer?: Customer;
51
+ acceptance: Acceptance;
52
+ transaction: Transaction;
47
53
  onCancel?: () => void;
48
54
  onError?: (error: any) => void;
49
55
  onSuccess?: (data: Record<string, any>) => Promise<void>;
50
56
  onClick?: () => void;
51
57
  onReady?: () => void;
58
+ onMerchantValidation?: (status: 'initiated' | 'completed' | 'error') => void;
59
+ onShippingMethodSelected?: (shippingMethod: ApplePayShippingMethod) => Promise<ApplePayUpdateData>;
60
+ onShippingContactSelected?: (shippingContact: ApplePayPaymentContact) => Promise<ApplePayUpdateData>;
61
+ onPaymentMethodSelected?: (paymentMethod: ApplePayPaymentMethod) => Promise<ApplePayUpdateData>;
62
+ onCouponChanged?: (couponCode: string) => Promise<ApplePayUpdateData>;
52
63
  metaData?: MetaData;
53
- type?: typeof ButtonType[keyof typeof ButtonType];
54
- locale?: typeof Locale[keyof typeof Locale];
55
64
  debug?: boolean;
56
65
  }
57
66
  export interface MerchantResponse {
@@ -80,3 +89,32 @@ export interface MetaData {
80
89
  payment_options: PaymentOptionsResponse;
81
90
  headers: Record<string, string>;
82
91
  }
92
+ export interface CheckoutProfileRequest {
93
+ currency: string;
94
+ merchant_id: string;
95
+ total_amount: number;
96
+ order: {
97
+ amount: number;
98
+ currency: string;
99
+ customer?: {
100
+ id?: string;
101
+ email?: string;
102
+ first_name?: string;
103
+ last_name?: string;
104
+ phone?: {
105
+ country_code: string;
106
+ number: string;
107
+ };
108
+ };
109
+ items: {
110
+ quantity: number;
111
+ amount: number;
112
+ currency: string;
113
+ name: string;
114
+ requiresShipping: string;
115
+ }[];
116
+ merchant: {
117
+ id: string;
118
+ };
119
+ };
120
+ }
@@ -1 +1 @@
1
- export {};
1
+ export * from './ApplePaySession';
@@ -1,4 +1,4 @@
1
- import { MerchantResponse, ApplePayButtonProps } from '../@types';
1
+ import { MerchantResponse, ApplePayButtonProps, CheckoutProfileRequest } from '../@types';
2
2
  import BaseService from './base';
3
3
  declare class APPService extends BaseService {
4
4
  private baseUrl;
@@ -6,13 +6,13 @@ declare class APPService extends BaseService {
6
6
  constructor();
7
7
  setEnv(env: ApplePayButtonProps['environment']): void;
8
8
  setBaseUrl(): void;
9
- getHeaderPublicKey(): "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8AX++RtxPZFtns4XzXFlDIxPBh0umN4qRXZaKDIlb6a3MknaB7psJWmf2l+e4Cfh9b5tey/+rZqpQ065eXTZfGCAuBLt+fYLQBhLfjRpk8S6hlIzc1Kdjg65uqzMwcTd0p7I4KLwHk1I0oXzuEu53fU1LSZhWp4Mnd6wjVgXAsQIDAQAB\n-----END PUBLIC KEY-----" | "" | "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9hSRms7Ir1HmzdZxGXFYgmpi3\nez7VBFje0f8wwrxYS9oVoBtN4iAt0DOs3DbeuqtueI31wtpFVUMGg8W7R0SbtkZd\nGzszQNqt/wyqxpDC9q+97XdXwkWQFA72s76ud7eMXQlsWKsvgwhY+Ywzt0KlpNC3\nHj+N6UWFOYK98Xi+sQIDAQAB\n-----END PUBLIC KEY-----" | "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCi9W5jyTvA4Iwv3V5sfNQ7VdSz\n7WqwBbnWFbIUL/GjaaE93mvDv4zbgRSznHaHQPH6pxrMhMh0tV58njkvjHvQ/tvg\npwM8SemNPKEEAPl69tnMvCrJRPh2dWL3OHY8yCW4c38Hyx4fy56Zd5cdoVWfCReu\njCsvASLGz+cfRrj2swIDAQAB\n-----END PUBLIC KEY-----";
9
+ getHeaderPublicKey(): "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8AX++RtxPZFtns4XzXFlDIxPBh0umN4qRXZaKDIlb6a3MknaB7psJWmf2l+e4Cfh9b5tey/+rZqpQ065eXTZfGCAuBLt+fYLQBhLfjRpk8S6hlIzc1Kdjg65uqzMwcTd0p7I4KLwHk1I0oXzuEu53fU1LSZhWp4Mnd6wjVgXAsQIDAQAB\n-----END PUBLIC KEY-----" | "" | "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCi9W5jyTvA4Iwv3V5sfNQ7VdSz\n7WqwBbnWFbIUL/GjaaE93mvDv4zbgRSznHaHQPH6pxrMhMh0tV58njkvjHvQ/tvg\npwM8SemNPKEEAPl69tnMvCrJRPh2dWL3OHY8yCW4c38Hyx4fy56Zd5cdoVWfCReu\njCsvASLGz+cfRrj2swIDAQAB\n-----END PUBLIC KEY-----" | "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9hSRms7Ir1HmzdZxGXFYgmpi3\nez7VBFje0f8wwrxYS9oVoBtN4iAt0DOs3DbeuqtueI31wtpFVUMGg8W7R0SbtkZd\nGzszQNqt/wyqxpDC9q+97XdXwkWQFA72s76ud7eMXQlsWKsvgwhY+Ywzt0KlpNC3\nHj+N6UWFOYK98Xi+sQIDAQAB\n-----END PUBLIC KEY-----";
10
10
  setBrowserHeaders({ locale, pk, domain }: {
11
11
  locale: string;
12
12
  pk: string;
13
13
  domain: string;
14
14
  }): Promise<void>;
15
- checkoutProfile(merchantId?: string): Promise<{
15
+ checkoutProfile(request: CheckoutProfileRequest): Promise<{
16
16
  merchant: any;
17
17
  payment_options: any;
18
18
  }>;
@@ -155,7 +155,7 @@ var APPService = (function (_super) {
155
155
  return [4, new BrowserInfo.BrowserInfo({
156
156
  app: { name: '@tap-payments/apple-pay-button', language: locale },
157
157
  credentials: { mdn: domain, pk: pk },
158
- encrypt: function (_key, value) { return encryptString(value); }
158
+ encrypt: function (_key, value) { return encryptString(value.substring(0, 115)); }
159
159
  }).get()];
160
160
  case 1:
161
161
  encryptedHeaders = _b.sent();
@@ -176,12 +176,12 @@ var APPService = (function (_super) {
176
176
  enumerable: false,
177
177
  configurable: true,
178
178
  writable: true,
179
- value: function (merchantId) {
179
+ value: function (request) {
180
180
  return __awaiter(this, void 0, void 0, function () {
181
181
  var data, merchant, payment_options, session;
182
182
  return __generator(this, function (_a) {
183
183
  switch (_a.label) {
184
- case 0: return [4, this.post(this.baseUrl + '/checkoutprofile', { merchant_id: merchantId !== null && merchantId !== void 0 ? merchantId : '' })];
184
+ case 0: return [4, this.post(this.baseUrl + '/checkoutprofile', request)];
185
185
  case 1:
186
186
  data = (_a.sent()).data;
187
187
  if (data.errors)
@@ -1,5 +1,5 @@
1
1
  export declare const MW_BASE_LIVE_URL = "https://mw-sdk.tap.company/v2/checkout";
2
- export declare const MW_BASE_STAGING_URL = "https://mw-sdk.staing.tap.company/v2/checkout";
2
+ export declare const MW_BASE_STAGING_URL = "https://mw-sdk.staging.tap.company/v2/checkout";
3
3
  export declare const MW_BASE_DEV_URL = "https://mw-sdk.dev.tap.company/v2/checkout";
4
4
  export declare const MW_BASE_BETA_URL = "https://mw-sdk.beta.tap.company/v2/checkout";
5
5
  export declare const MW_BASE_SANDBOX_URL = "https://mw-sdk.sandbox.tap.company/v2/checkout";
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import axios from 'axios';
13
13
  export var MW_BASE_LIVE_URL = 'https://mw-sdk.tap.company/v2/checkout';
14
- export var MW_BASE_STAGING_URL = 'https://mw-sdk.staing.tap.company/v2/checkout';
14
+ export var MW_BASE_STAGING_URL = 'https://mw-sdk.staging.tap.company/v2/checkout';
15
15
  export var MW_BASE_DEV_URL = 'https://mw-sdk.dev.tap.company/v2/checkout';
16
16
  export var MW_BASE_BETA_URL = 'https://mw-sdk.beta.tap.company/v2/checkout';
17
17
  export var MW_BASE_SANDBOX_URL = 'https://mw-sdk.sandbox.tap.company/v2/checkout';
@@ -20,6 +20,14 @@ export declare const ButtonType: {
20
20
  readonly PLAIN: "plain";
21
21
  readonly SUBSCRIBE: "subscribe";
22
22
  };
23
+ export declare const ThemeMode: {
24
+ readonly DARK: "dark";
25
+ readonly LIGHT: "light";
26
+ };
27
+ export declare const Edges: {
28
+ readonly STRAIGHT: "straight";
29
+ readonly CURVED: "curved";
30
+ };
23
31
  export declare const MerchantCapabilities: {
24
32
  readonly Supports3DS: "supports3DS";
25
33
  readonly SupportsCredit: "supportsCredit";
@@ -46,6 +54,6 @@ export declare const Environment: {
46
54
  };
47
55
  export declare const RSA_DEV_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8AX++RtxPZFtns4XzXFlDIxPBh0umN4qRXZaKDIlb6a3MknaB7psJWmf2l+e4Cfh9b5tey/+rZqpQ065eXTZfGCAuBLt+fYLQBhLfjRpk8S6hlIzc1Kdjg65uqzMwcTd0p7I4KLwHk1I0oXzuEu53fU1LSZhWp4Mnd6wjVgXAsQIDAQAB\n-----END PUBLIC KEY-----";
48
56
  export declare const RSA_SANDBOX_MW_PUBLIC_KEY = "";
49
- export declare const RSA_PRODUCTION_MW_PUBLIC_KEY = "";
50
- export declare const RSA_BETA_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9hSRms7Ir1HmzdZxGXFYgmpi3\nez7VBFje0f8wwrxYS9oVoBtN4iAt0DOs3DbeuqtueI31wtpFVUMGg8W7R0SbtkZd\nGzszQNqt/wyqxpDC9q+97XdXwkWQFA72s76ud7eMXQlsWKsvgwhY+Ywzt0KlpNC3\nHj+N6UWFOYK98Xi+sQIDAQAB\n-----END PUBLIC KEY-----";
51
57
  export declare const RSA_STAGING_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCi9W5jyTvA4Iwv3V5sfNQ7VdSz\n7WqwBbnWFbIUL/GjaaE93mvDv4zbgRSznHaHQPH6pxrMhMh0tV58njkvjHvQ/tvg\npwM8SemNPKEEAPl69tnMvCrJRPh2dWL3OHY8yCW4c38Hyx4fy56Zd5cdoVWfCReu\njCsvASLGz+cfRrj2swIDAQAB\n-----END PUBLIC KEY-----";
58
+ export declare const RSA_BETA_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9hSRms7Ir1HmzdZxGXFYgmpi3\nez7VBFje0f8wwrxYS9oVoBtN4iAt0DOs3DbeuqtueI31wtpFVUMGg8W7R0SbtkZd\nGzszQNqt/wyqxpDC9q+97XdXwkWQFA72s76ud7eMXQlsWKsvgwhY+Ywzt0KlpNC3\nHj+N6UWFOYK98Xi+sQIDAQAB\n-----END PUBLIC KEY-----";
59
+ export declare const RSA_PRODUCTION_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9hSRms7Ir1HmzdZxGXFYgmpi3\nez7VBFje0f8wwrxYS9oVoBtN4iAt0DOs3DbeuqtueI31wtpFVUMGg8W7R0SbtkZd\nGzszQNqt/wyqxpDC9q+97XdXwkWQFA72s76ud7eMXQlsWKsvgwhY+Ywzt0KlpNC3\nHj+N6UWFOYK98Xi+sQIDAQAB\n-----END PUBLIC KEY-----";