tonder-web-sdk 1.16.3 → 1.16.6-beta.DEV-1433.1
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 +22 -25
- package/package.json +10 -3
- package/types/common.d.ts +4 -0
- package/v1/bundle.min.js +1 -18
- package/.env-example +0 -1
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -8
- package/.prettierrc +0 -10
- package/cypress/e2e/1-getting-started/todo.cy.js +0 -143
- package/cypress/e2e/2-advanced-examples/actions.cy.js +0 -299
- package/cypress/e2e/2-advanced-examples/aliasing.cy.js +0 -39
- package/cypress/e2e/2-advanced-examples/assertions.cy.js +0 -176
- package/cypress/e2e/2-advanced-examples/connectors.cy.js +0 -98
- package/cypress/e2e/2-advanced-examples/cookies.cy.js +0 -118
- package/cypress/e2e/2-advanced-examples/cypress_api.cy.js +0 -185
- package/cypress/e2e/2-advanced-examples/files.cy.js +0 -85
- package/cypress/e2e/2-advanced-examples/location.cy.js +0 -32
- package/cypress/e2e/2-advanced-examples/misc.cy.js +0 -104
- package/cypress/e2e/2-advanced-examples/navigation.cy.js +0 -56
- package/cypress/e2e/2-advanced-examples/network_requests.cy.js +0 -163
- package/cypress/e2e/2-advanced-examples/querying.cy.js +0 -114
- package/cypress/e2e/2-advanced-examples/spies_stubs_clocks.cy.js +0 -201
- package/cypress/e2e/2-advanced-examples/storage.cy.js +0 -110
- package/cypress/e2e/2-advanced-examples/traversal.cy.js +0 -121
- package/cypress/e2e/2-advanced-examples/utilities.cy.js +0 -108
- package/cypress/e2e/2-advanced-examples/viewport.cy.js +0 -58
- package/cypress/e2e/2-advanced-examples/waiting.cy.js +0 -30
- package/cypress/e2e/2-advanced-examples/window.cy.js +0 -22
- package/cypress/fixtures/example.json +0 -5
- package/cypress/support/commands.js +0 -25
- package/cypress/support/e2e.js +0 -20
- package/cypress.config.js +0 -9
- package/eslint.config.mjs +0 -15
- package/index.js.example +0 -50
- package/samples/react/README.md +0 -70
- package/samples/react/build/asset-manifest.json +0 -16
- package/samples/react/build/favicon.ico +0 -0
- package/samples/react/build/index.html +0 -1
- package/samples/react/build/logo192.png +0 -0
- package/samples/react/build/logo512.png +0 -0
- package/samples/react/build/manifest.json +0 -25
- package/samples/react/build/robots.txt +0 -3
- package/samples/react/build/static/css/main.073c9b0a.css +0 -2
- package/samples/react/build/static/css/main.073c9b0a.css.map +0 -1
- package/samples/react/build/static/js/787.b83ed06f.chunk.js +0 -2
- package/samples/react/build/static/js/787.b83ed06f.chunk.js.map +0 -1
- package/samples/react/build/static/js/main.0a848807.js +0 -3
- package/samples/react/build/static/js/main.0a848807.js.LICENSE.txt +0 -39
- package/samples/react/build/static/js/main.0a848807.js.map +0 -1
- package/samples/react/build/static/media/sdk-icons.b491623214b2af4cccdb.png +0 -0
- package/samples/react/package-lock.json +0 -28973
- package/samples/react/package.json +0 -44
- package/samples/react/public/favicon.ico +0 -0
- package/samples/react/public/index.html +0 -43
- package/samples/react/public/logo192.png +0 -0
- package/samples/react/public/logo512.png +0 -0
- package/samples/react/public/manifest.json +0 -25
- package/samples/react/public/robots.txt +0 -3
- package/samples/react/src/App.css +0 -38
- package/samples/react/src/App.js +0 -22
- package/samples/react/src/App.test.js +0 -8
- package/samples/react/src/assets/img/sdk-icons.png +0 -0
- package/samples/react/src/components/Cart.js +0 -29
- package/samples/react/src/components/ProductCard.js +0 -27
- package/samples/react/src/context/CartContext.js +0 -116
- package/samples/react/src/index.css +0 -13
- package/samples/react/src/index.js +0 -17
- package/samples/react/src/logo.svg +0 -1
- package/samples/react/src/reportWebVitals.js +0 -13
- package/samples/react/src/screens/Checkout.js +0 -82
- package/samples/react/src/screens/Store.js +0 -21
- package/samples/react/src/setupTests.js +0 -5
- package/samples/react/src/storeProducts.js +0 -30
- package/src/classes/3dsHandler.js +0 -199
- package/src/classes/BaseInlineCheckout.js +0 -303
- package/src/classes/LiteInlineCheckout.js +0 -217
- package/src/classes/checkout.js +0 -129
- package/src/classes/globalLoader.js +0 -31
- package/src/classes/inlineCheckout.js +0 -713
- package/src/data/apmApi.js +0 -38
- package/src/data/businessApi.js +0 -16
- package/src/data/cardApi.js +0 -134
- package/src/data/checkoutApi.js +0 -92
- package/src/data/customerApi.js +0 -32
- package/src/data/index.js +0 -17
- package/src/data/openPayApi.js +0 -16
- package/src/data/skyflowApi.js +0 -16
- package/src/helpers/skyflow.js +0 -370
- package/src/helpers/styles.js +0 -90
- package/src/helpers/template-skeleton.js +0 -59
- package/src/helpers/template.js +0 -1104
- package/src/helpers/utils.js +0 -257
- package/src/helpers/validations.js +0 -53
- package/src/index-dev.js +0 -329
- package/src/index.html +0 -180
- package/src/index.js +0 -21
- package/src/shared/catalog/commonLogosCatalog.js +0 -7
- package/src/shared/catalog/paymentMethodsCatalog.js +0 -246
- package/src/shared/constants/colors.js +0 -15
- package/src/shared/constants/displayMode.js +0 -4
- package/src/shared/constants/fieldPathNames.js +0 -4
- package/src/shared/constants/htmlTonderIds.js +0 -18
- package/src/shared/constants/messages.js +0 -11
- package/src/shared/constants/paymentMethodAPM.js +0 -63
- package/src/shared/constants/tonderUrl.js +0 -8
- package/webpack.config.js +0 -77
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
|
|
3
|
-
context('Traversal', () => {
|
|
4
|
-
beforeEach(() => {
|
|
5
|
-
cy.visit('https://example.cypress.io/commands/traversal')
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
it('.children() - get child DOM elements', () => {
|
|
9
|
-
// https://on.cypress.io/children
|
|
10
|
-
cy.get('.traversal-breadcrumb')
|
|
11
|
-
.children('.active')
|
|
12
|
-
.should('contain', 'Data')
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('.closest() - get closest ancestor DOM element', () => {
|
|
16
|
-
// https://on.cypress.io/closest
|
|
17
|
-
cy.get('.traversal-badge')
|
|
18
|
-
.closest('ul')
|
|
19
|
-
.should('have.class', 'list-group')
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('.eq() - get a DOM element at a specific index', () => {
|
|
23
|
-
// https://on.cypress.io/eq
|
|
24
|
-
cy.get('.traversal-list>li')
|
|
25
|
-
.eq(1).should('contain', 'siamese')
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('.filter() - get DOM elements that match the selector', () => {
|
|
29
|
-
// https://on.cypress.io/filter
|
|
30
|
-
cy.get('.traversal-nav>li')
|
|
31
|
-
.filter('.active').should('contain', 'About')
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('.find() - get descendant DOM elements of the selector', () => {
|
|
35
|
-
// https://on.cypress.io/find
|
|
36
|
-
cy.get('.traversal-pagination')
|
|
37
|
-
.find('li').find('a')
|
|
38
|
-
.should('have.length', 7)
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it('.first() - get first DOM element', () => {
|
|
42
|
-
// https://on.cypress.io/first
|
|
43
|
-
cy.get('.traversal-table td')
|
|
44
|
-
.first().should('contain', '1')
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
it('.last() - get last DOM element', () => {
|
|
48
|
-
// https://on.cypress.io/last
|
|
49
|
-
cy.get('.traversal-buttons .btn')
|
|
50
|
-
.last().should('contain', 'Submit')
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('.next() - get next sibling DOM element', () => {
|
|
54
|
-
// https://on.cypress.io/next
|
|
55
|
-
cy.get('.traversal-ul')
|
|
56
|
-
.contains('apples').next().should('contain', 'oranges')
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
it('.nextAll() - get all next sibling DOM elements', () => {
|
|
60
|
-
// https://on.cypress.io/nextall
|
|
61
|
-
cy.get('.traversal-next-all')
|
|
62
|
-
.contains('oranges')
|
|
63
|
-
.nextAll().should('have.length', 3)
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('.nextUntil() - get next sibling DOM elements until next el', () => {
|
|
67
|
-
// https://on.cypress.io/nextuntil
|
|
68
|
-
cy.get('#veggies')
|
|
69
|
-
.nextUntil('#nuts').should('have.length', 3)
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('.not() - remove DOM elements from set of DOM elements', () => {
|
|
73
|
-
// https://on.cypress.io/not
|
|
74
|
-
cy.get('.traversal-disabled .btn')
|
|
75
|
-
.not('[disabled]').should('not.contain', 'Disabled')
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
it('.parent() - get parent DOM element from DOM elements', () => {
|
|
79
|
-
// https://on.cypress.io/parent
|
|
80
|
-
cy.get('.traversal-mark')
|
|
81
|
-
.parent().should('contain', 'Morbi leo risus')
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
it('.parents() - get parent DOM elements from DOM elements', () => {
|
|
85
|
-
// https://on.cypress.io/parents
|
|
86
|
-
cy.get('.traversal-cite')
|
|
87
|
-
.parents().should('match', 'blockquote')
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
it('.parentsUntil() - get parent DOM elements from DOM elements until el', () => {
|
|
91
|
-
// https://on.cypress.io/parentsuntil
|
|
92
|
-
cy.get('.clothes-nav')
|
|
93
|
-
.find('.active')
|
|
94
|
-
.parentsUntil('.clothes-nav')
|
|
95
|
-
.should('have.length', 2)
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
it('.prev() - get previous sibling DOM element', () => {
|
|
99
|
-
// https://on.cypress.io/prev
|
|
100
|
-
cy.get('.birds').find('.active')
|
|
101
|
-
.prev().should('contain', 'Lorikeets')
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
it('.prevAll() - get all previous sibling DOM elements', () => {
|
|
105
|
-
// https://on.cypress.io/prevall
|
|
106
|
-
cy.get('.fruits-list').find('.third')
|
|
107
|
-
.prevAll().should('have.length', 2)
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('.prevUntil() - get all previous sibling DOM elements until el', () => {
|
|
111
|
-
// https://on.cypress.io/prevuntil
|
|
112
|
-
cy.get('.foods-list').find('#nuts')
|
|
113
|
-
.prevUntil('#veggies').should('have.length', 3)
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
it('.siblings() - get all sibling DOM elements', () => {
|
|
117
|
-
// https://on.cypress.io/siblings
|
|
118
|
-
cy.get('.traversal-pills .active')
|
|
119
|
-
.siblings().should('have.length', 2)
|
|
120
|
-
})
|
|
121
|
-
})
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
|
|
3
|
-
context('Utilities', () => {
|
|
4
|
-
beforeEach(() => {
|
|
5
|
-
cy.visit('https://example.cypress.io/utilities')
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
it('Cypress._ - call a lodash method', () => {
|
|
9
|
-
// https://on.cypress.io/_
|
|
10
|
-
cy.request('https://jsonplaceholder.cypress.io/users')
|
|
11
|
-
.then((response) => {
|
|
12
|
-
let ids = Cypress._.chain(response.body).map('id').take(3).value()
|
|
13
|
-
|
|
14
|
-
expect(ids).to.deep.eq([1, 2, 3])
|
|
15
|
-
})
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('Cypress.$ - call a jQuery method', () => {
|
|
19
|
-
// https://on.cypress.io/$
|
|
20
|
-
let $li = Cypress.$('.utility-jquery li:first')
|
|
21
|
-
|
|
22
|
-
cy.wrap($li)
|
|
23
|
-
.should('not.have.class', 'active')
|
|
24
|
-
.click()
|
|
25
|
-
.should('have.class', 'active')
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('Cypress.Blob - blob utilities and base64 string conversion', () => {
|
|
29
|
-
// https://on.cypress.io/blob
|
|
30
|
-
cy.get('.utility-blob').then(($div) => {
|
|
31
|
-
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL
|
|
32
|
-
// get the dataUrl string for the javascript-logo
|
|
33
|
-
return Cypress.Blob.imgSrcToDataURL('https://example.cypress.io/assets/img/javascript-logo.png', undefined, 'anonymous')
|
|
34
|
-
.then((dataUrl) => {
|
|
35
|
-
// create an <img> element and set its src to the dataUrl
|
|
36
|
-
let img = Cypress.$('<img />', { src: dataUrl })
|
|
37
|
-
|
|
38
|
-
// need to explicitly return cy here since we are initially returning
|
|
39
|
-
// the Cypress.Blob.imgSrcToDataURL promise to our test
|
|
40
|
-
// append the image
|
|
41
|
-
$div.append(img)
|
|
42
|
-
|
|
43
|
-
cy.get('.utility-blob img').click()
|
|
44
|
-
.should('have.attr', 'src', dataUrl)
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('Cypress.minimatch - test out glob patterns against strings', () => {
|
|
50
|
-
// https://on.cypress.io/minimatch
|
|
51
|
-
let matching = Cypress.minimatch('/users/1/comments', '/users/*/comments', {
|
|
52
|
-
matchBase: true,
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
expect(matching, 'matching wildcard').to.be.true
|
|
56
|
-
|
|
57
|
-
matching = Cypress.minimatch('/users/1/comments/2', '/users/*/comments', {
|
|
58
|
-
matchBase: true,
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
expect(matching, 'comments').to.be.false
|
|
62
|
-
|
|
63
|
-
// ** matches against all downstream path segments
|
|
64
|
-
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/**', {
|
|
65
|
-
matchBase: true,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
expect(matching, 'comments').to.be.true
|
|
69
|
-
|
|
70
|
-
// whereas * matches only the next path segment
|
|
71
|
-
|
|
72
|
-
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/*', {
|
|
73
|
-
matchBase: false,
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
expect(matching, 'comments').to.be.false
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
it('Cypress.Promise - instantiate a bluebird promise', () => {
|
|
80
|
-
// https://on.cypress.io/promise
|
|
81
|
-
let waited = false
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @return Bluebird<string>
|
|
85
|
-
*/
|
|
86
|
-
function waitOneSecond () {
|
|
87
|
-
// return a promise that resolves after 1 second
|
|
88
|
-
return new Cypress.Promise((resolve, reject) => {
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
// set waited to true
|
|
91
|
-
waited = true
|
|
92
|
-
|
|
93
|
-
// resolve with 'foo' string
|
|
94
|
-
resolve('foo')
|
|
95
|
-
}, 1000)
|
|
96
|
-
})
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
cy.then(() => {
|
|
100
|
-
// return a promise to cy.then() that
|
|
101
|
-
// is awaited until it resolves
|
|
102
|
-
return waitOneSecond().then((str) => {
|
|
103
|
-
expect(str).to.eq('foo')
|
|
104
|
-
expect(waited).to.be.true
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
})
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
context('Viewport', () => {
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
cy.visit('https://example.cypress.io/commands/viewport')
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
it('cy.viewport() - set the viewport size and dimension', () => {
|
|
8
|
-
// https://on.cypress.io/viewport
|
|
9
|
-
|
|
10
|
-
cy.get('#navbar').should('be.visible')
|
|
11
|
-
cy.viewport(320, 480)
|
|
12
|
-
|
|
13
|
-
// the navbar should have collapse since our screen is smaller
|
|
14
|
-
cy.get('#navbar').should('not.be.visible')
|
|
15
|
-
cy.get('.navbar-toggle').should('be.visible').click()
|
|
16
|
-
cy.get('.nav').find('a').should('be.visible')
|
|
17
|
-
|
|
18
|
-
// lets see what our app looks like on a super large screen
|
|
19
|
-
cy.viewport(2999, 2999)
|
|
20
|
-
|
|
21
|
-
// cy.viewport() accepts a set of preset sizes
|
|
22
|
-
// to easily set the screen to a device's width and height
|
|
23
|
-
|
|
24
|
-
// We added a cy.wait() between each viewport change so you can see
|
|
25
|
-
// the change otherwise it is a little too fast to see :)
|
|
26
|
-
|
|
27
|
-
cy.viewport('macbook-15')
|
|
28
|
-
cy.wait(200)
|
|
29
|
-
cy.viewport('macbook-13')
|
|
30
|
-
cy.wait(200)
|
|
31
|
-
cy.viewport('macbook-11')
|
|
32
|
-
cy.wait(200)
|
|
33
|
-
cy.viewport('ipad-2')
|
|
34
|
-
cy.wait(200)
|
|
35
|
-
cy.viewport('ipad-mini')
|
|
36
|
-
cy.wait(200)
|
|
37
|
-
cy.viewport('iphone-6+')
|
|
38
|
-
cy.wait(200)
|
|
39
|
-
cy.viewport('iphone-6')
|
|
40
|
-
cy.wait(200)
|
|
41
|
-
cy.viewport('iphone-5')
|
|
42
|
-
cy.wait(200)
|
|
43
|
-
cy.viewport('iphone-4')
|
|
44
|
-
cy.wait(200)
|
|
45
|
-
cy.viewport('iphone-3')
|
|
46
|
-
cy.wait(200)
|
|
47
|
-
|
|
48
|
-
// cy.viewport() accepts an orientation for all presets
|
|
49
|
-
// the default orientation is 'portrait'
|
|
50
|
-
cy.viewport('ipad-2', 'portrait')
|
|
51
|
-
cy.wait(200)
|
|
52
|
-
cy.viewport('iphone-4', 'landscape')
|
|
53
|
-
cy.wait(200)
|
|
54
|
-
|
|
55
|
-
// The viewport will be reset back to the default dimensions
|
|
56
|
-
// in between tests (the default can be set in cypress.config.{js|ts})
|
|
57
|
-
})
|
|
58
|
-
})
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
context('Waiting', () => {
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
cy.visit('https://example.cypress.io/commands/waiting')
|
|
5
|
-
})
|
|
6
|
-
// BE CAREFUL of adding unnecessary wait times.
|
|
7
|
-
// https://on.cypress.io/best-practices#Unnecessary-Waiting
|
|
8
|
-
|
|
9
|
-
// https://on.cypress.io/wait
|
|
10
|
-
it('cy.wait() - wait for a specific amount of time', () => {
|
|
11
|
-
cy.get('.wait-input1').type('Wait 1000ms after typing')
|
|
12
|
-
cy.wait(1000)
|
|
13
|
-
cy.get('.wait-input2').type('Wait 1000ms after typing')
|
|
14
|
-
cy.wait(1000)
|
|
15
|
-
cy.get('.wait-input3').type('Wait 1000ms after typing')
|
|
16
|
-
cy.wait(1000)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('cy.wait() - wait for a specific route', () => {
|
|
20
|
-
// Listen to GET to comments/1
|
|
21
|
-
cy.intercept('GET', '**/comments/*').as('getComment')
|
|
22
|
-
|
|
23
|
-
// we have code that gets a comment when
|
|
24
|
-
// the button is clicked in scripts.js
|
|
25
|
-
cy.get('.network-btn').click()
|
|
26
|
-
|
|
27
|
-
// wait for GET comments/1
|
|
28
|
-
cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])
|
|
29
|
-
})
|
|
30
|
-
})
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
|
|
3
|
-
context('Window', () => {
|
|
4
|
-
beforeEach(() => {
|
|
5
|
-
cy.visit('https://example.cypress.io/commands/window')
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
it('cy.window() - get the global window object', () => {
|
|
9
|
-
// https://on.cypress.io/window
|
|
10
|
-
cy.window().should('have.property', 'top')
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('cy.document() - get the document object', () => {
|
|
14
|
-
// https://on.cypress.io/document
|
|
15
|
-
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('cy.title() - get the title', () => {
|
|
19
|
-
// https://on.cypress.io/title
|
|
20
|
-
cy.title().should('include', 'Kitchen Sink')
|
|
21
|
-
})
|
|
22
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// ***********************************************
|
|
2
|
-
// This example commands.js shows you how to
|
|
3
|
-
// create various custom commands and overwrite
|
|
4
|
-
// existing commands.
|
|
5
|
-
//
|
|
6
|
-
// For more comprehensive examples of custom
|
|
7
|
-
// commands please read more here:
|
|
8
|
-
// https://on.cypress.io/custom-commands
|
|
9
|
-
// ***********************************************
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// -- This is a parent command --
|
|
13
|
-
// Cypress.Commands.add('login', (email, password) => { ... })
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
// -- This is a child command --
|
|
17
|
-
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// -- This is a dual command --
|
|
21
|
-
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
// -- This will overwrite an existing command --
|
|
25
|
-
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
package/cypress/support/e2e.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// ***********************************************************
|
|
2
|
-
// This example support/e2e.js is processed and
|
|
3
|
-
// loaded automatically before your test files.
|
|
4
|
-
//
|
|
5
|
-
// This is a great place to put global configuration and
|
|
6
|
-
// behavior that modifies Cypress.
|
|
7
|
-
//
|
|
8
|
-
// You can change the location of this file or turn off
|
|
9
|
-
// automatically serving support files with the
|
|
10
|
-
// 'supportFile' configuration option.
|
|
11
|
-
//
|
|
12
|
-
// You can read more here:
|
|
13
|
-
// https://on.cypress.io/configuration
|
|
14
|
-
// ***********************************************************
|
|
15
|
-
|
|
16
|
-
// Import commands.js using ES2015 syntax:
|
|
17
|
-
import './commands'
|
|
18
|
-
|
|
19
|
-
// Alternatively you can use CommonJS syntax:
|
|
20
|
-
// require('./commands')
|
package/cypress.config.js
DELETED
package/eslint.config.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
2
|
-
import eslintPluginPrettier from "eslint-plugin-prettier";
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
eslintConfigPrettier,
|
|
6
|
-
{
|
|
7
|
-
files: ["src/**/*.js"],
|
|
8
|
-
plugins: {
|
|
9
|
-
prettier: eslintPluginPrettier,
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
"prettier/prettier": "error",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
];
|
package/index.js.example
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Checkout } from './classes/checkout'
|
|
2
|
-
export {
|
|
3
|
-
Checkout,
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const config = {
|
|
7
|
-
url: "http://localhost:8081/#/",
|
|
8
|
-
apiKey: "e0f89d5328398b93634f56ba06c9474ec9388d5e",
|
|
9
|
-
type: "payment",
|
|
10
|
-
backgroundColor: "#F34616",
|
|
11
|
-
color: "#F3F7F6"
|
|
12
|
-
}
|
|
13
|
-
const tonderCheckout = new Checkout(config)
|
|
14
|
-
const params = {
|
|
15
|
-
shippingCost: "129.99",
|
|
16
|
-
email: "fuentesc91@gmail.com"
|
|
17
|
-
}
|
|
18
|
-
tonderCheckout.setOrder(params)
|
|
19
|
-
|
|
20
|
-
let products = {products: [
|
|
21
|
-
{
|
|
22
|
-
name: 'first product',
|
|
23
|
-
price_unit: 120.99,
|
|
24
|
-
quantity: 1
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'second product',
|
|
28
|
-
price_unit: 12.99,
|
|
29
|
-
}
|
|
30
|
-
]}
|
|
31
|
-
|
|
32
|
-
tonderCheckout.setOrder(products)
|
|
33
|
-
|
|
34
|
-
products = {products: [
|
|
35
|
-
{
|
|
36
|
-
name: 'first product',
|
|
37
|
-
price_unit: 120.99,
|
|
38
|
-
quantity: 3
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'second product',
|
|
42
|
-
price_unit: 12.99,
|
|
43
|
-
}
|
|
44
|
-
]}
|
|
45
|
-
|
|
46
|
-
tonderCheckout.setOrder(products)
|
|
47
|
-
|
|
48
|
-
console.log(tonderCheckout.getUrlParams())
|
|
49
|
-
|
|
50
|
-
tonderCheckout.mountButton({ buttonText: 'Proceder al pago' })
|
package/samples/react/README.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Getting Started with Create React App
|
|
2
|
-
|
|
3
|
-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
4
|
-
|
|
5
|
-
## Available Scripts
|
|
6
|
-
|
|
7
|
-
In the project directory, you can run:
|
|
8
|
-
|
|
9
|
-
### `npm start`
|
|
10
|
-
|
|
11
|
-
Runs the app in the development mode.\
|
|
12
|
-
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
|
|
13
|
-
|
|
14
|
-
The page will reload when you make changes.\
|
|
15
|
-
You may also see any lint errors in the console.
|
|
16
|
-
|
|
17
|
-
### `npm test`
|
|
18
|
-
|
|
19
|
-
Launches the test runner in the interactive watch mode.\
|
|
20
|
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
21
|
-
|
|
22
|
-
### `npm run build`
|
|
23
|
-
|
|
24
|
-
Builds the app for production to the `build` folder.\
|
|
25
|
-
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
26
|
-
|
|
27
|
-
The build is minified and the filenames include the hashes.\
|
|
28
|
-
Your app is ready to be deployed!
|
|
29
|
-
|
|
30
|
-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
|
31
|
-
|
|
32
|
-
### `npm run eject`
|
|
33
|
-
|
|
34
|
-
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
|
|
35
|
-
|
|
36
|
-
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
|
37
|
-
|
|
38
|
-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
|
|
39
|
-
|
|
40
|
-
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
|
|
41
|
-
|
|
42
|
-
## Learn More
|
|
43
|
-
|
|
44
|
-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
45
|
-
|
|
46
|
-
To learn React, check out the [React documentation](https://reactjs.org/).
|
|
47
|
-
|
|
48
|
-
### Code Splitting
|
|
49
|
-
|
|
50
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
|
51
|
-
|
|
52
|
-
### Analyzing the Bundle Size
|
|
53
|
-
|
|
54
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
|
55
|
-
|
|
56
|
-
### Making a Progressive Web App
|
|
57
|
-
|
|
58
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
|
59
|
-
|
|
60
|
-
### Advanced Configuration
|
|
61
|
-
|
|
62
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
|
63
|
-
|
|
64
|
-
### Deployment
|
|
65
|
-
|
|
66
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
|
67
|
-
|
|
68
|
-
### `npm run build` fails to minify
|
|
69
|
-
|
|
70
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": {
|
|
3
|
-
"main.css": "/react-example-use-tonder-sdk/static/css/main.073c9b0a.css",
|
|
4
|
-
"main.js": "/react-example-use-tonder-sdk/static/js/main.0a848807.js",
|
|
5
|
-
"static/js/787.b83ed06f.chunk.js": "/react-example-use-tonder-sdk/static/js/787.b83ed06f.chunk.js",
|
|
6
|
-
"static/media/sdk-icons.png": "/react-example-use-tonder-sdk/static/media/sdk-icons.b491623214b2af4cccdb.png",
|
|
7
|
-
"index.html": "/react-example-use-tonder-sdk/index.html",
|
|
8
|
-
"main.073c9b0a.css.map": "/react-example-use-tonder-sdk/static/css/main.073c9b0a.css.map",
|
|
9
|
-
"main.0a848807.js.map": "/react-example-use-tonder-sdk/static/js/main.0a848807.js.map",
|
|
10
|
-
"787.b83ed06f.chunk.js.map": "/react-example-use-tonder-sdk/static/js/787.b83ed06f.chunk.js.map"
|
|
11
|
-
},
|
|
12
|
-
"entrypoints": [
|
|
13
|
-
"static/css/main.073c9b0a.css",
|
|
14
|
-
"static/js/main.0a848807.js"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/react-example-use-tonder-sdk/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/react-example-use-tonder-sdk/logo192.png"/><link rel="manifest" href="/react-example-use-tonder-sdk/manifest.json"/><title>React App</title><script defer="defer" src="/react-example-use-tonder-sdk/static/js/main.0a848807.js"></script><link href="/react-example-use-tonder-sdk/static/css/main.073c9b0a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="inlinesdk.js"></script><script>const form=document.querySelector("#payment-form"),apiKey="00d17d61e9240c6e0611fbdb1558e636ed6389db",totalElement=document.querySelector("#cart-total"),inlineCheckout=new InlineCheckout({form:form,apiKey:apiKey,totalElementId:"cart-total"});inlineCheckout.injectCheckout()</script></body></html>
|
|
Binary file
|
|
Binary file
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App-header{align-items:center;background-color:#282c34;color:#fff;display:flex;flex-direction:column;font-size:calc(10px + 2vmin);justify-content:center;min-height:100vh}.App-link{color:#61dafb}@-webkit-keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}
|
|
2
|
-
/*# sourceMappingURL=main.073c9b0a.css.map*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/css/main.073c9b0a.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,KACE,iBACF,CAEA,UACE,aAAc,CACd,mBACF,CAEA,8CACE,UACE,mDAA4C,CAA5C,2CACF,CACF,CAEA,YAKE,kBAAmB,CAJnB,wBAAyB,CAOzB,UAAY,CALZ,YAAa,CACb,qBAAsB,CAGtB,4BAA6B,CAD7B,sBAAuB,CAJvB,gBAOF,CAEA,UACE,aACF,CAEA,iCACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF,CAPA,yBACE,GACE,8BAAuB,CAAvB,sBACF,CACA,GACE,+BAAyB,CAAzB,uBACF,CACF","sources":["index.css","App.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunksdk_test=self.webpackChunksdk_test||[]).push([[787],{787:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return g},getFID:function(){return F},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,d=function(){return"hidden"===document.visibilityState?0:1/0},p=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=d(),p(),s((function(){setTimeout((function(){v=d(),p()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},h=!1,T=-1,y=function(e,t){h||(g((function(e){T=e.value})),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},d=c("layout-shift",v);d&&(n=m(i,r,t),f((function(){d.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,k(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},k=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},F=function(e,t){var n,a=l(),v=u("FID"),d=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},p=c("first-input",d);n=m(e,v,t),p&&f((function(){p.takeRecords().map(d),p.disconnect()}),!0),p&&s((function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,k(addEventListener),a=d,o.push(a),S()}))},C={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){C[r.id]||(o.takeRecords().map(a),o.disconnect(),C[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),f(v,!0),s((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,C[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]);
|
|
2
|
-
//# sourceMappingURL=787.b83ed06f.chunk.js.map
|