@paydock/client-sdk 1.106.1 → 1.107.0-beta

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 (490) hide show
  1. package/README.md +194 -162
  2. package/bundles/index.cjs +10483 -0
  3. package/bundles/index.cjs.d.ts +3206 -0
  4. package/bundles/index.cjs.map +1 -0
  5. package/bundles/index.mjs +10451 -0
  6. package/bundles/index.mjs.d.ts +3206 -0
  7. package/bundles/index.mjs.map +1 -0
  8. package/{lib → bundles/types}/api/api-base.d.ts +2 -1
  9. package/bundles/types/api/api-base.d.ts.map +1 -0
  10. package/{lib → bundles/types}/api/api-charge-internal.d.ts +1 -0
  11. package/bundles/types/api/api-charge-internal.d.ts.map +1 -0
  12. package/{lib → bundles/types}/api/api-charge.d.ts +1 -0
  13. package/bundles/types/api/api-charge.d.ts.map +1 -0
  14. package/{lib → bundles/types}/api/api-internal.d.ts +1 -0
  15. package/bundles/types/api/api-internal.d.ts.map +1 -0
  16. package/{lib → bundles/types}/api/api-service-internal.d.ts +2 -1
  17. package/bundles/types/api/api-service-internal.d.ts.map +1 -0
  18. package/{lib → bundles/types}/api/api.d.ts +1 -0
  19. package/bundles/types/api/api.d.ts.map +1 -0
  20. package/bundles/types/api/index.d.ts +2 -0
  21. package/bundles/types/api/index.d.ts.map +1 -0
  22. package/{lib → bundles/types}/canvas-3ds/canvas-3ds.d.ts +1 -0
  23. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -0
  24. package/{lib → bundles/types}/canvas-3ds/index.d.ts +1 -0
  25. package/bundles/types/canvas-3ds/index.d.ts.map +1 -0
  26. package/{lib → bundles/types}/canvas-3ds/services/gpayments-service.d.ts +1 -0
  27. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -0
  28. package/{lib → bundles/types}/canvas-3ds/services/index.d.ts +1 -0
  29. package/bundles/types/canvas-3ds/services/index.d.ts.map +1 -0
  30. package/{lib → bundles/types}/canvas-3ds/services/standalone3ds-service.d.ts +1 -0
  31. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -0
  32. package/{lib → bundles/types}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -0
  33. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -0
  34. package/{lib → bundles/types}/checkout-button/afterpay/afterpay.runner.d.ts +1 -0
  35. package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +1 -0
  36. package/{lib → bundles/types}/checkout-button/checkout-button.d.ts +1 -0
  37. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -0
  38. package/{lib → bundles/types}/checkout-button/checkout-button.interface.d.ts +1 -0
  39. package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +1 -0
  40. package/{lib → bundles/types}/checkout-button/checkout-contextual-handler.d.ts +1 -0
  41. package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +1 -0
  42. package/{lib → bundles/types}/checkout-button/index.d.ts +2 -1
  43. package/bundles/types/checkout-button/index.d.ts.map +1 -0
  44. package/{lib → bundles/types}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -0
  45. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -0
  46. package/{lib → bundles/types}/checkout-button/paypal/paypal.runner.d.ts +1 -0
  47. package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +1 -0
  48. package/{lib → bundles/types}/checkout-button/runner/base.runner.d.ts +4 -3
  49. package/bundles/types/checkout-button/runner/base.runner.d.ts.map +1 -0
  50. package/{lib → bundles/types}/checkout-button/runner/contextual.runner.d.ts +2 -1
  51. package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +1 -0
  52. package/{lib → bundles/types}/checkout-button/runner/index.d.ts +1 -0
  53. package/bundles/types/checkout-button/runner/index.d.ts.map +1 -0
  54. package/{lib → bundles/types}/checkout-button/runner/popup.runner.d.ts +2 -1
  55. package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +1 -0
  56. package/{lib → bundles/types}/checkout-button/runner/redirect.runner.d.ts +2 -1
  57. package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +1 -0
  58. package/bundles/types/checkout-button/zipmoney/index.d.ts +4 -0
  59. package/bundles/types/checkout-button/zipmoney/index.d.ts.map +1 -0
  60. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -0
  61. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -0
  62. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +2 -1
  63. package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -0
  64. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +2 -1
  65. package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +1 -0
  66. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.config.d.ts +1 -0
  67. package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +1 -0
  68. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.runner.d.ts +2 -1
  69. package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +1 -0
  70. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.types.d.ts +1 -0
  71. package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +1 -0
  72. package/{lib → bundles/types}/components/ability-guard.d.ts +1 -0
  73. package/bundles/types/components/ability-guard.d.ts.map +1 -0
  74. package/{lib → bundles/types}/components/background.d.ts +1 -0
  75. package/bundles/types/components/background.d.ts.map +1 -0
  76. package/{lib → bundles/types}/components/container.d.ts +1 -0
  77. package/bundles/types/components/container.d.ts.map +1 -0
  78. package/{lib → bundles/types}/components/dispatcher.d.ts +2 -1
  79. package/bundles/types/components/dispatcher.d.ts.map +1 -0
  80. package/{lib → bundles/types}/components/element-style.d.ts +2 -1
  81. package/bundles/types/components/element-style.d.ts.map +1 -0
  82. package/{lib → bundles/types}/components/flypay-iframe-event.d.ts +1 -0
  83. package/bundles/types/components/flypay-iframe-event.d.ts.map +1 -0
  84. package/{lib/components/form-Interceptor.d.ts → bundles/types/components/form-interceptor.d.ts} +1 -0
  85. package/bundles/types/components/form-interceptor.d.ts.map +1 -0
  86. package/{lib → bundles/types}/components/http-core.d.ts +1 -0
  87. package/bundles/types/components/http-core.d.ts.map +1 -0
  88. package/{lib → bundles/types}/components/iframe-event.d.ts +2 -0
  89. package/bundles/types/components/iframe-event.d.ts.map +1 -0
  90. package/{lib → bundles/types}/components/iframe.d.ts +1 -0
  91. package/bundles/types/components/iframe.d.ts.map +1 -0
  92. package/{lib → bundles/types}/components/link.d.ts +2 -1
  93. package/bundles/types/components/link.d.ts.map +1 -0
  94. package/{lib → bundles/types}/components/loader.d.ts +1 -0
  95. package/bundles/types/components/loader.d.ts.map +1 -0
  96. package/{lib → bundles/types}/components/param.d.ts +8 -7
  97. package/bundles/types/components/param.d.ts.map +1 -0
  98. package/{lib → bundles/types}/components/popup.d.ts +1 -0
  99. package/bundles/types/components/popup.d.ts.map +1 -0
  100. package/{lib → bundles/types}/components/storage-dispatcher.d.ts +1 -0
  101. package/bundles/types/components/storage-dispatcher.d.ts.map +1 -0
  102. package/{lib → bundles/types}/components/trigger.d.ts +1 -0
  103. package/bundles/types/components/trigger.d.ts.map +1 -0
  104. package/{lib → bundles/types}/components/vault-display-iframe-event.d.ts +1 -0
  105. package/bundles/types/components/vault-display-iframe-event.d.ts.map +1 -0
  106. package/{lib → bundles/types}/components/wallet-background.d.ts +3 -1
  107. package/bundles/types/components/wallet-background.d.ts.map +1 -0
  108. package/{lib → bundles/types}/components/wallet-trigger.d.ts +1 -0
  109. package/bundles/types/components/wallet-trigger.d.ts.map +1 -0
  110. package/bundles/types/configs/env/environment.cba.d.ts +29 -0
  111. package/bundles/types/configs/env/environment.cba.d.ts.map +1 -0
  112. package/bundles/types/configs/env/environment.interface.d.ts +12 -0
  113. package/bundles/types/configs/env/environment.interface.d.ts.map +1 -0
  114. package/{lib/configs/env/env.d.ts → bundles/types/configs/env/environment.paydock.d.ts} +5 -8
  115. package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -0
  116. package/bundles/types/configs/env/index.d.ts +3 -0
  117. package/bundles/types/configs/env/index.d.ts.map +1 -0
  118. package/{lib → bundles/types}/configs/sdk.d.ts +3 -2
  119. package/bundles/types/configs/sdk.d.ts.map +1 -0
  120. package/{lib → bundles/types}/constants/validators.d.ts +3 -2
  121. package/bundles/types/constants/validators.d.ts.map +1 -0
  122. package/{lib → bundles/types}/external-checkout/builder.d.ts +1 -0
  123. package/bundles/types/external-checkout/builder.d.ts.map +1 -0
  124. package/{lib → bundles/types}/external-checkout/checker.d.ts +1 -0
  125. package/bundles/types/external-checkout/checker.d.ts.map +1 -0
  126. package/bundles/types/external-checkout/index.d.ts +3 -0
  127. package/bundles/types/external-checkout/index.d.ts.map +1 -0
  128. package/{lib → bundles/types}/helper/access-token.d.ts +1 -0
  129. package/bundles/types/helper/access-token.d.ts.map +1 -0
  130. package/{lib → bundles/types}/helper/browser.d.ts +1 -0
  131. package/bundles/types/helper/browser.d.ts.map +1 -0
  132. package/bundles/types/helper/element-id.d.ts +5 -0
  133. package/bundles/types/helper/element-id.d.ts.map +1 -0
  134. package/{lib → bundles/types}/helper/event-emitter.d.ts +1 -0
  135. package/bundles/types/helper/event-emitter.d.ts.map +1 -0
  136. package/{lib → bundles/types}/helper/event.d.ts +1 -0
  137. package/bundles/types/helper/event.d.ts.map +1 -0
  138. package/{lib → bundles/types}/helper/ms.d.ts +1 -0
  139. package/bundles/types/helper/ms.d.ts.map +1 -0
  140. package/{lib → bundles/types}/helper/object.d.ts +1 -0
  141. package/bundles/types/helper/object.d.ts.map +1 -0
  142. package/{lib → bundles/types}/helper/url.d.ts +1 -0
  143. package/bundles/types/helper/url.d.ts.map +1 -0
  144. package/{lib → bundles/types}/helper/uuid.d.ts +1 -0
  145. package/bundles/types/helper/uuid.d.ts.map +1 -0
  146. package/bundles/types/index-cba.d.ts +13 -0
  147. package/bundles/types/index-cba.d.ts.map +1 -0
  148. package/bundles/types/index.d.ts +14 -0
  149. package/bundles/types/index.d.ts.map +1 -0
  150. package/{lib → bundles/types}/payment-source/builder.d.ts +1 -0
  151. package/bundles/types/payment-source/builder.d.ts.map +1 -0
  152. package/{lib → bundles/types}/payment-source/index.d.ts +1 -0
  153. package/bundles/types/payment-source/index.d.ts.map +1 -0
  154. package/{lib → bundles/types}/payment-source-widget/html-payment-source-widget.d.ts +1 -0
  155. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -0
  156. package/{lib → bundles/types}/payment-source-widget/index.d.ts +1 -0
  157. package/bundles/types/payment-source-widget/index.d.ts.map +1 -0
  158. package/{lib → bundles/types}/payment-source-widget/interfaces.d.ts +1 -0
  159. package/bundles/types/payment-source-widget/interfaces.d.ts.map +1 -0
  160. package/{lib → bundles/types}/payment-source-widget/payment-source-widget.d.ts +1 -0
  161. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -0
  162. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +31 -0
  163. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -0
  164. package/{lib → bundles/types}/secure-remote-commerce/index.d.ts +5 -4
  165. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -0
  166. package/{lib → bundles/types}/secure-remote-commerce/interfaces.d.ts +10 -9
  167. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -0
  168. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  169. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  170. package/{lib → bundles/types}/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +5 -4
  171. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  172. package/{lib → bundles/types}/secure-remote-commerce/providers/src-provider.d.ts +1 -0
  173. package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -0
  174. package/{lib → bundles/types}/secure-remote-commerce/secure-remote-commerce.d.ts +4 -3
  175. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -0
  176. package/{lib → bundles/types}/vault-display-widget/index.d.ts +1 -0
  177. package/bundles/types/vault-display-widget/index.d.ts.map +1 -0
  178. package/{lib → bundles/types}/vault-display-widget/vault-display-widget.d.ts +1 -0
  179. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -0
  180. package/{lib → bundles/types}/wallet-buttons/afterpay.wallet-service.d.ts +1 -0
  181. package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +1 -0
  182. package/{lib → bundles/types}/wallet-buttons/apple.wallet-service.d.ts +1 -0
  183. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -0
  184. package/{lib → bundles/types}/wallet-buttons/flypay-v2.wallet-service.d.ts +2 -1
  185. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -0
  186. package/{lib → bundles/types}/wallet-buttons/flypay.wallet-service.d.ts +1 -0
  187. package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +1 -0
  188. package/{lib → bundles/types}/wallet-buttons/google.wallet-service.d.ts +1 -0
  189. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -0
  190. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +6 -0
  191. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  192. package/bundles/types/wallet-buttons/index-cba.d.ts +2 -0
  193. package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -0
  194. package/{lib → bundles/types}/wallet-buttons/index.d.ts +1 -0
  195. package/bundles/types/wallet-buttons/index.d.ts.map +1 -0
  196. package/{lib → bundles/types}/wallet-buttons/interfaces.d.ts +1 -0
  197. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -0
  198. package/{lib → bundles/types}/wallet-buttons/mastercard.wallet-service.d.ts +1 -0
  199. package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +1 -0
  200. package/{lib → bundles/types}/wallet-buttons/paypal.wallet-service.d.ts +1 -0
  201. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -0
  202. package/{lib → bundles/types}/wallet-buttons/stripe.wallet-service.d.ts +1 -0
  203. package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +1 -0
  204. package/{lib → bundles/types}/wallet-buttons/wallet-buttons.d.ts +1 -0
  205. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -0
  206. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +330 -0
  207. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -0
  208. package/{lib → bundles/types}/wallet-buttons/wallet-service.d.ts +1 -0
  209. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -0
  210. package/{lib → bundles/types}/widget/configuration.d.ts +2 -1
  211. package/bundles/types/widget/configuration.d.ts.map +1 -0
  212. package/{lib → bundles/types}/widget/html-multi-widget.d.ts +4 -3
  213. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -0
  214. package/{lib → bundles/types}/widget/html-widget.d.ts +1 -0
  215. package/bundles/types/widget/html-widget.d.ts.map +1 -0
  216. package/{lib → bundles/types}/widget/index.d.ts +2 -1
  217. package/bundles/types/widget/index.d.ts.map +1 -0
  218. package/{lib → bundles/types}/widget/meta.d.ts +1 -0
  219. package/bundles/types/widget/meta.d.ts.map +1 -0
  220. package/{lib → bundles/types}/widget/multi-widget.d.ts +2 -1
  221. package/bundles/types/widget/multi-widget.d.ts.map +1 -0
  222. package/{lib → bundles/types}/widget/style.d.ts +1 -0
  223. package/bundles/types/widget/style.d.ts.map +1 -0
  224. package/bundles/widget.umd.js +6755 -6894
  225. package/bundles/widget.umd.js.d.ts +3206 -0
  226. package/bundles/widget.umd.js.map +1 -0
  227. package/bundles/widget.umd.js.min.d.ts +3206 -0
  228. package/bundles/widget.umd.min.js +2 -1
  229. package/bundles/widget.umd.min.js.map +1 -0
  230. package/docs/api-canvas3ds.md +158 -0
  231. package/docs/api-checkout-button.md +912 -0
  232. package/docs/api-examples.md +65 -0
  233. package/docs/api-ps-widget.md +585 -0
  234. package/docs/api-vault-display.md +94 -0
  235. package/docs/api-widget.md +2499 -0
  236. package/docs/api-wrapper.md +78 -0
  237. package/docs/canvas3ds-examples.md +242 -0
  238. package/docs/cba-header.md +13 -0
  239. package/docs/cba-license.md +2 -0
  240. package/docs/checkout-examples.md +248 -0
  241. package/docs/click-to-pay-examples.md +231 -0
  242. package/docs/click-to-pay.md +336 -0
  243. package/docs/header.md +15 -0
  244. package/docs/html/layout.html +78 -0
  245. package/docs/html/marked.js +23 -0
  246. package/docs/html/style.css +365 -0
  247. package/docs/install/npm.content.md +16 -0
  248. package/docs/install/npm.example.md +24 -0
  249. package/docs/install/umd.content.md +20 -0
  250. package/docs/install/umd.example.md +6 -0
  251. package/docs/install.md +43 -0
  252. package/docs/install.readme.t.md +17 -0
  253. package/docs/install.slate.t.md +17 -0
  254. package/docs/license.md +2 -0
  255. package/docs/partials/header.hbs +3 -0
  256. package/docs/ps-examples.md +129 -0
  257. package/docs/vault-display-example.md +132 -0
  258. package/docs/wallet-buttons-examples.md +609 -0
  259. package/docs/wallet-buttons.md +619 -0
  260. package/docs/wallet-cba-buttons-examples.md +388 -0
  261. package/docs/widget-examples.md +134 -0
  262. package/package.json +164 -42
  263. package/slate.md +141 -106
  264. package/.nvmrc +0 -1
  265. package/api.d.ts +0 -1
  266. package/api.js +0 -1
  267. package/canvas3ds.d.ts +0 -1
  268. package/canvas3ds.js +0 -1
  269. package/checkout-button.d.ts +0 -1
  270. package/checkout-button.js +0 -1
  271. package/inicialization-guide.md +0 -7
  272. package/lib/api/api-base.js +0 -101
  273. package/lib/api/api-base.js.map +0 -1
  274. package/lib/api/api-charge-internal.js +0 -30
  275. package/lib/api/api-charge-internal.js.map +0 -1
  276. package/lib/api/api-charge.js +0 -49
  277. package/lib/api/api-charge.js.map +0 -1
  278. package/lib/api/api-internal.js +0 -13
  279. package/lib/api/api-internal.js.map +0 -1
  280. package/lib/api/api-service-internal.js +0 -19
  281. package/lib/api/api-service-internal.js.map +0 -1
  282. package/lib/api/api.js +0 -62
  283. package/lib/api/api.js.map +0 -1
  284. package/lib/api/index.d.ts +0 -1
  285. package/lib/api/index.js +0 -2
  286. package/lib/api/index.js.map +0 -1
  287. package/lib/canvas-3ds/canvas-3ds.js +0 -157
  288. package/lib/canvas-3ds/canvas-3ds.js.map +0 -1
  289. package/lib/canvas-3ds/index.js +0 -2
  290. package/lib/canvas-3ds/index.js.map +0 -1
  291. package/lib/canvas-3ds/services/gpayments-service.js +0 -181
  292. package/lib/canvas-3ds/services/gpayments-service.js.map +0 -1
  293. package/lib/canvas-3ds/services/index.js +0 -2
  294. package/lib/canvas-3ds/services/index.js.map +0 -1
  295. package/lib/canvas-3ds/services/standalone3ds-service.js +0 -32
  296. package/lib/canvas-3ds/services/standalone3ds-service.js.map +0 -1
  297. package/lib/checkout-button/afterpay/afterpay-checkout-button.js +0 -50
  298. package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +0 -1
  299. package/lib/checkout-button/afterpay/afterpay.runner.js +0 -41
  300. package/lib/checkout-button/afterpay/afterpay.runner.js.map +0 -1
  301. package/lib/checkout-button/checkout-button.interface.js +0 -45
  302. package/lib/checkout-button/checkout-button.interface.js.map +0 -1
  303. package/lib/checkout-button/checkout-button.js +0 -266
  304. package/lib/checkout-button/checkout-button.js.map +0 -1
  305. package/lib/checkout-button/checkout-contextual-handler.js +0 -75
  306. package/lib/checkout-button/checkout-contextual-handler.js.map +0 -1
  307. package/lib/checkout-button/index.js +0 -85
  308. package/lib/checkout-button/index.js.map +0 -1
  309. package/lib/checkout-button/paypal/paypal-checkout-button.js +0 -25
  310. package/lib/checkout-button/paypal/paypal-checkout-button.js.map +0 -1
  311. package/lib/checkout-button/paypal/paypal.runner.js +0 -14
  312. package/lib/checkout-button/paypal/paypal.runner.js.map +0 -1
  313. package/lib/checkout-button/runner/base.runner.js +0 -13
  314. package/lib/checkout-button/runner/base.runner.js.map +0 -1
  315. package/lib/checkout-button/runner/contextual.runner.js +0 -40
  316. package/lib/checkout-button/runner/contextual.runner.js.map +0 -1
  317. package/lib/checkout-button/runner/index.js +0 -11
  318. package/lib/checkout-button/runner/index.js.map +0 -1
  319. package/lib/checkout-button/runner/popup.runner.js +0 -68
  320. package/lib/checkout-button/runner/popup.runner.js.map +0 -1
  321. package/lib/checkout-button/runner/redirect.runner.js +0 -15
  322. package/lib/checkout-button/runner/redirect.runner.js.map +0 -1
  323. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +0 -64
  324. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +0 -1
  325. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +0 -78
  326. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +0 -1
  327. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +0 -49
  328. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +0 -1
  329. package/lib/checkout-button/zipmoney/zipmoney.config.js +0 -4
  330. package/lib/checkout-button/zipmoney/zipmoney.config.js.map +0 -1
  331. package/lib/checkout-button/zipmoney/zipmoney.runner.js +0 -23
  332. package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +0 -1
  333. package/lib/checkout-button/zipmoney/zipmoney.types.js +0 -1
  334. package/lib/checkout-button/zipmoney/zipmoney.types.js.map +0 -1
  335. package/lib/components/ability-guard.js +0 -44
  336. package/lib/components/ability-guard.js.map +0 -1
  337. package/lib/components/background.js +0 -193
  338. package/lib/components/background.js.map +0 -1
  339. package/lib/components/container.js +0 -63
  340. package/lib/components/container.js.map +0 -1
  341. package/lib/components/dispatcher.js +0 -39
  342. package/lib/components/dispatcher.js.map +0 -1
  343. package/lib/components/element-style.js +0 -52
  344. package/lib/components/element-style.js.map +0 -1
  345. package/lib/components/flypay-iframe-event.js +0 -28
  346. package/lib/components/flypay-iframe-event.js.map +0 -1
  347. package/lib/components/form-Interceptor.js +0 -38
  348. package/lib/components/form-Interceptor.js.map +0 -1
  349. package/lib/components/http-core.js +0 -57
  350. package/lib/components/http-core.js.map +0 -1
  351. package/lib/components/iframe-event.js +0 -77
  352. package/lib/components/iframe-event.js.map +0 -1
  353. package/lib/components/iframe.js +0 -62
  354. package/lib/components/iframe.js.map +0 -1
  355. package/lib/components/link.js +0 -60
  356. package/lib/components/link.js.map +0 -1
  357. package/lib/components/loader.js +0 -234
  358. package/lib/components/loader.js.map +0 -1
  359. package/lib/components/param.js +0 -147
  360. package/lib/components/param.js.map +0 -1
  361. package/lib/components/popup.js +0 -104
  362. package/lib/components/popup.js.map +0 -1
  363. package/lib/components/storage-dispatcher.js +0 -75
  364. package/lib/components/storage-dispatcher.js.map +0 -1
  365. package/lib/components/trigger.js +0 -49
  366. package/lib/components/trigger.js.map +0 -1
  367. package/lib/components/vault-display-iframe-event.js +0 -27
  368. package/lib/components/vault-display-iframe-event.js.map +0 -1
  369. package/lib/components/wallet-background.js +0 -75
  370. package/lib/components/wallet-background.js.map +0 -1
  371. package/lib/components/wallet-trigger.js +0 -27
  372. package/lib/components/wallet-trigger.js.map +0 -1
  373. package/lib/configs/env/env.js +0 -117
  374. package/lib/configs/env/env.js.map +0 -1
  375. package/lib/configs/sdk.js +0 -16
  376. package/lib/configs/sdk.js.map +0 -1
  377. package/lib/constants/validators.js +0 -42
  378. package/lib/constants/validators.js.map +0 -1
  379. package/lib/external-checkout/builder.js +0 -45
  380. package/lib/external-checkout/builder.js.map +0 -1
  381. package/lib/external-checkout/checker.js +0 -22
  382. package/lib/external-checkout/checker.js.map +0 -1
  383. package/lib/external-checkout/index.d.ts +0 -2
  384. package/lib/external-checkout/index.js +0 -3
  385. package/lib/external-checkout/index.js.map +0 -1
  386. package/lib/helper/access-token.js +0 -44
  387. package/lib/helper/access-token.js.map +0 -1
  388. package/lib/helper/browser.js +0 -79
  389. package/lib/helper/browser.js.map +0 -1
  390. package/lib/helper/event-emitter.js +0 -23
  391. package/lib/helper/event-emitter.js.map +0 -1
  392. package/lib/helper/event.js +0 -23
  393. package/lib/helper/event.js.map +0 -1
  394. package/lib/helper/ms.js +0 -32
  395. package/lib/helper/ms.js.map +0 -1
  396. package/lib/helper/object.js +0 -6
  397. package/lib/helper/object.js.map +0 -1
  398. package/lib/helper/url.js +0 -11
  399. package/lib/helper/url.js.map +0 -1
  400. package/lib/helper/uuid.js +0 -26
  401. package/lib/helper/uuid.js.map +0 -1
  402. package/lib/index.d.ts +0 -15
  403. package/lib/index.js +0 -15
  404. package/lib/index.js.map +0 -1
  405. package/lib/payment-source/builder.js +0 -49
  406. package/lib/payment-source/builder.js.map +0 -1
  407. package/lib/payment-source/index.js +0 -2
  408. package/lib/payment-source/index.js.map +0 -1
  409. package/lib/payment-source-widget/html-payment-source-widget.js +0 -172
  410. package/lib/payment-source-widget/html-payment-source-widget.js.map +0 -1
  411. package/lib/payment-source-widget/index.js +0 -35
  412. package/lib/payment-source-widget/index.js.map +0 -1
  413. package/lib/payment-source-widget/interfaces.js +0 -2
  414. package/lib/payment-source-widget/interfaces.js.map +0 -1
  415. package/lib/payment-source-widget/payment-source-widget.js +0 -142
  416. package/lib/payment-source-widget/payment-source-widget.js.map +0 -1
  417. package/lib/secure-remote-commerce/index.js +0 -103
  418. package/lib/secure-remote-commerce/index.js.map +0 -1
  419. package/lib/secure-remote-commerce/interfaces.js +0 -48
  420. package/lib/secure-remote-commerce/interfaces.js.map +0 -1
  421. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +0 -30
  422. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js +0 -40
  423. package/lib/secure-remote-commerce/mastercard-secure-remote-commerce.js.map +0 -1
  424. package/lib/secure-remote-commerce/providers/mastercard-src/index.d.ts +0 -1
  425. package/lib/secure-remote-commerce/providers/mastercard-src/index.js +0 -2
  426. package/lib/secure-remote-commerce/providers/mastercard-src/index.js.map +0 -1
  427. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js +0 -89
  428. package/lib/secure-remote-commerce/providers/mastercard-src/mastercard-src.js.map +0 -1
  429. package/lib/secure-remote-commerce/providers/src-provider.js +0 -1
  430. package/lib/secure-remote-commerce/providers/src-provider.js.map +0 -1
  431. package/lib/secure-remote-commerce/secure-remote-commerce.js +0 -155
  432. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +0 -1
  433. package/lib/vault-display-widget/index.js +0 -14
  434. package/lib/vault-display-widget/index.js.map +0 -1
  435. package/lib/vault-display-widget/vault-display-widget.js +0 -99
  436. package/lib/vault-display-widget/vault-display-widget.js.map +0 -1
  437. package/lib/wallet-buttons/afterpay.wallet-service.js +0 -152
  438. package/lib/wallet-buttons/afterpay.wallet-service.js.map +0 -1
  439. package/lib/wallet-buttons/apple.wallet-service.js +0 -324
  440. package/lib/wallet-buttons/apple.wallet-service.js.map +0 -1
  441. package/lib/wallet-buttons/flypay-v2.wallet-service.js +0 -163
  442. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +0 -1
  443. package/lib/wallet-buttons/flypay.wallet-service.js +0 -117
  444. package/lib/wallet-buttons/flypay.wallet-service.js.map +0 -1
  445. package/lib/wallet-buttons/google.wallet-service.js +0 -301
  446. package/lib/wallet-buttons/google.wallet-service.js.map +0 -1
  447. package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -3
  448. package/lib/wallet-buttons/helpers/flypay-v2.helper.js +0 -151
  449. package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +0 -1
  450. package/lib/wallet-buttons/index.js +0 -128
  451. package/lib/wallet-buttons/index.js.map +0 -1
  452. package/lib/wallet-buttons/interfaces.js +0 -1
  453. package/lib/wallet-buttons/interfaces.js.map +0 -1
  454. package/lib/wallet-buttons/mastercard.wallet-service.js +0 -27
  455. package/lib/wallet-buttons/mastercard.wallet-service.js.map +0 -1
  456. package/lib/wallet-buttons/paypal.wallet-service.js +0 -144
  457. package/lib/wallet-buttons/paypal.wallet-service.js.map +0 -1
  458. package/lib/wallet-buttons/stripe.wallet-service.js +0 -100
  459. package/lib/wallet-buttons/stripe.wallet-service.js.map +0 -1
  460. package/lib/wallet-buttons/wallet-buttons.js +0 -479
  461. package/lib/wallet-buttons/wallet-buttons.js.map +0 -1
  462. package/lib/wallet-buttons/wallet-service.js +0 -60
  463. package/lib/wallet-buttons/wallet-service.js.map +0 -1
  464. package/lib/widget/configuration.js +0 -260
  465. package/lib/widget/configuration.js.map +0 -1
  466. package/lib/widget/html-multi-widget.js +0 -422
  467. package/lib/widget/html-multi-widget.js.map +0 -1
  468. package/lib/widget/html-widget.js +0 -127
  469. package/lib/widget/html-widget.js.map +0 -1
  470. package/lib/widget/index.js +0 -132
  471. package/lib/widget/index.js.map +0 -1
  472. package/lib/widget/meta.js +0 -8
  473. package/lib/widget/meta.js.map +0 -1
  474. package/lib/widget/multi-widget.js +0 -437
  475. package/lib/widget/multi-widget.js.map +0 -1
  476. package/lib/widget/style.js +0 -204
  477. package/lib/widget/style.js.map +0 -1
  478. package/payment-source-widget.d.ts +0 -1
  479. package/payment-source-widget.js +0 -1
  480. package/tslint.json +0 -129
  481. package/typings/globals/jasmine/index.d.ts +0 -576
  482. package/typings/globals/jasmine-ajax/index.d.ts +0 -83
  483. package/typings/globals/jquery/index.d.ts +0 -3759
  484. package/typings/index.d.ts +0 -3
  485. package/vault-display-widget.d.ts +0 -1
  486. package/vault-display-widget.js +0 -1
  487. package/vendors/zipmoney.d.ts +0 -18
  488. package/vendors/zipmoney.js +0 -1
  489. package/widget.d.ts +0 -1
  490. package/widget.js +0 -1
@@ -0,0 +1,609 @@
1
+ ## Wallet Buttons
2
+ You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#wallet-buttons-simple-example)
3
+
4
+ Wallet Buttons allow you to easily integrate different E-Wallets into your checkout.
5
+ Currently supports ApplePay, Google Pay, Google Pay and Apple Pay via Stripe, Flypay and Flypay V2 checkout, Paypal Smart Buttons Checkout and Afterpay.
6
+
7
+ If available in your client environment, you will display a simple button that upon clicking it the user will follow the standard flow for the appropriate Wallet. If not available an event will be raised and no button will be displayed.
8
+
9
+ ## Wallet Buttons simple example
10
+
11
+ ### Container
12
+
13
+ ```html
14
+ <div id="widget"></div>
15
+ ```
16
+
17
+ You must create a container for the Wallet Buttons. Inside this tag, the button will be initialized.
18
+
19
+ Before initializing the button, you must perform a POST request to `charges/wallet` from a secure environment like your server. This call will return a token that is required to load the button and securely complete the payment. You can find the documentation to this call in the PayDock API documentation.
20
+
21
+ ### Initialization
22
+ The following is the minimum required initialization parameters for Apple Pay and Google Pay via Stripe:
23
+ ```javascript
24
+ let button = new paydock.WalletButtons(
25
+ "#widget",
26
+ token,
27
+ {
28
+ amount_label: "Total",
29
+ country: "DE",
30
+ }
31
+ );
32
+ button.load();
33
+ ```
34
+
35
+ ```javascript
36
+ // ES2015 | TypeScript
37
+ import { WalletButtons } from '@paydock/client-sdk';
38
+
39
+ var button = new WalletButtons(
40
+ '#widget',
41
+ token,
42
+ {
43
+ amount_label: 'Total',
44
+ country: 'DE',
45
+ }
46
+ );
47
+ button.load();
48
+ ```
49
+
50
+ Flypay, Flypay V2 and Paypal wallets do not require any meta sent to the wallet, so the following is enough for initialization:
51
+ ```javascript
52
+ let button = new paydock.WalletButtons(
53
+ "#widget",
54
+ token,
55
+ {}
56
+ );
57
+ button.load();
58
+ ```
59
+
60
+ ```javascript
61
+ // ES2015 | TypeScript
62
+ import { WalletButtons } from '@paydock/client-sdk';
63
+
64
+ var button = new WalletButtons(
65
+ '#widget',
66
+ token,
67
+ {}
68
+ );
69
+ button.load();
70
+ ```
71
+
72
+ For Afterpay wallet, the country code is required:
73
+ ```javascript
74
+ let button = new paydock.WalletButtons(
75
+ "#widget",
76
+ token,
77
+ {
78
+ country: "AU",
79
+ }
80
+ );
81
+ button.load();
82
+ ```
83
+
84
+ ```javascript
85
+ // ES2015 | TypeScript
86
+ import { WalletButtons } from '@paydock/client-sdk';
87
+
88
+ var button = new WalletButtons(
89
+ '#widget',
90
+ token,
91
+ {
92
+ country: 'AU',
93
+ }
94
+ );
95
+ button.load();
96
+ ```
97
+
98
+ ### Setting environment
99
+
100
+ Current method can change environment. By default environment = sandbox.
101
+ Bear in mind that you must set an environment before calling `button.load()`.
102
+
103
+ ```javascript
104
+ button.setEnv('sandbox');
105
+ ```
106
+
107
+ ### Full example
108
+
109
+ ```html
110
+ <!DOCTYPE html>
111
+ <html lang="en">
112
+ <head>
113
+ <meta charset="UTF-8">
114
+ <title>Title</title>
115
+ </head>
116
+ <body>
117
+ <h2>Payment using PayDock Wallet Button!</h2>
118
+ <div id="widget"></div>
119
+ </body>
120
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
121
+ <script>
122
+ let button = new paydock.WalletButtons(
123
+ "#widget",
124
+ token,
125
+ {
126
+ amount_label: "Total",
127
+ country: "DE",
128
+ }
129
+ );
130
+ button.load();
131
+ </script>
132
+ </html>
133
+ ```
134
+
135
+ ## Wallet Buttons advanced example
136
+
137
+ ### Checking for button availability
138
+
139
+ If the customer's browser is not supported, or the customer does not have any card added to their Google Pay or Apple Pay wallets, the button will not load. In this case the callback onUnavailable() will be called. You can define the behavior of this function before loading the button.
140
+
141
+ ```javascript
142
+ button.onUnavailable(() => console.log("No wallet buttons available"));
143
+ ```
144
+
145
+ ### Forcibly closing the checkout
146
+
147
+ In some situations you may want to forcibly close the checkout so that your user is back in your checkout screen, fow which you can use this method. Currently supported by Flypay wallet only.
148
+
149
+ ```javascript
150
+ button.close();
151
+ ```
152
+
153
+ ### Performing actions when the wallet button is clicked
154
+
155
+ In some situations you may want to perform some validations or actions when the user clicks on the wallet button, for which you can use this method. Currently supported by Paypal, ApplePay and GooglePay wallets.
156
+
157
+ ```javascript
158
+ button.onClick(() => console.log("Perform actions on button click"));
159
+ ```
160
+
161
+ ### Performing actions when shipping info is updated
162
+
163
+ In Flypay, Paypal, ApplePay via MPGS and GooglePay via MPGS integrations after each shipping info update the `onUpdate(data)` will be called with the selected shipping address information, plus selected shipping method when applicable for Paypal, ApplePay and GooglePay. Merchants should handle this callback, recalculate shipping costs in their server by analyzing the new data, and submit a backend to backend request to `POST charges/:id` with the new total amount and shipping amount (you can find the documentation of this call in the PayDock API documentation).
164
+
165
+ For Paypal integration specifically, if shipping is enabled for the wallet button and different shipping methods were provided in the create wallet charge call, Merchants must ensure that the posted `shipping.amount` to `POST charges/:id` matches the selected shipping option amount (value sent in when initializing the wallet charge). In other words, when providing shipping methods the shipping amount is bound to being one of the provided shipping method amount necessarily. Bear in mind that the total charge amount must include the `shipping.amount`, since it represents the full amount to be charged to the customer.
166
+
167
+ After analyzing the new shipping information, and making the post with the updated charge and shipping amounts if necessary, the `button.update({ success: true/false })` wallet button method needs to be called to resume the interactions with the customer. Not calling this will result in unexpected behavior.
168
+
169
+ ```javascript
170
+ button.onUpdate((data) => {
171
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
172
+ // call `POST charges/:id` to modify charge
173
+ button.update({ success: true });
174
+ });
175
+ ```
176
+
177
+ For ApplePay via MPGS and GooglePay via MPGS integrations, you can also return a new `amount` and new `shipping_options` in case new options are needed based on the updated shipping data. Before the user authorizes the transaction, you receive redacted address information (address_country, address_city, address_state, address_postcode), and this data can be used to recalculate the new amount and new shipping options.
178
+
179
+ ```javascript
180
+ button.onUpdate((data) => {
181
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
182
+ // call `POST charges/:id` to modify charge
183
+ button.update({
184
+ success: true,
185
+ body: {
186
+ amount: 15,
187
+ shipping_options: [
188
+ {
189
+ id: "NEW-FreeShip",
190
+ label: "NEW - Free Shipping",
191
+ detail: "Arrives in 3 to 5 days",
192
+ amount: "0.00"
193
+ },
194
+ {
195
+ id: "NEW-FastShip",
196
+ label: "NEW - Fast Shipping",
197
+ detail: "Arrives in less than 1 day",
198
+ amount: "10.00"
199
+ }
200
+ ]
201
+ }
202
+ });
203
+ });
204
+ ```
205
+
206
+ ### Performing actions after the payment is completed
207
+
208
+ After the payment is completed, the onPaymentSuccessful(data) will be called if the payment was successful. If the payment was not successful, the function onPaymentError(data) will be called. If fraud check is active for the gateway, a fraud body was sent in the wallet charge initialize call and the fraud service left the charge in review, then the onPaymentInReview(data) will be called.
209
+ All three callbacks return relevant data according to each one of the scenarios.
210
+
211
+ Note that these callbacks will not trigger for Afterpay wallet since the payment completion for it is done via Redirect method, and therefore this SDK won't be loaded once the payment is completed at checkout.
212
+
213
+ ```javascript
214
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
215
+ ```
216
+
217
+ ```javascript
218
+ button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
219
+ ```
220
+
221
+ ```javascript
222
+ button.onPaymentError((data) => console.log("The payment was not successful"));
223
+ ```
224
+ ### Events
225
+ The above events can be used in a more generic way via de `on` function, and making use
226
+ of the corresponding event names.
227
+
228
+ ```javascript
229
+ button.on(EVENT.UNAVAILABLE, () => console.log("No wallet buttons available"));
230
+ button.on(EVENT.UPDATE, (data) => console.log("Updating amount via a backend to backend call to POST charges/:id");
231
+ button.on(EVENT.PAYMENT_SUCCESSFUL, (data) => console.log("The payment was successful"));
232
+ button.on(EVENT.PAYMENT_ERROR, (data) => console.log("The payment was not successful"));
233
+ ```
234
+
235
+ This example shows how to use these functions for **Apple and Google Pay via Stripe**:
236
+ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `wallets`)_
237
+ ### Apple and Google Pay via Stripe Full example
238
+
239
+ ```html
240
+ <!DOCTYPE html>
241
+ <html lang="en">
242
+ <head>
243
+ <meta charset="UTF-8">
244
+ <title>Title</title>
245
+ </head>
246
+ <body>
247
+ <h2>Payment using PayDock Wallet Button!</h2>
248
+ <div id="widget"></div>
249
+ </body>
250
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
251
+ <script>
252
+ let button = new paydock.WalletButtons(
253
+ "#widget",
254
+ charge_token,
255
+ {
256
+ amount_label: "Total",
257
+ country: "DE",
258
+ wallets: ["google", "apple"],
259
+ }
260
+ );
261
+ button.setEnv('sandbox');
262
+ button.onUnavailable(() => console.log("No wallet buttons available"));
263
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
264
+ button.onPaymentError((data) => console.log("The payment was not successful"));
265
+ button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
266
+ button.load();
267
+ </script>
268
+ </html>
269
+ ```
270
+
271
+ This example shows how to use these functions for **Paypal Smart Checkout Buttons**:
272
+ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `standalone`, `style`)_
273
+ ### Paypal Smart Checkout Buttons Full example
274
+ ```html
275
+ <!DOCTYPE html>
276
+ <html lang="en">
277
+ <head>
278
+ <meta charset="UTF-8">
279
+ <title>Title</title>
280
+ </head>
281
+ <body>
282
+ <h2>Payment using PayDock Wallet Button!</h2>
283
+ <div id="widget"></div>
284
+ </body>
285
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
286
+ <script>
287
+ let button = new paydock.WalletButtons(
288
+ "#widget",
289
+ charge_token,
290
+ {
291
+ request_shipping: true,
292
+ pay_later: true,
293
+ standalone: false,
294
+ style: {
295
+ layout: 'horizontal',
296
+ color: 'blue',
297
+ shape: 'rect',
298
+ label: 'paypal',
299
+ },
300
+ }
301
+ );
302
+ button.setEnv('sandbox');
303
+ button.onUnavailable(() => console.log("No wallet buttons available"));
304
+ button.onUpdate((data) => {
305
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
306
+ // call `POST charges/:id` to modify charge
307
+ button.update({ success: true });
308
+ });
309
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
310
+ button.onPaymentError((data) => console.log("The payment was not successful"));
311
+ button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
312
+
313
+ // Example 1: Asynchronous onClick handler
314
+ const asyncLogic = async () => {
315
+ // Perform asynchronous logic. Expectation is that a Promise is returned and attached to response via `attachResult`,
316
+ // and resolve or reject of it will dictate how wallet behaves.
317
+ }
318
+
319
+ button.onClick(({ data: { attachResult } }) => {
320
+ // Promise is attached to the result. On Paypal, when promise is resolved, the user Journey will continue.
321
+ // If no promise is attached then the Paypal journey will not depend on the promise being resolved or rejected
322
+ attachResult(asyncLogic());
323
+ });
324
+
325
+ // Example 2: Synchronous onClick handler
326
+ // button.onClick(({ data: { attachResult } }) => {
327
+ // // Perform synchronous logic
328
+ // console.log("Synchronous onClick: Button clicked");
329
+ // // Optionally return a boolean flag to halt the operation
330
+ // attachResult(false);
331
+ // });
332
+
333
+ button.load();
334
+ </script>
335
+ </html>
336
+ ```
337
+
338
+ This example shows how to use these functions for **Flypay v1 Wallet**.
339
+ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_later`, `style`)_
340
+ ### Flypay Full example
341
+ ```html
342
+ <!DOCTYPE html>
343
+ <html lang="en">
344
+ <head>
345
+ <meta charset="UTF-8">
346
+ <title>Title</title>
347
+ </head>
348
+ <body>
349
+ <h2>Payment using PayDock Wallet Button!</h2>
350
+ <div id="widget"></div>
351
+ </body>
352
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
353
+ <script>
354
+ let button = new paydock.WalletButtons(
355
+ "#widget",
356
+ charge_token,
357
+ {
358
+ request_shipping: true
359
+ }
360
+ );
361
+ button.setEnv('sandbox');
362
+ button.onUnavailable(() => console.log("No wallet buttons available"));
363
+ button.onUpdate((data) => {
364
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
365
+ // call `POST charges/:id` to modify charge
366
+ button.update({ success: true });
367
+ });
368
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
369
+ button.onPaymentError((data) => console.log("The payment was not successful"));
370
+ button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
371
+ button.load();
372
+ </script>
373
+ </html>
374
+ ```
375
+
376
+ This example shows how to use these functions for **Flypay v2 Wallet**.
377
+ _(Required `meta` fields: - . Optional `meta` fields: -)_
378
+ ### Flypay V2 Full example
379
+ ```html
380
+ <!DOCTYPE html>
381
+ <html lang="en">
382
+ <head>
383
+ <meta charset="UTF-8">
384
+ <title>Title</title>
385
+ </head>
386
+ <body>
387
+ <h2>Payment using PayDock Wallet Button!</h2>
388
+ <div id="widget"></div>
389
+ </body>
390
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
391
+ <script>
392
+ let button = new paydock.WalletButtons(
393
+ "#widget",
394
+ charge_token,
395
+ {
396
+ access_token: 'TOKEN',
397
+ refresh_token: 'TOKEN',
398
+ },
399
+ );
400
+ button.setEnv('sandbox');
401
+ button.onUnavailable(() => console.log("No wallet buttons available"));
402
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
403
+ button.onPaymentError((data) => console.log("The payment was not successful"));
404
+ button.onAuthTokensChanged((data) => console.log('Authentication tokens changed'));
405
+ button.load();
406
+ </script>
407
+ </html>
408
+ ```
409
+
410
+ This example shows how to use these functions for **ApplePay via MPGS** and **GooglePay via MPGS**:
411
+
412
+ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`)_
413
+ ### ApplePay and GooglePay via MPGS Full example
414
+
415
+ ```html
416
+ <!DOCTYPE html>
417
+ <html lang="en">
418
+ <head>
419
+ <meta charset="UTF-8">
420
+ <title>Title</title>
421
+ </head>
422
+ <body>
423
+ <h2>Payment using PayDock Wallet Button!</h2>
424
+ <div id="widget"></div>
425
+ </body>
426
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
427
+ <script>
428
+ let button = new paydock.WalletButtons(
429
+ "#widget",
430
+ charge_token,
431
+ {
432
+ amount_label: "Total",
433
+ country: 'DE',
434
+ request_shipping: true,
435
+ show_billing_address: true,
436
+ style: {
437
+ google: {
438
+ button_type: 'buy',
439
+ button_size_mode: 'static',
440
+ button_color: 'white',
441
+ },
442
+ apple: {
443
+ button_type: 'buy',
444
+ },
445
+ },
446
+ shipping_options: [
447
+ {
448
+ id: "FreeShip",
449
+ label: "Free Shipping",
450
+ detail: "Arrives in 5 to 7 days",
451
+ amount: "0.00"
452
+ },
453
+ {
454
+ id: "FastShip",
455
+ label: "Fast Shipping",
456
+ detail: "Arrives in 1 day",
457
+ amount: "10.00"
458
+ }
459
+ ]
460
+ }
461
+ );
462
+ button.setEnv('sandbox');
463
+ button.onUnavailable(() => console.log("No wallet buttons available"));
464
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
465
+ button.onPaymentError((data) => console.log("The payment was not successful"));
466
+ button.onClick(() => console.log("On WalletButton Click"));
467
+ button.onUpdate((data) => {
468
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
469
+ // call `POST charges/:id` to modify charge
470
+ button.update({
471
+ success: true,
472
+ body: {
473
+ amount: 15,
474
+ shipping_options: [
475
+ {
476
+ id: "NEW-FreeShip",
477
+ label: "NEW - Free Shipping",
478
+ detail: "Arrives in 3 to 5 days",
479
+ amount: "0.00"
480
+ },
481
+ {
482
+ id: "NEW-FastShip",
483
+ label: "NEW - Fast Shipping",
484
+ detail: "Arrives in less than 1 day",
485
+ amount: "10.00"
486
+ }
487
+ ]
488
+ }
489
+ });
490
+ });
491
+ button.load();
492
+ </script>
493
+ </html>
494
+ ```
495
+
496
+ Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest` with your own values instead of using the default ones. Below you can see an example on how to initialize the `ApplePayPaymentRequest` with the `raw_data_initialization` meta field.
497
+
498
+ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpecification` with your own values instead of using the default ones. Below you can see an example on how to initialize the `PaymentMethodSpecification` with the `raw_data_initialization` meta field.
499
+ ### ApplePay and GooglePay via MPGS Raw data initialization example
500
+
501
+ ```html
502
+ <!DOCTYPE html>
503
+ <html lang="en">
504
+ <head>
505
+ <meta charset="UTF-8">
506
+ <title>Title</title>
507
+ </head>
508
+ <body>
509
+ <h2>Payment using PayDock Wallet Button!</h2>
510
+ <div id="widget"></div>
511
+ </body>
512
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
513
+ <script>
514
+ let button = new paydock.WalletButtons(
515
+ "#widget",
516
+ charge_token,
517
+ {
518
+ raw_data_initialization: {
519
+ apple: {
520
+ countryCode: "AU",
521
+ currencyCode: "AUD",
522
+ merchantCapabilities: ["supports3DS","supportsCredit","supportsDebit"],
523
+ supportedNetworks: ["visa","masterCard","amex","discover"],
524
+ requiredBillingContactFields: ["name","postalAddress"],
525
+ requiredShippingContactFields:["postalAddress","name","phone","email" ],
526
+ total: {
527
+ label: "Total",
528
+ amount: "10",
529
+ type: "final",
530
+ }
531
+ },
532
+ google: {
533
+ type: "CARD",
534
+ parameters: {
535
+ allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
536
+ allowedCardNetworks: [
537
+ "AMEX",
538
+ "DISCOVER",
539
+ "INTERAC",
540
+ "JCB",
541
+ "MASTERCARD",
542
+ "VISA",
543
+ ],
544
+ billingAddressRequired: true,
545
+ },
546
+ },
547
+ },
548
+ amount_label: "Total",
549
+ country: 'DE',
550
+ request_shipping: true,
551
+ show_billing_address: true,
552
+ style: {
553
+ google: {
554
+ button_type: 'buy',
555
+ button_size_mode: 'static',
556
+ button_color: 'white',
557
+ },
558
+ apple: {
559
+ button_type: 'buy',
560
+ },
561
+ },
562
+ shipping_options: [
563
+ {
564
+ id: "FreeShip",
565
+ label: "Free Shipping",
566
+ detail: "Arrives in 5 to 7 days",
567
+ amount: "0.00"
568
+ },
569
+ {
570
+ id: "FastShip",
571
+ label: "Fast Shipping",
572
+ detail: "Arrives in 1 day",
573
+ amount: "10.00"
574
+ }
575
+ ]
576
+ }
577
+ );
578
+ button.setEnv('sandbox');
579
+ button.onUnavailable(() => console.log("No wallet buttons available"));
580
+ button.onPaymentSuccessful((data) => console.log("The payment was successful"));
581
+ button.onPaymentError((data) => console.log("The payment was not successful"));
582
+ button.onUpdate((data) => {
583
+ console.log("Updating amount via a backend to backend call to POST charges/:id");
584
+ // call `POST charges/:id` to modify charge
585
+ button.update({
586
+ success: true,
587
+ body: {
588
+ amount: 15,
589
+ shipping_options: [
590
+ {
591
+ id: "NEW-FreeShip",
592
+ label: "NEW - Free Shipping",
593
+ detail: "Arrives in 3 to 5 days",
594
+ amount: "0.00"
595
+ },
596
+ {
597
+ id: "NEW-FastShip",
598
+ label: "NEW - Fast Shipping",
599
+ detail: "Arrives in less than 1 day",
600
+ amount: "10.00"
601
+ }
602
+ ]
603
+ }
604
+ });
605
+ });
606
+ button.load();
607
+ </script>
608
+ </html>
609
+ ```