@tap-payments/apple-pay-button 0.0.29-test → 0.0.31-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.
Files changed (2) hide show
  1. package/README.md +158 -155
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -25,109 +25,109 @@ yarn add @tap-payments/apple-pay-button
25
25
  ```javascript
26
26
  import React from 'react'
27
27
  import {
28
- ApplePayButton,
29
- ThemeMode,
30
- SupportedNetworks,
31
- Scope,
32
- Environment,
33
- Locale,
34
- ButtonType,
35
- Edges
28
+ ApplePayButton,
29
+ ThemeMode,
30
+ SupportedNetworks,
31
+ Scope,
32
+ Environment,
33
+ Locale,
34
+ ButtonType,
35
+ Edges
36
36
  } from '@tap-payments/apple-pay-button'
37
37
 
38
38
  const App = () => {
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
- )
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
+ )
131
131
  }
132
132
  ```
133
133
 
@@ -141,8 +141,8 @@ const App = () => {
141
141
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
142
142
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
143
143
  <title>apple pay button</title>
144
- <link rel="stylesheet" href="https://tap-sdks.b-cdn.net/apple-pay/build-1.0.29-test/main.css" />
145
- <script src="https://tap-sdks.b-cdn.net/apple-pay/build-1.0.29-test/main.js"></script>
144
+ <link rel="stylesheet" href="https://tap-sdks.b-cdn.net/apple-pay/build-0.0.30-test//main.css" />
145
+ <script src="https://tap-sdks.b-cdn.net/apple-pay/build-0.0.30-test//main.js"></script>
146
146
  </head>
147
147
 
148
148
  <body>
@@ -150,59 +150,62 @@ const App = () => {
150
150
  <script type="text/javascript">
151
151
  const { renderApplePayButton, ButtonStyle, Scope, SupportedNetworks, Locale, ButtonType } = window.TapSDKs
152
152
  renderApplePayButton(
153
- {
154
- publicKey: 'pk_test_7xxxxxxxxx',
155
- environment: Environment.Sandbox,
156
- scope: Scope.TapToken,
157
- merchant: {
158
- domain: 'tp-txxxxxxxx',
159
- id: 'merchant_xxxxxxxxxx'
160
- },
161
- transaction: {
162
- currency: 'SAR',
163
- amount: '3'
164
- },
165
- acceptance: {
166
- supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard]
167
- supportedCards : ["DEBIT","CREDIT"],
168
- supportedCardsWithAuthentications : ["3DS","EMV"]
169
- },
170
-
171
- customer: {
172
- name: [{
173
- locale: 'en'
174
- first: 'test',
175
- last: 'tester',
176
- middle: 'test'
177
- }],
178
- contact: {
179
- email: 'test@gmail.com',
180
- phone:{
153
+ {
154
+ publicKey: 'pk_test_7xxxxxxxxx',
155
+ environment: Environment.Sandbox,
156
+ scope: Scope.TapToken,
157
+ merchant: {
158
+ domain: 'tp-txxxxxxxx',
159
+ id: 'merchant_xxxxxxxxxx'
160
+ },
161
+ transaction: {
162
+ currency: 'SAR',
163
+ amount: '3'
164
+ },
165
+ acceptance: {
166
+ supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard],
167
+ supportedCards: ['DEBIT', 'CREDIT'],
168
+ supportedCardsWithAuthentications: ['3DS', 'EMV']
169
+ },
170
+
171
+ customer: {
172
+ id: 'cus_xxx',
173
+ name: [
174
+ {
175
+ locale: 'en',
176
+ first: 'test',
177
+ last: 'tester',
178
+ middle: 'test'
179
+ }
180
+ ],
181
+ contact: {
182
+ email: 'test@gmail.com',
183
+ phone: {
181
184
  number: '10XXXXXX56',
182
- countryCode: '+20',
183
- }
184
- }
185
- },
186
- interface: {
187
- locale: Locale.EN,
188
- theme: ThemeMode.DARK,
189
- type: ButtonType.BUY,
190
- edges: Edges.CURVED
191
- },
192
- onCancel: async () => {
193
- console.log('onCancel')
194
- },
195
- onError: async (error) => {
196
- console.log('onError', error)
197
- },
198
- onSuccess: async (data) => {
199
- console.log('onSuccess', data)
200
- },
201
- onReady: async () => {
202
- console.log('onReady')
203
- }
204
- },
205
- 'apple-pay-button'
185
+ countryCode: '+20'
186
+ }
187
+ }
188
+ },
189
+ interface: {
190
+ locale: Locale.EN,
191
+ theme: ThemeMode.DARK,
192
+ type: ButtonType.BUY,
193
+ edges: Edges.CURVED
194
+ },
195
+ onCancel: async () => {
196
+ console.log('onCancel')
197
+ },
198
+ onError: async (error) => {
199
+ console.log('onError', error)
200
+ },
201
+ onSuccess: async (data) => {
202
+ console.log('onSuccess', data)
203
+ },
204
+ onReady: async () => {
205
+ console.log('onReady')
206
+ }
207
+ },
208
+ 'apple-pay-button'
206
209
  )
207
210
  </script>
208
211
  </body>
@@ -228,7 +231,7 @@ const App = () => {
228
231
  | interface.locale | `Locale` | `optional` | The locale of the Apple Pay button |
229
232
  | interface.type | `ButtonType` | `optional` | The type of the Apple Pay button |
230
233
  | interface.edges | `ButtonType` | `optional` | The border of the Apple Pay button |
231
- | customer | `object` | `optional` | The Customer details information |
234
+ | customer | `object` | `optional` | The Customer details information |
232
235
  | onCancel | `function` | `optional` | A callback function that will be called when you cancel the process |
233
236
  | onError | `function` | `optional` | A callback function that will be called when you have an error |
234
237
  | onSuccess | `function` | `optional` | A async function that will be called after creating the token successfully |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/apple-pay-button",
3
- "version": "0.0.29-test",
3
+ "version": "0.0.31-test",
4
4
  "description": "Apple Pay Button React Component",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.js",
@@ -20,7 +20,7 @@
20
20
  "copy:files": "copyfiles -u 1 src/**/*.css build/",
21
21
  "tsc:alias": "tsc-alias -p tsconfig.json",
22
22
  "ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
23
- "push": "npm publish --access public"
23
+ "push": "npm publish --access public --tag test"
24
24
  },
25
25
  "keywords": [],
26
26
  "author": {