@paydock/client-sdk 1.105.1 → 1.105.56-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 (649) hide show
  1. package/README.md +2094 -465
  2. package/bundles/index.cjs +35088 -0
  3. package/bundles/index.cjs.d.ts +4021 -0
  4. package/bundles/index.mjs +35050 -0
  5. package/bundles/index.mjs.d.ts +4021 -0
  6. package/bundles/types/api/api-base.d.ts +54 -0
  7. package/bundles/types/api/api-base.d.ts.map +1 -0
  8. package/{lib → bundles/types}/api/api-charge-internal.d.ts +2 -0
  9. package/bundles/types/api/api-charge-internal.d.ts.map +1 -0
  10. package/{lib → bundles/types}/api/api-charge.d.ts +1 -0
  11. package/bundles/types/api/api-charge.d.ts.map +1 -0
  12. package/bundles/types/api/api-checkout-internal.d.ts +57 -0
  13. package/bundles/types/api/api-checkout-internal.d.ts.map +1 -0
  14. package/bundles/types/api/api-gateway-internal.d.ts +12 -0
  15. package/bundles/types/api/api-gateway-internal.d.ts.map +1 -0
  16. package/{lib → bundles/types}/api/api-internal.d.ts +5 -0
  17. package/bundles/types/api/api-internal.d.ts.map +1 -0
  18. package/{lib → bundles/types}/api/api-service-internal.d.ts +3 -1
  19. package/bundles/types/api/api-service-internal.d.ts.map +1 -0
  20. package/{lib → bundles/types}/api/api.d.ts +1 -0
  21. package/bundles/types/api/api.d.ts.map +1 -0
  22. package/bundles/types/api/index.d.ts +2 -0
  23. package/bundles/types/api/index.d.ts.map +1 -0
  24. package/{lib → bundles/types}/canvas-3ds/canvas-3ds.d.ts +1 -0
  25. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -0
  26. package/{lib → bundles/types}/canvas-3ds/index.d.ts +1 -0
  27. package/bundles/types/canvas-3ds/index.d.ts.map +1 -0
  28. package/{lib → bundles/types}/canvas-3ds/services/gpayments-service.d.ts +4 -3
  29. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -0
  30. package/{lib → bundles/types}/canvas-3ds/services/index.d.ts +1 -0
  31. package/bundles/types/canvas-3ds/services/index.d.ts.map +1 -0
  32. package/{lib → bundles/types}/canvas-3ds/services/standalone3ds-service.d.ts +1 -0
  33. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -0
  34. package/bundles/types/checkout/checkout.d.ts +86 -0
  35. package/bundles/types/checkout/checkout.d.ts.map +1 -0
  36. package/bundles/types/checkout/helpers/instruction-handler.d.ts +23 -0
  37. package/bundles/types/checkout/helpers/instruction-handler.d.ts.map +1 -0
  38. package/bundles/types/checkout/helpers/instruction-module.d.ts +6 -0
  39. package/bundles/types/checkout/helpers/instruction-module.d.ts.map +1 -0
  40. package/bundles/types/checkout/helpers/instruction-module.decorator.d.ts +6 -0
  41. package/bundles/types/checkout/helpers/instruction-module.decorator.d.ts.map +1 -0
  42. package/bundles/types/checkout/helpers/instruction.decorator.d.ts +5 -0
  43. package/bundles/types/checkout/helpers/instruction.decorator.d.ts.map +1 -0
  44. package/bundles/types/checkout/helpers/resource-helper.d.ts +5 -0
  45. package/bundles/types/checkout/helpers/resource-helper.d.ts.map +1 -0
  46. package/bundles/types/checkout/helpers/session-helper.d.ts +5 -0
  47. package/bundles/types/checkout/helpers/session-helper.d.ts.map +1 -0
  48. package/bundles/types/checkout/index.d.ts +2 -0
  49. package/bundles/types/checkout/index.d.ts.map +1 -0
  50. package/bundles/types/checkout/instructions/index.d.ts +3 -0
  51. package/bundles/types/checkout/instructions/index.d.ts.map +1 -0
  52. package/bundles/types/checkout/instructions/v1/index.d.ts +4 -0
  53. package/bundles/types/checkout/instructions/v1/index.d.ts.map +1 -0
  54. package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts +20 -0
  55. package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts.map +1 -0
  56. package/bundles/types/checkout/instructions/v1/instruction.afterpay_wallet_form.show.d.ts +14 -0
  57. package/bundles/types/checkout/instructions/v1/instruction.afterpay_wallet_form.show.d.ts.map +1 -0
  58. package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts +18 -0
  59. package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -0
  60. package/bundles/types/checkout/instructions/v1/instruction.bank_account_form.show.d.ts +15 -0
  61. package/bundles/types/checkout/instructions/v1/instruction.bank_account_form.show.d.ts.map +1 -0
  62. package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts +11 -0
  63. package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -0
  64. package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts +19 -0
  65. package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -0
  66. package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts +19 -0
  67. package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts.map +1 -0
  68. package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts +26 -0
  69. package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -0
  70. package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts +18 -0
  71. package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -0
  72. package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts +18 -0
  73. package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts.map +1 -0
  74. package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts +18 -0
  75. package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts.map +1 -0
  76. package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts +21 -0
  77. package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -0
  78. package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts +19 -0
  79. package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts.map +1 -0
  80. package/bundles/types/checkout/layout-widgets/additionals.d.ts +3 -0
  81. package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -0
  82. package/bundles/types/checkout/layout-widgets/default-variables.enum.d.ts +9 -0
  83. package/bundles/types/checkout/layout-widgets/default-variables.enum.d.ts.map +1 -0
  84. package/bundles/types/checkout/layout-widgets/message.d.ts +34 -0
  85. package/bundles/types/checkout/layout-widgets/message.d.ts.map +1 -0
  86. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts +13 -0
  87. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -0
  88. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +52 -0
  89. package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -0
  90. package/bundles/types/checkout/layout-widgets/payment-template.d.ts +3 -0
  91. package/bundles/types/checkout/layout-widgets/payment-template.d.ts.map +1 -0
  92. package/{lib → bundles/types}/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -0
  93. package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -0
  94. package/{lib → bundles/types}/checkout-button/afterpay/afterpay.runner.d.ts +3 -0
  95. package/bundles/types/checkout-button/afterpay/afterpay.runner.d.ts.map +1 -0
  96. package/{lib → bundles/types}/checkout-button/checkout-button.d.ts +1 -0
  97. package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -0
  98. package/{lib → bundles/types}/checkout-button/checkout-button.interface.d.ts +1 -0
  99. package/bundles/types/checkout-button/checkout-button.interface.d.ts.map +1 -0
  100. package/{lib → bundles/types}/checkout-button/checkout-contextual-handler.d.ts +5 -0
  101. package/bundles/types/checkout-button/checkout-contextual-handler.d.ts.map +1 -0
  102. package/{lib → bundles/types}/checkout-button/index.d.ts +2 -1
  103. package/bundles/types/checkout-button/index.d.ts.map +1 -0
  104. package/{lib → bundles/types}/checkout-button/paypal/paypal-checkout-button.d.ts +1 -0
  105. package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -0
  106. package/{lib → bundles/types}/checkout-button/paypal/paypal.runner.d.ts +1 -0
  107. package/bundles/types/checkout-button/paypal/paypal.runner.d.ts.map +1 -0
  108. package/{lib → bundles/types}/checkout-button/runner/base.runner.d.ts +4 -3
  109. package/bundles/types/checkout-button/runner/base.runner.d.ts.map +1 -0
  110. package/{lib → bundles/types}/checkout-button/runner/contextual.runner.d.ts +4 -2
  111. package/bundles/types/checkout-button/runner/contextual.runner.d.ts.map +1 -0
  112. package/{lib → bundles/types}/checkout-button/runner/index.d.ts +1 -0
  113. package/bundles/types/checkout-button/runner/index.d.ts.map +1 -0
  114. package/{lib → bundles/types}/checkout-button/runner/popup.runner.d.ts +5 -4
  115. package/bundles/types/checkout-button/runner/popup.runner.d.ts.map +1 -0
  116. package/{lib → bundles/types}/checkout-button/runner/redirect.runner.d.ts +2 -1
  117. package/bundles/types/checkout-button/runner/redirect.runner.d.ts.map +1 -0
  118. package/bundles/types/checkout-button/zipmoney/index.d.ts +4 -0
  119. package/bundles/types/checkout-button/zipmoney/index.d.ts.map +1 -0
  120. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -0
  121. package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -0
  122. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +2 -1
  123. package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -0
  124. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +2 -1
  125. package/bundles/types/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts.map +1 -0
  126. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.config.d.ts +1 -0
  127. package/bundles/types/checkout-button/zipmoney/zipmoney.config.d.ts.map +1 -0
  128. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.runner.d.ts +2 -1
  129. package/bundles/types/checkout-button/zipmoney/zipmoney.runner.d.ts.map +1 -0
  130. package/{lib → bundles/types}/checkout-button/zipmoney/zipmoney.types.d.ts +1 -0
  131. package/bundles/types/checkout-button/zipmoney/zipmoney.types.d.ts.map +1 -0
  132. package/{lib → bundles/types}/components/ability-guard.d.ts +1 -0
  133. package/bundles/types/components/ability-guard.d.ts.map +1 -0
  134. package/{lib → bundles/types}/components/background.d.ts +1 -0
  135. package/bundles/types/components/background.d.ts.map +1 -0
  136. package/{lib → bundles/types}/components/container.d.ts +1 -0
  137. package/bundles/types/components/container.d.ts.map +1 -0
  138. package/{lib → bundles/types}/components/dispatcher.d.ts +2 -1
  139. package/bundles/types/components/dispatcher.d.ts.map +1 -0
  140. package/{lib → bundles/types}/components/element-style.d.ts +2 -1
  141. package/bundles/types/components/element-style.d.ts.map +1 -0
  142. package/{lib → bundles/types}/components/flypay-iframe-event.d.ts +1 -0
  143. package/bundles/types/components/flypay-iframe-event.d.ts.map +1 -0
  144. package/{lib/components/form-Interceptor.d.ts → bundles/types/components/form-interceptor.d.ts} +1 -0
  145. package/bundles/types/components/form-interceptor.d.ts.map +1 -0
  146. package/{lib → bundles/types}/components/http-core.d.ts +1 -0
  147. package/bundles/types/components/http-core.d.ts.map +1 -0
  148. package/{lib → bundles/types}/components/iframe-event.d.ts +6 -0
  149. package/bundles/types/components/iframe-event.d.ts.map +1 -0
  150. package/{lib → bundles/types}/components/iframe.d.ts +3 -0
  151. package/bundles/types/components/iframe.d.ts.map +1 -0
  152. package/{lib → bundles/types}/components/link.d.ts +6 -3
  153. package/bundles/types/components/link.d.ts.map +1 -0
  154. package/{lib → bundles/types}/components/loader.d.ts +1 -0
  155. package/bundles/types/components/loader.d.ts.map +1 -0
  156. package/{lib → bundles/types}/components/param.d.ts +16 -9
  157. package/bundles/types/components/param.d.ts.map +1 -0
  158. package/{lib → bundles/types}/components/popup.d.ts +1 -0
  159. package/bundles/types/components/popup.d.ts.map +1 -0
  160. package/{lib → bundles/types}/components/storage-dispatcher.d.ts +1 -0
  161. package/bundles/types/components/storage-dispatcher.d.ts.map +1 -0
  162. package/{lib → bundles/types}/components/trigger.d.ts +1 -0
  163. package/bundles/types/components/trigger.d.ts.map +1 -0
  164. package/{lib → bundles/types}/components/vault-display-iframe-event.d.ts +1 -0
  165. package/bundles/types/components/vault-display-iframe-event.d.ts.map +1 -0
  166. package/{lib → bundles/types}/components/wallet-background.d.ts +3 -1
  167. package/bundles/types/components/wallet-background.d.ts.map +1 -0
  168. package/{lib → bundles/types}/components/wallet-trigger.d.ts +1 -0
  169. package/bundles/types/components/wallet-trigger.d.ts.map +1 -0
  170. package/bundles/types/configs/env/environment.cba.d.ts +29 -0
  171. package/bundles/types/configs/env/environment.cba.d.ts.map +1 -0
  172. package/bundles/types/configs/env/environment.interface.d.ts +12 -0
  173. package/bundles/types/configs/env/environment.interface.d.ts.map +1 -0
  174. package/{lib/configs/env/env.d.ts → bundles/types/configs/env/environment.paydock.d.ts} +5 -8
  175. package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -0
  176. package/bundles/types/configs/env/index.d.ts +3 -0
  177. package/bundles/types/configs/env/index.d.ts.map +1 -0
  178. package/{lib → bundles/types}/configs/sdk.d.ts +3 -2
  179. package/bundles/types/configs/sdk.d.ts.map +1 -0
  180. package/{lib → bundles/types}/constants/validators.d.ts +3 -2
  181. package/bundles/types/constants/validators.d.ts.map +1 -0
  182. package/{lib → bundles/types}/external-checkout/builder.d.ts +1 -0
  183. package/bundles/types/external-checkout/builder.d.ts.map +1 -0
  184. package/{lib → bundles/types}/external-checkout/checker.d.ts +1 -0
  185. package/bundles/types/external-checkout/checker.d.ts.map +1 -0
  186. package/bundles/types/external-checkout/index.d.ts +3 -0
  187. package/bundles/types/external-checkout/index.d.ts.map +1 -0
  188. package/{lib → bundles/types}/helper/access-token.d.ts +2 -0
  189. package/bundles/types/helper/access-token.d.ts.map +1 -0
  190. package/{lib → bundles/types}/helper/browser.d.ts +1 -0
  191. package/bundles/types/helper/browser.d.ts.map +1 -0
  192. package/bundles/types/helper/element-id.d.ts +5 -0
  193. package/bundles/types/helper/element-id.d.ts.map +1 -0
  194. package/{lib → bundles/types}/helper/event-emitter.d.ts +2 -0
  195. package/bundles/types/helper/event-emitter.d.ts.map +1 -0
  196. package/{lib → bundles/types}/helper/event.d.ts +1 -0
  197. package/bundles/types/helper/event.d.ts.map +1 -0
  198. package/{lib → bundles/types}/helper/ms.d.ts +1 -0
  199. package/bundles/types/helper/ms.d.ts.map +1 -0
  200. package/{lib → bundles/types}/helper/object.d.ts +1 -0
  201. package/bundles/types/helper/object.d.ts.map +1 -0
  202. package/bundles/types/helper/spiner.util.d.ts +6 -0
  203. package/bundles/types/helper/spiner.util.d.ts.map +1 -0
  204. package/{lib → bundles/types}/helper/url.d.ts +1 -0
  205. package/bundles/types/helper/url.d.ts.map +1 -0
  206. package/{lib → bundles/types}/helper/uuid.d.ts +1 -0
  207. package/bundles/types/helper/uuid.d.ts.map +1 -0
  208. package/bundles/types/helper/widget-logger.d.ts +9 -0
  209. package/bundles/types/helper/widget-logger.d.ts.map +1 -0
  210. package/bundles/types/index-cba.d.ts +17 -0
  211. package/bundles/types/index-cba.d.ts.map +1 -0
  212. package/bundles/types/index.d.ts +18 -0
  213. package/bundles/types/index.d.ts.map +1 -0
  214. package/{lib → bundles/types}/payment-source/builder.d.ts +1 -0
  215. package/bundles/types/payment-source/builder.d.ts.map +1 -0
  216. package/{lib → bundles/types}/payment-source/index.d.ts +1 -0
  217. package/bundles/types/payment-source/index.d.ts.map +1 -0
  218. package/{lib → bundles/types}/payment-source-widget/html-payment-source-widget.d.ts +1 -0
  219. package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -0
  220. package/{lib → bundles/types}/payment-source-widget/index.d.ts +1 -0
  221. package/bundles/types/payment-source-widget/index.d.ts.map +1 -0
  222. package/{lib → bundles/types}/payment-source-widget/interfaces.d.ts +1 -0
  223. package/bundles/types/payment-source-widget/interfaces.d.ts.map +1 -0
  224. package/{lib → bundles/types}/payment-source-widget/payment-source-widget.d.ts +1 -0
  225. package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -0
  226. package/bundles/types/paypal-data-collector/index.d.ts +23 -0
  227. package/bundles/types/paypal-data-collector/index.d.ts.map +1 -0
  228. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +59 -0
  229. package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -0
  230. package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts +21 -0
  231. package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts.map +1 -0
  232. package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +18 -0
  233. package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -0
  234. package/bundles/types/paypal-save-payment-source/index.d.ts +61 -0
  235. package/bundles/types/paypal-save-payment-source/index.d.ts.map +1 -0
  236. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts +86 -0
  237. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts.map +1 -0
  238. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts +84 -0
  239. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts.map +1 -0
  240. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts +37 -0
  241. package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts.map +1 -0
  242. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +31 -0
  243. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -0
  244. package/bundles/types/secure-remote-commerce/index.d.ts +104 -0
  245. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -0
  246. package/bundles/types/secure-remote-commerce/interfaces.d.ts +159 -0
  247. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -0
  248. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
  249. package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
  250. package/{lib/secure-remote-commerce/providers/visa-src/visa-src.d.ts → bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts} +5 -7
  251. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
  252. package/{lib → bundles/types}/secure-remote-commerce/providers/src-provider.d.ts +1 -0
  253. package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -0
  254. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +86 -0
  255. package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -0
  256. package/bundles/types/shared/http/http-request.d.ts +14 -0
  257. package/bundles/types/shared/http/http-request.d.ts.map +1 -0
  258. package/bundles/types/shared/http/index.d.ts +2 -0
  259. package/bundles/types/shared/http/index.d.ts.map +1 -0
  260. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +15 -0
  261. package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -0
  262. package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts +66 -0
  263. package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts.map +1 -0
  264. package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +14 -0
  265. package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -0
  266. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts +15 -0
  267. package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -0
  268. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts +23 -0
  269. package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -0
  270. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts +15 -0
  271. package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -0
  272. package/bundles/types/shared/services/instrumentation/repositories/index.d.ts +4 -0
  273. package/bundles/types/shared/services/instrumentation/repositories/index.d.ts.map +1 -0
  274. package/{lib → bundles/types}/vault-display-widget/index.d.ts +1 -0
  275. package/bundles/types/vault-display-widget/index.d.ts.map +1 -0
  276. package/{lib → bundles/types}/vault-display-widget/vault-display-widget.d.ts +1 -0
  277. package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -0
  278. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +6 -0
  279. package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
  280. package/bundles/types/wallet-buttons/index-cba.d.ts +2 -0
  281. package/bundles/types/wallet-buttons/index-cba.d.ts.map +1 -0
  282. package/{lib → bundles/types}/wallet-buttons/index.d.ts +5 -0
  283. package/bundles/types/wallet-buttons/index.d.ts.map +1 -0
  284. package/{lib → bundles/types}/wallet-buttons/interfaces.d.ts +1 -0
  285. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -0
  286. package/{lib → bundles/types}/wallet-buttons/wallet-buttons.d.ts +5 -4
  287. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -0
  288. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +330 -0
  289. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -0
  290. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/afterpay.wallet-service.d.ts +2 -1
  291. package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts.map +1 -0
  292. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/apple.wallet-service.d.ts +4 -3
  293. package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -0
  294. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/flypay-v2.wallet-service.d.ts +5 -5
  295. package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts.map +1 -0
  296. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/flypay.wallet-service.d.ts +7 -6
  297. package/bundles/types/wallet-buttons/wallet-services/flypay.wallet-service.d.ts.map +1 -0
  298. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/google.wallet-service.d.ts +5 -4
  299. package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts.map +1 -0
  300. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/mastercard.wallet-service.d.ts +1 -0
  301. package/bundles/types/wallet-buttons/wallet-services/mastercard.wallet-service.d.ts.map +1 -0
  302. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/paypal.wallet-service.d.ts +2 -1
  303. package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts.map +1 -0
  304. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/stripe.wallet-service.d.ts +2 -1
  305. package/bundles/types/wallet-buttons/wallet-services/stripe.wallet-service.d.ts.map +1 -0
  306. package/{lib/wallet-buttons → bundles/types/wallet-buttons/wallet-services}/wallet-service.d.ts +5 -4
  307. package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -0
  308. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +195 -0
  309. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -0
  310. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts +10 -0
  311. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -0
  312. package/bundles/types/wallet-buttons-express/index.d.ts +131 -0
  313. package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -0
  314. package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts +6 -0
  315. package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts.map +1 -0
  316. package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts +6 -0
  317. package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts.map +1 -0
  318. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +5 -0
  319. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -0
  320. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts +14 -0
  321. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -0
  322. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +6 -0
  323. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -0
  324. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +6 -0
  325. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -0
  326. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +6 -0
  327. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -0
  328. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +9 -0
  329. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -0
  330. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +6 -0
  331. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -0
  332. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +11 -0
  333. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -0
  334. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +6 -0
  335. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -0
  336. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +22 -0
  337. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -0
  338. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts +50 -0
  339. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -0
  340. package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts +3 -0
  341. package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts.map +1 -0
  342. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts +6 -0
  343. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts.map +1 -0
  344. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +17 -0
  345. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -0
  346. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts +2 -0
  347. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts.map +1 -0
  348. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts +2 -0
  349. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts.map +1 -0
  350. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts +4 -0
  351. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts.map +1 -0
  352. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
  353. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -0
  354. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts +47 -0
  355. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -0
  356. package/{lib → bundles/types}/widget/configuration.d.ts +2 -1
  357. package/bundles/types/widget/configuration.d.ts.map +1 -0
  358. package/{lib → bundles/types}/widget/html-multi-widget.d.ts +6 -4
  359. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -0
  360. package/{lib → bundles/types}/widget/html-widget.d.ts +1 -0
  361. package/bundles/types/widget/html-widget.d.ts.map +1 -0
  362. package/{lib → bundles/types}/widget/index.d.ts +2 -1
  363. package/bundles/types/widget/index.d.ts.map +1 -0
  364. package/{lib → bundles/types}/widget/meta.d.ts +1 -0
  365. package/bundles/types/widget/meta.d.ts.map +1 -0
  366. package/{lib → bundles/types}/widget/multi-widget.d.ts +2 -1
  367. package/bundles/types/widget/multi-widget.d.ts.map +1 -0
  368. package/{lib → bundles/types}/widget/style.d.ts +1 -0
  369. package/bundles/types/widget/style.d.ts.map +1 -0
  370. package/bundles/widget.umd.js +33407 -9468
  371. package/bundles/widget.umd.js.d.ts +4021 -0
  372. package/bundles/widget.umd.js.min.d.ts +4021 -0
  373. package/bundles/widget.umd.min.js +61 -1
  374. package/docs/api-canvas3ds.md +158 -0
  375. package/docs/api-checkout-button.md +912 -0
  376. package/docs/api-examples.md +65 -0
  377. package/docs/api-ps-widget.md +585 -0
  378. package/docs/api-vault-display.md +94 -0
  379. package/docs/api-widget.md +2499 -0
  380. package/docs/api-wrapper.md +78 -0
  381. package/docs/canvas3ds-examples.md +242 -0
  382. package/docs/cba-header.md +13 -0
  383. package/docs/cba-license.md +2 -0
  384. package/docs/checkout-examples.md +248 -0
  385. package/docs/click-to-pay-examples.md +267 -0
  386. package/docs/click-to-pay.md +339 -0
  387. package/docs/header.md +15 -0
  388. package/docs/html/layout.html +79 -0
  389. package/docs/html/marked.js +23 -0
  390. package/docs/html/style.css +365 -0
  391. package/docs/install/npm.content.md +16 -0
  392. package/docs/install/npm.example.md +24 -0
  393. package/docs/install/umd.content.md +20 -0
  394. package/docs/install/umd.example.md +6 -0
  395. package/docs/install.md +43 -0
  396. package/docs/install.readme.t.md +17 -0
  397. package/docs/install.slate.t.md +17 -0
  398. package/docs/license.md +2 -0
  399. package/docs/partials/header.hbs +3 -0
  400. package/docs/paypal-data-collector-examples.md +58 -0
  401. package/docs/paypal-data-collector.md +149 -0
  402. package/docs/paypal-save-payment-source-examples.md +63 -0
  403. package/docs/paypal-save-payment-source.md +256 -0
  404. package/docs/ps-examples.md +129 -0
  405. package/docs/vault-display-example.md +132 -0
  406. package/docs/wallet-buttons-examples.md +636 -0
  407. package/docs/wallet-buttons-express-examples.md +201 -0
  408. package/docs/wallet-buttons-express.md +786 -0
  409. package/docs/wallet-buttons.md +622 -0
  410. package/docs/wallet-cba-buttons-examples.md +388 -0
  411. package/docs/widget-examples.md +134 -0
  412. package/examples/multi-html-widget/simple.html +2 -1
  413. package/package.json +208 -80
  414. package/slate.md +227 -191
  415. package/.nvmrc +0 -1
  416. package/api.d.ts +0 -1
  417. package/api.js +0 -1
  418. package/canvas3ds.d.ts +0 -1
  419. package/canvas3ds.js +0 -1
  420. package/checkout-button.d.ts +0 -1
  421. package/checkout-button.js +0 -1
  422. package/inicialization-guide.md +0 -7
  423. package/lib/api/api-base.d.ts +0 -40
  424. package/lib/api/api-base.js +0 -101
  425. package/lib/api/api-base.js.map +0 -1
  426. package/lib/api/api-charge-internal.js +0 -30
  427. package/lib/api/api-charge-internal.js.map +0 -1
  428. package/lib/api/api-charge.js +0 -49
  429. package/lib/api/api-charge.js.map +0 -1
  430. package/lib/api/api-internal.js +0 -13
  431. package/lib/api/api-internal.js.map +0 -1
  432. package/lib/api/api-service-internal.js +0 -18
  433. package/lib/api/api-service-internal.js.map +0 -1
  434. package/lib/api/api.js +0 -62
  435. package/lib/api/api.js.map +0 -1
  436. package/lib/api/index.d.ts +0 -1
  437. package/lib/api/index.js +0 -2
  438. package/lib/api/index.js.map +0 -1
  439. package/lib/canvas-3ds/canvas-3ds.js +0 -157
  440. package/lib/canvas-3ds/canvas-3ds.js.map +0 -1
  441. package/lib/canvas-3ds/index.js +0 -2
  442. package/lib/canvas-3ds/index.js.map +0 -1
  443. package/lib/canvas-3ds/services/gpayments-service.js +0 -181
  444. package/lib/canvas-3ds/services/gpayments-service.js.map +0 -1
  445. package/lib/canvas-3ds/services/index.js +0 -2
  446. package/lib/canvas-3ds/services/index.js.map +0 -1
  447. package/lib/canvas-3ds/services/standalone3ds-service.js +0 -32
  448. package/lib/canvas-3ds/services/standalone3ds-service.js.map +0 -1
  449. package/lib/checkout-button/afterpay/afterpay-checkout-button.js +0 -50
  450. package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +0 -1
  451. package/lib/checkout-button/afterpay/afterpay.runner.js +0 -41
  452. package/lib/checkout-button/afterpay/afterpay.runner.js.map +0 -1
  453. package/lib/checkout-button/checkout-button.interface.js +0 -45
  454. package/lib/checkout-button/checkout-button.interface.js.map +0 -1
  455. package/lib/checkout-button/checkout-button.js +0 -266
  456. package/lib/checkout-button/checkout-button.js.map +0 -1
  457. package/lib/checkout-button/checkout-contextual-handler.js +0 -75
  458. package/lib/checkout-button/checkout-contextual-handler.js.map +0 -1
  459. package/lib/checkout-button/index.js +0 -85
  460. package/lib/checkout-button/index.js.map +0 -1
  461. package/lib/checkout-button/paypal/paypal-checkout-button.js +0 -25
  462. package/lib/checkout-button/paypal/paypal-checkout-button.js.map +0 -1
  463. package/lib/checkout-button/paypal/paypal.runner.js +0 -14
  464. package/lib/checkout-button/paypal/paypal.runner.js.map +0 -1
  465. package/lib/checkout-button/runner/base.runner.js +0 -13
  466. package/lib/checkout-button/runner/base.runner.js.map +0 -1
  467. package/lib/checkout-button/runner/contextual.runner.js +0 -40
  468. package/lib/checkout-button/runner/contextual.runner.js.map +0 -1
  469. package/lib/checkout-button/runner/index.js +0 -11
  470. package/lib/checkout-button/runner/index.js.map +0 -1
  471. package/lib/checkout-button/runner/popup.runner.js +0 -68
  472. package/lib/checkout-button/runner/popup.runner.js.map +0 -1
  473. package/lib/checkout-button/runner/redirect.runner.js +0 -15
  474. package/lib/checkout-button/runner/redirect.runner.js.map +0 -1
  475. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +0 -64
  476. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +0 -1
  477. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +0 -78
  478. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +0 -1
  479. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +0 -49
  480. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +0 -1
  481. package/lib/checkout-button/zipmoney/zipmoney.config.js +0 -4
  482. package/lib/checkout-button/zipmoney/zipmoney.config.js.map +0 -1
  483. package/lib/checkout-button/zipmoney/zipmoney.runner.js +0 -23
  484. package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +0 -1
  485. package/lib/checkout-button/zipmoney/zipmoney.types.js +0 -1
  486. package/lib/checkout-button/zipmoney/zipmoney.types.js.map +0 -1
  487. package/lib/components/ability-guard.js +0 -44
  488. package/lib/components/ability-guard.js.map +0 -1
  489. package/lib/components/background.js +0 -193
  490. package/lib/components/background.js.map +0 -1
  491. package/lib/components/container.js +0 -63
  492. package/lib/components/container.js.map +0 -1
  493. package/lib/components/dispatcher.js +0 -39
  494. package/lib/components/dispatcher.js.map +0 -1
  495. package/lib/components/element-style.js +0 -52
  496. package/lib/components/element-style.js.map +0 -1
  497. package/lib/components/flypay-iframe-event.js +0 -28
  498. package/lib/components/flypay-iframe-event.js.map +0 -1
  499. package/lib/components/form-Interceptor.js +0 -38
  500. package/lib/components/form-Interceptor.js.map +0 -1
  501. package/lib/components/http-core.js +0 -57
  502. package/lib/components/http-core.js.map +0 -1
  503. package/lib/components/iframe-event.js +0 -75
  504. package/lib/components/iframe-event.js.map +0 -1
  505. package/lib/components/iframe.js +0 -62
  506. package/lib/components/iframe.js.map +0 -1
  507. package/lib/components/link.js +0 -59
  508. package/lib/components/link.js.map +0 -1
  509. package/lib/components/loader.js +0 -234
  510. package/lib/components/loader.js.map +0 -1
  511. package/lib/components/param.js +0 -147
  512. package/lib/components/param.js.map +0 -1
  513. package/lib/components/popup.js +0 -104
  514. package/lib/components/popup.js.map +0 -1
  515. package/lib/components/storage-dispatcher.js +0 -75
  516. package/lib/components/storage-dispatcher.js.map +0 -1
  517. package/lib/components/trigger.js +0 -49
  518. package/lib/components/trigger.js.map +0 -1
  519. package/lib/components/vault-display-iframe-event.js +0 -27
  520. package/lib/components/vault-display-iframe-event.js.map +0 -1
  521. package/lib/components/wallet-background.js +0 -63
  522. package/lib/components/wallet-background.js.map +0 -1
  523. package/lib/components/wallet-trigger.js +0 -27
  524. package/lib/components/wallet-trigger.js.map +0 -1
  525. package/lib/configs/env/env.js +0 -117
  526. package/lib/configs/env/env.js.map +0 -1
  527. package/lib/configs/sdk.js +0 -16
  528. package/lib/configs/sdk.js.map +0 -1
  529. package/lib/constants/validators.js +0 -42
  530. package/lib/constants/validators.js.map +0 -1
  531. package/lib/external-checkout/builder.js +0 -45
  532. package/lib/external-checkout/builder.js.map +0 -1
  533. package/lib/external-checkout/checker.js +0 -22
  534. package/lib/external-checkout/checker.js.map +0 -1
  535. package/lib/external-checkout/index.d.ts +0 -2
  536. package/lib/external-checkout/index.js +0 -3
  537. package/lib/external-checkout/index.js.map +0 -1
  538. package/lib/helper/access-token.js +0 -44
  539. package/lib/helper/access-token.js.map +0 -1
  540. package/lib/helper/browser.js +0 -79
  541. package/lib/helper/browser.js.map +0 -1
  542. package/lib/helper/event-emitter.js +0 -23
  543. package/lib/helper/event-emitter.js.map +0 -1
  544. package/lib/helper/event.js +0 -23
  545. package/lib/helper/event.js.map +0 -1
  546. package/lib/helper/ms.js +0 -32
  547. package/lib/helper/ms.js.map +0 -1
  548. package/lib/helper/object.js +0 -6
  549. package/lib/helper/object.js.map +0 -1
  550. package/lib/helper/url.js +0 -11
  551. package/lib/helper/url.js.map +0 -1
  552. package/lib/helper/uuid.js +0 -26
  553. package/lib/helper/uuid.js.map +0 -1
  554. package/lib/index.d.ts +0 -15
  555. package/lib/index.js +0 -15
  556. package/lib/index.js.map +0 -1
  557. package/lib/payment-source/builder.js +0 -49
  558. package/lib/payment-source/builder.js.map +0 -1
  559. package/lib/payment-source/index.js +0 -2
  560. package/lib/payment-source/index.js.map +0 -1
  561. package/lib/payment-source-widget/html-payment-source-widget.js +0 -172
  562. package/lib/payment-source-widget/html-payment-source-widget.js.map +0 -1
  563. package/lib/payment-source-widget/index.js +0 -35
  564. package/lib/payment-source-widget/index.js.map +0 -1
  565. package/lib/payment-source-widget/interfaces.js +0 -2
  566. package/lib/payment-source-widget/interfaces.js.map +0 -1
  567. package/lib/payment-source-widget/payment-source-widget.js +0 -142
  568. package/lib/payment-source-widget/payment-source-widget.js.map +0 -1
  569. package/lib/secure-remote-commerce/index.d.ts +0 -1
  570. package/lib/secure-remote-commerce/index.js +0 -2
  571. package/lib/secure-remote-commerce/index.js.map +0 -1
  572. package/lib/secure-remote-commerce/interfaces.d.ts +0 -71
  573. package/lib/secure-remote-commerce/interfaces.js +0 -28
  574. package/lib/secure-remote-commerce/interfaces.js.map +0 -1
  575. package/lib/secure-remote-commerce/providers/src-provider.js +0 -1
  576. package/lib/secure-remote-commerce/providers/src-provider.js.map +0 -1
  577. package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -7
  578. package/lib/secure-remote-commerce/providers/visa-src/helper.js +0 -36
  579. package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +0 -1
  580. package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +0 -1
  581. package/lib/secure-remote-commerce/providers/visa-src/index.js +0 -2
  582. package/lib/secure-remote-commerce/providers/visa-src/index.js.map +0 -1
  583. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +0 -113
  584. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +0 -1
  585. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -8
  586. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +0 -10
  587. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +0 -1
  588. package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +0 -163
  589. package/lib/secure-remote-commerce/secure-remote-commerce.js +0 -239
  590. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +0 -1
  591. package/lib/vault-display-widget/index.js +0 -14
  592. package/lib/vault-display-widget/index.js.map +0 -1
  593. package/lib/vault-display-widget/vault-display-widget.js +0 -99
  594. package/lib/vault-display-widget/vault-display-widget.js.map +0 -1
  595. package/lib/wallet-buttons/afterpay.wallet-service.js +0 -152
  596. package/lib/wallet-buttons/afterpay.wallet-service.js.map +0 -1
  597. package/lib/wallet-buttons/apple.wallet-service.js +0 -324
  598. package/lib/wallet-buttons/apple.wallet-service.js.map +0 -1
  599. package/lib/wallet-buttons/flypay-v2.wallet-service.js +0 -165
  600. package/lib/wallet-buttons/flypay-v2.wallet-service.js.map +0 -1
  601. package/lib/wallet-buttons/flypay.wallet-service.js +0 -117
  602. package/lib/wallet-buttons/flypay.wallet-service.js.map +0 -1
  603. package/lib/wallet-buttons/google.wallet-service.js +0 -301
  604. package/lib/wallet-buttons/google.wallet-service.js.map +0 -1
  605. package/lib/wallet-buttons/helpers/flypay-v2.helper.d.ts +0 -3
  606. package/lib/wallet-buttons/helpers/flypay-v2.helper.js +0 -151
  607. package/lib/wallet-buttons/helpers/flypay-v2.helper.js.map +0 -1
  608. package/lib/wallet-buttons/index.js +0 -128
  609. package/lib/wallet-buttons/index.js.map +0 -1
  610. package/lib/wallet-buttons/interfaces.js +0 -1
  611. package/lib/wallet-buttons/interfaces.js.map +0 -1
  612. package/lib/wallet-buttons/mastercard.wallet-service.js +0 -27
  613. package/lib/wallet-buttons/mastercard.wallet-service.js.map +0 -1
  614. package/lib/wallet-buttons/paypal.wallet-service.js +0 -144
  615. package/lib/wallet-buttons/paypal.wallet-service.js.map +0 -1
  616. package/lib/wallet-buttons/stripe.wallet-service.js +0 -100
  617. package/lib/wallet-buttons/stripe.wallet-service.js.map +0 -1
  618. package/lib/wallet-buttons/wallet-buttons.js +0 -479
  619. package/lib/wallet-buttons/wallet-buttons.js.map +0 -1
  620. package/lib/wallet-buttons/wallet-service.js +0 -60
  621. package/lib/wallet-buttons/wallet-service.js.map +0 -1
  622. package/lib/widget/configuration.js +0 -260
  623. package/lib/widget/configuration.js.map +0 -1
  624. package/lib/widget/html-multi-widget.js +0 -422
  625. package/lib/widget/html-multi-widget.js.map +0 -1
  626. package/lib/widget/html-widget.js +0 -127
  627. package/lib/widget/html-widget.js.map +0 -1
  628. package/lib/widget/index.js +0 -132
  629. package/lib/widget/index.js.map +0 -1
  630. package/lib/widget/meta.js +0 -8
  631. package/lib/widget/meta.js.map +0 -1
  632. package/lib/widget/multi-widget.js +0 -437
  633. package/lib/widget/multi-widget.js.map +0 -1
  634. package/lib/widget/style.js +0 -204
  635. package/lib/widget/style.js.map +0 -1
  636. package/payment-source-widget.d.ts +0 -1
  637. package/payment-source-widget.js +0 -1
  638. package/tslint.json +0 -129
  639. package/typings/globals/@auspayplus/open-payments-checkout/index.d.ts +0 -43
  640. package/typings/globals/jasmine/index.d.ts +0 -576
  641. package/typings/globals/jasmine-ajax/index.d.ts +0 -83
  642. package/typings/globals/jquery/index.d.ts +0 -3759
  643. package/typings/index.d.ts +0 -4
  644. package/vault-display-widget.d.ts +0 -1
  645. package/vault-display-widget.js +0 -1
  646. package/vendors/zipmoney.d.ts +0 -18
  647. package/vendors/zipmoney.js +0 -2
  648. package/widget.d.ts +0 -1
  649. package/widget.js +0 -1
package/README.md CHANGED
@@ -16,76 +16,78 @@ Also you will need added gateway ([see API Reference by gateway](https://docs.pa
16
16
 
17
17
  ## Get started
18
18
 
19
- ### With package manager
20
-
21
- To install with package manager, enter the following command:
22
-
23
- `npm install @paydock/client-sdk`
24
-
25
-
26
- You can use ES2015 or TypeScript modules
27
-
28
- `@paydock/client-sdk/widget`
29
-
30
-
31
- Also can use UMD module (global visibility, see above)
19
+ The Client SDK ships in JavaScript ES6 (EcmaScript 2015) in three different
20
+ formats (CJS, ESM and UMD) along with respective TypeScript declarations. Below,
21
+ we exemplify how to import each format.
32
22
 
33
- `@paydock/client-sdk/bundles/widget.umd.js`
34
-
35
- `@paydock/client-sdk/bundles/widget.umd.min.js`
23
+ ### With package manager
36
24
 
25
+ Our NPM package is compatible with all package managers (e.g., `npm`, `yarn`,
26
+ `pnpm`, `bun`). Using `npm` the following command would add the Client SDK as a
27
+ production dependency.
37
28
 
29
+ ```bash
30
+ npm install @paydock/client-sdk
31
+ ```
38
32
 
39
- ```javascript--es2015
40
- // ES2015 / TypeScript
33
+ After installation is complete, if you are developing in NodeJS environments or
34
+ using tools that expect your JavaScript code to be in CJS format (e.g., Jest,
35
+ Karma, RequireJS, Webpack), you can import the Client SDK using CommonJS modules.
36
+ For these environments the UMD format (`@paydock/client-sdk/bundles/widget.umd.js`)
37
+ can also be used as a fallback. Alternatively, in case you are developing in
38
+ projects that have access to modern bundlers such as Vite or others (e.g., SPA
39
+ libs or SSR Metaframeworks), you can import the Client SDK features using ESM
40
+ through named imports or namespaced imports.
41
41
 
42
- import { HtmlWidget } from '@paydock/client-sdk/widget';
43
42
 
44
- let widget = new HtmlWidget('#selector', 'publicKey', 'gatewayId');
43
+ ```cjs
44
+ // module import - CommonJS/Node projects ✅
45
+ const paydock = require('@paydock/client-sdk')
46
+ const api = new paydock.Api('publicKey');
45
47
  ```
46
48
 
49
+ ```mjs
50
+ // named import - ESM projects or TypeScript projects ✅
51
+ import { HtmlWidget } from '@paydock/client-sdk'
52
+ const widget = new HtmlWidget('#selector', 'publicKey', 'gatewayId');
53
+ ```
47
54
 
48
- ```html
49
- <script src="@paydock/client-sdk/bundles/widget.umd.min.js"></script>
50
- <script>
51
- var widget = new paydock.HtmlWidget('#tag', 'publicKey', 'gatewayId');
52
- </script>
55
+ ```mjs
56
+ // namespaced import - ESM projects or TypeScript projects ✅
57
+ import * as Paydock from '@paydock/client-sdk'
58
+ const widget = new Paydock.HtmlWidget('#selector', 'publicKey', 'gatewayId');
53
59
  ```
54
60
 
61
+ ```js
62
+ // default import - We do not provide default exports. They are handled differently by different tools!
63
+
64
+ import paydock from '@paydock/client-sdk'
65
+ >>> "Uncaught SyntaxError: The requested module does not provide an export named 'default'"
66
+ ```
55
67
 
56
68
 
57
69
  ### Download from CDN
58
70
 
59
- You should begin by including the library in your page.
60
-
61
- Add this script tag to your page to get started with with the url below:
62
-
63
- *Compressed version for production*
64
- `https://widget.paydock.com/sdk/latest/widget.umd.min.js`
71
+ For browser environments, you can import the Client SDK directly from our CDN to
72
+ your project's HTML. To accomplish this, include the Client SDK in your page
73
+ using one and only of the two script tags below. After this step you will be
74
+ able to access the Client SDK features via the global variable `paydock`.
65
75
 
66
- *Full version for development and debug*
67
- `https://widget.paydock.com/sdk/latest/widget.umd.js`
76
+ For production we recommend using the compressed version (`.min.js`) since
77
+ it will result in faster loading times for your end users.
68
78
 
79
+ - *Compressed version for production: `https://widget.paydock.com/sdk/latest/widget.umd.min.js`*
69
80
 
81
+ - *Full version for development and debug: `https://widget.paydock.com/sdk/latest/widget.umd.js`*
70
82
 
71
-
72
- Also can download library the [production version][min] or the [development version][max]
83
+ You may download the production version of the Client SDK scripts [here][min],
84
+ and, the development version [here][max].
73
85
 
74
86
  [min]: https://widget.paydock.com/sdk/latest/widget.umd.min.js
75
87
  [max]: https://widget.paydock.com/sdk/latest/widget.umd.js
76
88
 
77
-
78
- The library will always be available via the global variable `paydock`.
79
-
80
-
81
-
82
- Also for more advanced use, the library has [UMD](https://github.com/umdjs/umd) format, thus can be used in requireJs, webpack, etc.
83
-
84
-
85
-
86
-
87
-
88
-
89
+ For more advanced use-cases, the library has [UMD](https://github.com/umdjs/umd)
90
+ format that can be used in RequireJS, Webpack, etc.
89
91
 
90
92
 
91
93
  ```html
@@ -95,6 +97,7 @@ Also for more advanced use, the library has [UMD](https://github.com/umdjs/umd)
95
97
  </script>
96
98
  ```
97
99
 
100
+
98
101
  ## Widget
99
102
  You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#widget-simple-example)
100
103
 
@@ -119,11 +122,11 @@ var widget = new paydock.HtmlWidget('#widget', 'publicKey');
119
122
  widget.load();
120
123
  ```
121
124
 
122
- ```javascript--es2015
125
+ ```javascript
123
126
  // ES2015 | TypeScript
124
127
 
125
- import { HtmlWidget } from '@paydock/client-sdk/widget';
126
-
128
+ import { HtmlWidget } from '@paydock/client-sdk';
129
+
127
130
  var widget = new HtmlWidget('#widget', 'publicKey');
128
131
  widget.load();
129
132
  ```
@@ -131,7 +134,7 @@ widget.load();
131
134
  Then write only need 2 lines of code in js to initialize widget
132
135
 
133
136
 
134
- ### Full example
137
+ ### Full example
135
138
 
136
139
  ```html
137
140
  <!DOCTYPE html>
@@ -194,9 +197,9 @@ widget.setFormFields(['phone', 'email']); // add additional fields for form of w
194
197
  widget.setSupportedCardIcons(['mastercard', 'visa']); // add icons of supported card types
195
198
  ```
196
199
 
197
- This example shows how you can use a lot of other methods to settings your form
200
+ This example shows how you can use a lot of other methods to settings your form
198
201
 
199
- ### Full example
202
+ ### Full example
200
203
 
201
204
  ```html
202
205
  <!DOCTYPE html>
@@ -217,12 +220,12 @@ This example shows how you can use a lot of other methods to settings your form
217
220
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
218
221
  <script>
219
222
  var widget = new paydock.HtmlWidget('#widget', 'publicKey', 'gatewayId');
220
-
223
+
221
224
  widget.setSupportedCardIcons(['mastercard', 'visa']);
222
225
  widget.setFormFields(['phone', 'email']);
223
226
  widget.setRefId('custom-ref-id');
224
227
  widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');z
225
-
228
+
226
229
  widget.load();
227
230
  </script>
228
231
  </script>
@@ -648,7 +651,7 @@ Class Widget include method for working on html and include extended by HtmlMult
648
651
  * [.setFormValues(fieldValues)](#user-content-w_MultiWidget+setFormValues)
649
652
  * [.setFormLabels(fieldLabels)](#user-content-w_MultiWidget+setFormLabels)
650
653
  * [.setFormPlaceholders(fieldPlaceholders)](#user-content-w_MultiWidget+setFormPlaceholders)
651
- * [.setIcons()](#user-content-w_MultiWidget+setIcons)
654
+ * ~~[.setIcons()](#user-content-w_MultiWidget+setIcons)~~
652
655
  * [.setHiddenElements(elements)](#user-content-w_MultiWidget+setHiddenElements)
653
656
  * [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
654
657
  * [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
@@ -1213,15 +1216,13 @@ widget.setFormPlaceholders({
1213
1216
  ```
1214
1217
  <a name="w_MultiWidget+setIcons" id="w_MultiWidget+setIcons" href="#user-content-w_MultiWidget+setIcons">&nbsp;</a>
1215
1218
 
1216
- ### htmlWidget.setIcons()
1219
+ ### ~~htmlWidget.setIcons()~~
1220
+ ***Deprecated***
1221
+
1217
1222
  The method to change the widget icons
1218
1223
 
1219
1224
  **Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
1220
1225
  **Overrides**: [<code>setIcons</code>](#user-content-w_MultiWidget+setIcons)
1221
- **Todo**
1222
-
1223
- - [ ] DEPRECATED
1224
-
1225
1226
  <a name="w_MultiWidget+setHiddenElements" id="w_MultiWidget+setHiddenElements" href="#user-content-w_MultiWidget+setHiddenElements">&nbsp;</a>
1226
1227
 
1227
1228
  ### htmlWidget.setHiddenElements(elements)
@@ -1375,7 +1376,7 @@ Class HtmlMultiWidget include method for working with html
1375
1376
  * [.setFormLabels(fieldLabels)](#user-content-w_MultiWidget+setFormLabels)
1376
1377
  * [.setFormPlaceholders(fieldPlaceholders)](#user-content-w_MultiWidget+setFormPlaceholders)
1377
1378
  * [.setFormElements(elements)](#user-content-w_MultiWidget+setFormElements)
1378
- * [.setIcons()](#user-content-w_MultiWidget+setIcons)
1379
+ * ~~[.setIcons()](#user-content-w_MultiWidget+setIcons)~~
1379
1380
  * [.setHiddenElements(elements)](#user-content-w_MultiWidget+setHiddenElements)
1380
1381
  * [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
1381
1382
  * [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
@@ -1841,15 +1842,13 @@ widget.setFormElements([
1841
1842
  ```
1842
1843
  <a name="w_MultiWidget+setIcons" id="w_MultiWidget+setIcons" href="#user-content-w_MultiWidget+setIcons">&nbsp;</a>
1843
1844
 
1844
- ### htmlMultiWidget.setIcons()
1845
+ ### ~~htmlMultiWidget.setIcons()~~
1846
+ ***Deprecated***
1847
+
1845
1848
  The method to change the widget icons
1846
1849
 
1847
1850
  **Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
1848
1851
  **Overrides**: [<code>setIcons</code>](#user-content-w_MultiWidget+setIcons)
1849
- **Todo**
1850
-
1851
- - [ ] DEPRECATED
1852
-
1853
1852
  <a name="w_MultiWidget+setHiddenElements" id="w_MultiWidget+setHiddenElements" href="#user-content-w_MultiWidget+setHiddenElements">&nbsp;</a>
1854
1853
 
1855
1854
  ### htmlMultiWidget.setHiddenElements(elements)
@@ -2162,7 +2161,7 @@ Class MultiWidget include method for for creating iframe url
2162
2161
  * [.setFormLabels(fieldLabels)](#user-content-w_MultiWidget+setFormLabels)
2163
2162
  * [.setFormPlaceholders(fieldPlaceholders)](#user-content-w_MultiWidget+setFormPlaceholders)
2164
2163
  * [.setFormElements(elements)](#user-content-w_MultiWidget+setFormElements)
2165
- * [.setIcons()](#user-content-w_MultiWidget+setIcons)
2164
+ * ~~[.setIcons()](#user-content-w_MultiWidget+setIcons)~~
2166
2165
  * [.setHiddenElements(elements)](#user-content-w_MultiWidget+setHiddenElements)
2167
2166
  * [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
2168
2167
  * [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
@@ -2388,14 +2387,12 @@ widget.setFormElements([
2388
2387
  ```
2389
2388
  <a name="w_MultiWidget+setIcons" id="w_MultiWidget+setIcons" href="#user-content-w_MultiWidget+setIcons">&nbsp;</a>
2390
2389
 
2391
- ### multiWidget.setIcons()
2390
+ ### ~~multiWidget.setIcons()~~
2391
+ ***Deprecated***
2392
+
2392
2393
  The method to change the widget icons
2393
2394
 
2394
2395
  **Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
2395
- **Todo**
2396
-
2397
- - [ ] DEPRECATED
2398
-
2399
2396
  <a name="w_MultiWidget+setHiddenElements" id="w_MultiWidget+setHiddenElements" href="#user-content-w_MultiWidget+setHiddenElements">&nbsp;</a>
2400
2397
 
2401
2398
  ### multiWidget.setHiddenElements(elements)
@@ -2765,10 +2762,10 @@ var list = new paydock.HtmlPaymentSourceWidget('#list', 'publicKey', 'queryToken
2765
2762
  list.load();
2766
2763
  ```
2767
2764
 
2768
- ```javascript--es2015
2765
+ ```javascript
2769
2766
  // ES2015 | TypeScript
2770
2767
 
2771
- import { HtmlPaymentSourceWidget } from '@paydock/client-sdk/payment-source-widget';
2768
+ import { HtmlPaymentSourceWidget } from '@paydock/client-sdk';
2772
2769
 
2773
2770
  var list = new HtmlPaymentSourceWidget('#list', 'publicKey', 'queryToken');
2774
2771
  list.load();
@@ -3481,7 +3478,7 @@ You must create a button to turn it into checkout-button
3481
3478
  var button = new paydock.PaypalCheckoutButton('#button', 'publicKey', 'gatewayId');
3482
3479
  ```
3483
3480
 
3484
- ```javascript--es2015
3481
+ ```javascript
3485
3482
  // ES2015 | TypeScript
3486
3483
 
3487
3484
 
@@ -4624,11 +4621,11 @@ This wrapper helps you to work with paydock api emdpoints
4624
4621
  var browserDetails = await new paydock.Api('publicKey').setEnv('env').getBrowserDetails();
4625
4622
  ```
4626
4623
 
4627
- ```javascript--es2015
4624
+ ```javascript
4628
4625
  // ES2015 | TypeScript
4629
4626
 
4630
- import { Api } from '@paydock/client-sdk/api';
4631
-
4627
+ import { Api } from '@paydock/client-sdk';
4628
+
4632
4629
  var browserDetails = await new paydock.Api('publicKey').setEnv('env').getBrowserDetails();
4633
4630
  ```
4634
4631
 
@@ -4641,11 +4638,11 @@ var response = await new paydock.Api('publicKey').setEnv('env').charge().preAuth
4641
4638
  });
4642
4639
  ```
4643
4640
 
4644
- ```javascript--es2015
4641
+ ```javascript
4645
4642
  // ES2015 | TypeScript
4646
4643
 
4647
- import { Api } from '@paydock/client-sdk/api';
4648
-
4644
+ import { Api } from '@paydock/client-sdk';
4645
+
4649
4646
  var response = await new Api('publicKey').setEnv('env').charge().preAuth({
4650
4647
  amount: 100,
4651
4648
  currency: 'AUD',
@@ -4655,7 +4652,7 @@ var response = await new Api('publicKey').setEnv('env').charge().preAuth({
4655
4652
 
4656
4653
  Then write only need 2 lines of code in js to make request
4657
4654
 
4658
- ### Initialization full example
4655
+ ### Initialization full example
4659
4656
 
4660
4657
  ```html
4661
4658
  <!DOCTYPE html>
@@ -4702,10 +4699,10 @@ var canvas3ds = new paydock.Canvas3ds('#widget', 'token');
4702
4699
  canvas3ds.load();
4703
4700
  ```
4704
4701
 
4705
- ```javascript--es2015
4702
+ ```javascript
4706
4703
  // ES2015 | TypeScript
4707
4704
 
4708
- import { Canvas3ds } from '@paydock/client-sdk/canvas3ds';
4705
+ import { Canvas3ds } from '@paydock/client-sdk';
4709
4706
 
4710
4707
  var list = new Canvas3ds('#widget', 'token');
4711
4708
  list.load();
@@ -4926,7 +4923,7 @@ After you initialized the standalone 3ds charge via `v1/charges/standalone-3ds`
4926
4923
  ## Vault Display Widget
4927
4924
  You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#vault-display-widget)
4928
4925
 
4929
- The vault display form allows viewing card number and CVV. The form can be customised according to your needs.
4926
+ The vault display form allows viewing card number and CVV. The form can be customised according to your needs.
4930
4927
  You can set styles as well as subscribe to widget events that help monitor user’s actions in real time.
4931
4928
 
4932
4929
  ## Vault Display Widget simple example
@@ -4946,18 +4943,18 @@ var widget = new paydock.VaultDisplayWidget('#widget', 'token');
4946
4943
  widget.load();
4947
4944
  ```
4948
4945
 
4949
- ```javascript--es2015
4946
+ ```javascript
4950
4947
  // ES2015 | TypeScript
4951
4948
 
4952
- import { VaultDisplayWidget } from '@paydock/client-sdk/vault-display-widget';
4953
-
4949
+ import { VaultDisplayWidget } from '@paydock/client-sdk';
4950
+
4954
4951
  var widget = new VaultDisplayWidget('#widget', 'token');
4955
4952
  widget.load();
4956
4953
  ```
4957
4954
 
4958
4955
  Then write only need 2 lines of code in js to initialize widget
4959
4956
 
4960
- ### Full example
4957
+ ### Full example
4961
4958
 
4962
4959
  ```html
4963
4960
  <!DOCTYPE html>
@@ -4968,9 +4965,9 @@ Then write only need 2 lines of code in js to initialize widget
4968
4965
  <style>iframe {border: 0;width: 100%;height: 300px;}</style>
4969
4966
  </head>
4970
4967
  <body>
4971
-
4968
+
4972
4969
  <div id="widget"></div>
4973
-
4970
+
4974
4971
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
4975
4972
  <script>
4976
4973
  var widget = new paydock.VaultDisplayWidget('#widget', 'token');
@@ -5008,9 +5005,9 @@ widget.setStyles({
5008
5005
  });
5009
5006
  ```
5010
5007
 
5011
- This example shows how you can use a lot of other methods to settings your form
5008
+ This example shows how you can use a lot of other methods to settings your form
5012
5009
 
5013
- ### Full example
5010
+ ### Full example
5014
5011
 
5015
5012
  ```html
5016
5013
  <!DOCTYPE html>
@@ -5021,27 +5018,27 @@ This example shows how you can use a lot of other methods to settings your form
5021
5018
  <style>iframe {border: 0;width: 40%;height: 450px;}</style>
5022
5019
  </head>
5023
5020
  <body>
5024
-
5021
+
5025
5022
  <div id="widget"></div>
5026
-
5023
+
5027
5024
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
5028
5025
  <script>
5029
5026
  var widget = new paydock.VaultDisplayWidget('#widget', 'token');
5030
5027
 
5031
5028
  widget.setEnv('sandbox');
5032
-
5029
+
5033
5030
  widget.on('after_load', function (data) {
5034
5031
  console.log(data);
5035
5032
  });
5036
-
5033
+
5037
5034
  widget.on('cvv_secure_code_requested', function (data) {
5038
5035
  console.log(data);
5039
5036
  });
5040
-
5037
+
5041
5038
  widget.on('card_number_secure_code_requested', function (data) {
5042
5039
  console.log(data);
5043
5040
  });
5044
-
5041
+
5045
5042
  widget.setStyles({
5046
5043
  background_color: 'rgb(0, 0, 0)',
5047
5044
  border_color: 'yellow',
@@ -5185,7 +5182,7 @@ let button = new paydock.WalletButtons(
5185
5182
  button.load();
5186
5183
  ```
5187
5184
 
5188
- ```javascript--es2015
5185
+ ```javascript
5189
5186
  // ES2015 | TypeScript
5190
5187
  import { WalletButtons } from '@paydock/client-sdk';
5191
5188
 
@@ -5200,7 +5197,7 @@ var button = new WalletButtons(
5200
5197
  button.load();
5201
5198
  ```
5202
5199
 
5203
- Flypay, Flypay V2 and Paypal wallets do not require any meta sent to the wallet, so the following is enough for initialization:
5200
+ Flypay and Paypal wallets do not require any meta sent to the wallet, so the following is enough for initialization:
5204
5201
  ```javascript
5205
5202
  let button = new paydock.WalletButtons(
5206
5203
  "#widget",
@@ -5210,7 +5207,7 @@ let button = new paydock.WalletButtons(
5210
5207
  button.load();
5211
5208
  ```
5212
5209
 
5213
- ```javascript--es2015
5210
+ ```javascript
5214
5211
  // ES2015 | TypeScript
5215
5212
  import { WalletButtons } from '@paydock/client-sdk';
5216
5213
 
@@ -5234,7 +5231,7 @@ let button = new paydock.WalletButtons(
5234
5231
  button.load();
5235
5232
  ```
5236
5233
 
5237
- ```javascript--es2015
5234
+ ```javascript
5238
5235
  // ES2015 | TypeScript
5239
5236
  import { WalletButtons } from '@paydock/client-sdk';
5240
5237
 
@@ -5248,6 +5245,32 @@ var button = new WalletButtons(
5248
5245
  button.load();
5249
5246
  ```
5250
5247
 
5248
+ For Flypay v2 wallet, the client_id is required:
5249
+ ```javascript
5250
+ let button = new paydock.WalletButtons(
5251
+ "#widget",
5252
+ token,
5253
+ {
5254
+ client_id: "client_id",
5255
+ }
5256
+ );
5257
+ button.load();
5258
+ ```
5259
+
5260
+ ```javascript
5261
+ // ES2015 | TypeScript
5262
+ import { WalletButtons } from '@paydock/client-sdk';
5263
+
5264
+ var button = new WalletButtons(
5265
+ '#widget',
5266
+ token,
5267
+ {
5268
+ client_id: "client_id",
5269
+ }
5270
+ );
5271
+ button.load();
5272
+ ```
5273
+
5251
5274
  ### Setting environment
5252
5275
 
5253
5276
  Current method can change environment. By default environment = sandbox.
@@ -5548,10 +5571,11 @@ _(Required `meta` fields: - . Optional `meta` fields: -)_
5548
5571
  {
5549
5572
  access_token: 'TOKEN',
5550
5573
  refresh_token: 'TOKEN',
5574
+ client_id: 'CLIENT_ID',
5551
5575
  },
5552
5576
  );
5553
5577
  button.setEnv('sandbox');
5554
- button.onUnavailable(() => console.log("No wallet buttons available"));
5578
+ button.onUnavailable((data) => console.log("No wallet buttons available"));
5555
5579
  button.onPaymentSuccessful((data) => console.log("The payment was successful"));
5556
5580
  button.onPaymentError((data) => console.log("The payment was not successful"));
5557
5581
  button.onAuthTokensChanged((data) => console.log('Authentication tokens changed'));
@@ -5894,6 +5918,8 @@ Interface of data from an unavailable event.
5894
5918
  | Param | Type | Description |
5895
5919
  | --- | --- | --- |
5896
5920
  | [wallet] | <code>string</code> | For gateways with more than one wallet button available (e.g: MPGS with ApplePay and GooglePay). Possible values for wallet are 'apple' or 'google'. |
5921
+ | [type] | <code>string</code> | Event Code. Value can be 'create_order_id_error' on FlypayV2 order creation failure. Optional for [Flypay V2]. N/A for other wallets. |
5922
+ | [error_code] | <code>string</code> | Event Error Code. Value can be any error code return from Paydock's API. Optional for [Flypay V2]. N/A for other wallets. + |
5897
5923
 
5898
5924
  <a name="IWalletUpdateData" id="IWalletUpdateData" href="#IWalletUpdateData">&nbsp;</a>
5899
5925
 
@@ -5933,6 +5959,7 @@ Interface of data used by the wallet checkout and payment proccess.
5933
5959
  | [style.button_type] | <code>object</code> | Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values at https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css. Also select button type for GooglePay (check GooglePayStyles) and Afterpay (check AfterpayStyles). Optional for [ApplePay, GooglePay, Afterpay]. N/A for other wallets. |
5934
5960
  | [style.height] | <code>object</code> | Used to select Afterpay button height. Optional for [Afterpay]. N/A for other wallets. |
5935
5961
  | [wallets] | <code>array</code> | By default if this is not sent or empty, we will try to show either Apple Pay or Google Pay buttons. This can be limited sending the following array in this field: ['apple','google]. Optional for [Stripe, ApplePay, GooglePay]. N/A for other wallets. |
5962
+ | [client_id] | <code>string</code> | Client ID to be used in the provider system. Required for [Flypay V2]. N/A for [FlyPay, GooglePay, ApplePay, PayPal, Afterpay]. |
5936
5963
 
5937
5964
  <a name="IApplePayShippingOption" id="IApplePayShippingOption" href="#IApplePayShippingOption">&nbsp;</a>
5938
5965
 
@@ -6381,53 +6408,36 @@ List of available event's name in the wallet button lifecycle
6381
6408
  | ON_CLICK | <code>string</code> | <code>&quot;onClick&quot;</code> |
6382
6409
 
6383
6410
 
6384
- ## Secure Remote Commerce
6385
- You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
6386
-
6387
- This widget provides you with the ability to easily integrate with SRC providers. Currently Visa SRC is supported.
6411
+ ## Express Wallet Buttons
6388
6412
 
6389
- ## SRC simple example
6390
-
6391
- ### Container
6413
+ Express Wallet Buttons allow to integrate with E-Wallets in an "express" operational mode, allowing to show the respective button in product or cart pages.
6392
6414
 
6415
+ The general flow to use the widgets is:
6416
+ 1. Configure your gateway and connect it using Paydock API or Dashboard.
6417
+ 2. Create a container in your site
6393
6418
  ```html
6394
- <div id="checkoutButton"></div>
6395
- <div id="checkoutIframe"></div>
6419
+ <div id="widget"></div>
6396
6420
  ```
6397
-
6398
- You must create a container for the initial checkout button, and a different one for the checkout iFrame. Inside the first tag the button will be initialized, and inside the second one the iFrame will be loaded once the button is clicked.
6399
-
6400
-
6401
- ### Initialization
6402
- ```javascript
6403
- var src = new paydock.SRC(
6404
- "#checkoutButton",
6405
- "#checkoutIframe",
6406
- "scheme_service_id",
6407
- "paydock_public_key_or_access_token",
6408
- {}, // meta
6421
+ 3. Initialize the specific WalletButtonExpress, providing your Access Token (preferred) or Public Key, plus required and optional meta parameters for the wallet in use. The general format is:
6422
+ ```js
6423
+ new paydock.{Provider}WalletButtonExpress(
6424
+ "#widget",
6425
+ accessTokenOrPublicKey,
6426
+ gatewayId,
6427
+ gatewaySpecificMeta,
6409
6428
  );
6410
- src.load();
6411
6429
  ```
6430
+ 4. (optional) If the screen where the button is rendered allows for cart/amount changes, call `setMeta` method to update the meta information.
6431
+ 5. Handle the `onClick` callback, where you should call your server, initialize the wallet charge via `POST v1/charges/wallet` and return the wallet token.
6432
+ 6. Handle the `onPaymentSuccessful`, `onPaymentError` and `onPaymentInReview` (if fraud is applicable) for payment results.
6412
6433
 
6413
- ```javascript--es2015
6414
- // ES2015 | TypeScript
6415
-
6416
- import { SRC } from '@paydock/client-sdk';
6417
-
6418
- var src = new SRC(
6419
- "#checkoutButton",
6420
- "#checkoutIframe",
6421
- "scheme_service_id",
6422
- "paydock_public_key_or_access_token",
6423
- {}, // meta
6424
- );
6425
- src.load();
6426
- ```
6434
+ ### Supported Providers
6435
+ 1. [Apple Pay](#apple-pay-wallet-button-express)
6436
+ 2. [Paypal](#paypal-wallet-button-express)
6427
6437
 
6428
- *NOTE:* it's highly recommended to use a Paydock Access Token instead of the public key for security reasons. When creating it, you will need to enable the `Secure Remote Commerce` and add a whiteliste for the domain of your checkout screen.
6438
+ ### Apple Pay Wallet Button Express
6429
6439
 
6430
- ### Full example
6440
+ A full description of the meta parameters for [ApplePayWalletButtonExpress](#ApplePayWalletButtonExpress) meta parameters can be found [here](#ApplePayWalletMeta). Below you will find a fully working html example.
6431
6441
 
6432
6442
  ```html
6433
6443
  <!DOCTYPE html>
@@ -6435,71 +6445,78 @@ src.load();
6435
6445
  <head>
6436
6446
  <meta charset="UTF-8">
6437
6447
  <title>Title</title>
6438
- <style>iframe {border: 0;width: 40%;height: 300px;}</style>
6439
6448
  </head>
6440
6449
  <body>
6441
- <div id="checkoutButton"></div>
6442
- <div id="checkoutIframe"></div>
6443
- <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
6444
- <script>
6445
- var src = new paydock.SRC(
6446
- "#checkoutButton",
6447
- "#checkoutIframe",
6448
- "scheme_service_id",
6449
- "paydock_public_key_or_access_token",
6450
- {},
6451
- );
6452
- src.load();
6453
- </script>
6450
+ <h2>Payment using PayDock ApplePayWalletButtonExpress!</h2>
6451
+ <div id="widget"></div>
6454
6452
  </body>
6455
- </html>
6456
- ```
6457
-
6458
-
6459
- ## SRC advanced example
6460
-
6461
- ### Settings
6462
-
6463
- ```javascript
6464
-
6465
- src.setEnv('sandbox'); // set enviroment
6453
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
6454
+ <script>
6455
+ let button = new paydock.ApplePayWalletButtonExpress(
6456
+ "#widget",
6457
+ accessTokenOrPublicKey,
6458
+ gatewayId,
6459
+ {
6460
+ amount_label: 'TOTAL',
6461
+ country: 'AU',
6462
+ currency: 'AUD',
6463
+ amount: 15.5,
6464
+ // merchant_capabilities: ['supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit'],
6465
+ // supported_networks: ['visa', 'masterCard', 'amex', 'chinaUnionPay', 'discover', 'interac', 'jcb', 'privateLabel'],
6466
+ // required_billing_contact_fields: ['email', 'name', 'phone', 'postalAddress'], // phone and email do not work according to relevant testing
6467
+ // required_shipping_contact_fields: ['email', 'phone'], // Workaround to pull phone and email from shipping contact instead - does not require additional shipping address information
6468
+ // supported_countries: ["AU"],
6469
+ // style: {
6470
+ // button_type: "buy",
6471
+ // button_style: "black",
6472
+ // },
6473
+ }
6474
+ );
6466
6475
 
6467
- src.hideButton(); // hide button
6476
+ button.setEnv('sandbox');
6468
6477
 
6469
- src.showButton(); // show button
6478
+ button.onUnavailable(function() {
6479
+ console.log("Button not available");
6480
+ });
6470
6481
 
6471
- src.hideCheckout(); // hide checkout iframe
6482
+ button.onError(function(error) {
6483
+ console.log("On Error Callback", error);
6484
+ });
6472
6485
 
6473
- src.showCheckout(); // show checkout iframe
6486
+ button.onPaymentSuccessful(function(data) {
6487
+ console.log("Payment successful");
6488
+ console.log(data);
6489
+ });
6474
6490
 
6475
- src.on('checkoutButtonLoaded', () => {
6476
- console.log("Button loaded");
6477
- });
6491
+ button.onPaymentError(function(err) {
6492
+ console.log("Payment error");
6493
+ console.log(err);
6494
+ });
6478
6495
 
6479
- src.on('checkoutButtonClicked', () => {
6480
- console.log("Button clicked");
6481
- });
6496
+ button.onPaymentInReview(function(data) {
6497
+ console.log("The payment is on fraud review");
6498
+ console.log(data);
6499
+ });
6482
6500
 
6483
- src.on('iframeLoaded', () => {
6484
- console.log("Initial iframe loaded");
6485
- });
6501
+ button.onClick(async (data) => {
6502
+ console.log("Button clicked", data);
6486
6503
 
6487
- src.on('checkoutReady', () => {
6488
- console.log("Checkout ready to be used");
6489
- });
6504
+ const responseData = await fetch('https://your-server-url/initialize-wallet-charge');
6505
+ const parsedData = await responseData.json();
6506
+ return parsedData.resource.data.token;
6507
+ });
6490
6508
 
6491
- src.on('checkoutCompleted', (token) => {
6492
- console.log(token);
6493
- });
6509
+ button.onCheckoutClose(() => {
6510
+ console.log("Checkout closed");
6511
+ });
6494
6512
 
6495
- src.on('checkoutError', (error) => {
6496
- console.log(error);
6497
- });
6513
+ button.load();
6514
+ </script>
6515
+ </html>
6498
6516
  ```
6499
6517
 
6500
- Here you can see how you can use this methods to customize your checkout experience
6501
-
6502
- ### Full example
6518
+ ### Paypal Wallet Button Express
6519
+ A full description of the meta parameters for [PaypalWalletButtonExpress](#PaypalWalletButtonExpress) meta parameters can be found [here](#PaypalWalletMeta). Below you will find a fully working html example.
6503
6520
 
6504
6521
  ```html
6505
6522
  <!DOCTYPE html>
@@ -6507,276 +6524,394 @@ Here you can see how you can use this methods to customize your checkout experie
6507
6524
  <head>
6508
6525
  <meta charset="UTF-8">
6509
6526
  <title>Title</title>
6510
- <style>iframe {border: 0;width: 40%;height: 450px;}</style>
6511
6527
  </head>
6512
6528
  <body>
6513
- <div id="checkoutButton"></div>
6514
- <div id="checkoutIframe"></div>
6515
- <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
6516
- <script>
6517
- var src = new paydock.SRC(
6518
- "#checkoutButton",
6519
- "#checkoutIframe",
6520
- "scheme_service_id",
6521
- "paydock_public_key_or_access_token",
6522
- {},
6523
- );
6524
-
6525
- src.on('checkoutReady', () => {
6526
- console.log("Checkout ready to be used");
6527
- });
6528
-
6529
- src.on('checkoutCompleted', (token) => {
6530
- console.log(token);
6531
- });
6532
- src.load();
6533
- </script>
6529
+ <h2>Payment using PayDock PaypalWalletButtonExpress!</h2>
6530
+ <div id="widget"></div>
6534
6531
  </body>
6535
- </html>
6536
- ```
6532
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
6533
+ <script>
6534
+ let button = new paydock.PaypalWalletButtonExpress(
6535
+ "#widget",
6536
+ accessTokenOrPublicKey,
6537
+ gatewayId,
6538
+ {
6539
+ amount: 15.5,
6540
+ currency: 'AUD',
6541
+ pay_later: false,
6542
+ standalone: false,
6543
+ capture: true,
6544
+ // style: {
6545
+ // layout: 'horizontal', // or 'vertical'
6546
+ // color: 'gold', // or 'blue', 'silver', 'black', 'white'
6547
+ // shape: 'rect', // or 'pill', 'sharp'
6548
+ // borderRadius: 5,
6549
+ // height: 40,
6550
+ // disableMaxWidth: false,
6551
+ // label: 'paypal', // or 'checkout', 'buynow', 'pay', 'installment'
6552
+ // tagline: true,
6553
+ // messages: {
6554
+ // layout: 'text', // or 'flex'
6555
+ // logo: {
6556
+ // type: 'primary', // or 'alternative', 'inline', 'none'
6557
+ // position: 'left', // or 'right', 'top'
6558
+ // },
6559
+ // text: {
6560
+ // color: 'black', // or 'white', 'monochrome', 'grayscale'
6561
+ // size: 10, // or 11, 12, 13, 14, 15, 16
6562
+ // align: 'left', // or 'center', 'right'
6563
+ // },
6564
+ // color: 'blue', // or 'black', 'white', 'white-no-border', 'gray', 'monochrome', 'grayscale'
6565
+ // ratio: '1x1', // or '1x4', '8x1', '20x1'
6566
+ // },
6567
+ // }
6568
+ }
6569
+ );
6537
6570
 
6538
- ## Customization options for address fields
6539
- ### Shipping address:
6571
+ button.setEnv('sandbox');
6540
6572
 
6541
- To customize shipping address experience we use a flag that manages how VisaSRC requires or not shipping address to the customer. Options are NONE (default option), POSTAL_COUNTRY or ALL.
6573
+ button.onUnavailable(function() {
6574
+ console.log("Button not available");
6575
+ });
6542
6576
 
6543
- ```
6544
- var src = new paydock.SRC(
6545
- "#checkoutButton",
6546
- "#checkoutIframe",
6547
- "scheme_service_id",
6548
- "paydock_public_key_or_access_token",
6549
- {
6550
- "dpa_transaction_options": {
6551
- "dpa_shipping_preference": "ALL"
6552
- }
6553
- },
6554
- );
6555
- ```
6577
+ button.onError(function(error) {
6578
+ console.log("On Error Callback", error);
6579
+ });
6556
6580
 
6557
- With this the Visa popup requires the shipping address from consumer, and these information will be stored in the Paydock charge.
6581
+ button.onPaymentSuccessful(function(data) {
6582
+ console.log("Payment successful");
6583
+ console.log(data);
6584
+ });
6558
6585
 
6559
- Another option is at time of creating the charge. Say that you have a different way of collecting the shipping address (outside Paydock checkout), you can then disable the shipping address on our SRC widget and send it when creating the charge creation after getting the One Time Token out of the SRC widget:
6586
+ button.onPaymentError(function(err) {
6587
+ console.log("Payment error");
6588
+ console.log(err);
6589
+ });
6560
6590
 
6561
- ```
6562
- POST v1/charges
6591
+ button.onPaymentInReview(function(data) {
6592
+ console.log("The payment is on fraud review");
6593
+ console.log(data);
6594
+ });
6563
6595
 
6564
- {
6565
- "amount": "10.00",
6566
- "currency": "AUD",
6567
- "token": "token",
6568
- "customer": {
6569
- "payment_source": {
6570
- "gateway_id": "gateway_id"
6571
- }
6572
- },
6573
- "shipping": {
6574
- "address_line1": "address_line1",
6575
- "address_line2": "address_line2",
6576
- "address_line3": "address_line3",
6577
- "address_city": "address_city",
6578
- "address_postcode": "address_postcode",
6579
- "address_state": "address_state",
6580
- "address_country": "address_country"
6581
- }
6582
- }
6583
- ```
6596
+ button.onClick(async (data) => {
6597
+ console.log("Button clicked", data);
6584
6598
 
6585
- - Billing address:
6599
+ const responseData = await fetch('https://your-server-url/initialize-wallet-charge');
6600
+ const parsedData = await responseData.json();
6601
+ return parsedData.resource.data.token;
6602
+ });
6586
6603
 
6587
- Billing address fields are always present on the checkout and required when adding a new credit card (or for new consumer checkout). You can send billing fields on the meta data to pre-fill these fields inside the customer object:
6604
+ button.onCheckoutClose(() => {
6605
+ console.log("Checkout closed");
6606
+ });
6588
6607
 
6608
+ button.load();
6609
+ </script>
6610
+ </html>
6589
6611
  ```
6590
- var src = new paydock.SRC(
6591
- "#checkoutButton",
6592
- "#checkoutIframe",
6593
- "scheme_service_id",
6594
- "paydock_public_key_or_access_token",
6595
- {
6596
- "customer": {
6597
- "email": "test@email.com",
6598
- "first_name": "Name",
6599
- "last_name": "Surname",
6600
- "phone": {
6601
- "country_code": "1",
6602
- "phone": "2124567890"
6603
- },
6604
- "payment_source": {
6605
- "address_line1": "Line 1",
6606
- "address_line2": "Line 2",
6607
- "address_city": "Miami",
6608
- "address_postcode": "33126",
6609
- "address_state": "FL",
6610
- "address_country": "US"
6611
- }
6612
- }
6613
- },
6614
- );
6615
- ```
6616
-
6617
- ## Personalization Styling
6618
6612
 
6619
- To improve the experience in the use of the widget, it is allowed to send props that customize the UI.
6613
+ ## Classes
6620
6614
 
6621
- ### Example code
6622
-
6623
- ```
6624
- var src = new paydock.SRC(
6625
- "#checkoutButton",
6626
- "#checkoutIframe",
6627
- "scheme_service_id",
6628
- "paydock_public_key",
6629
- );
6630
-
6631
- button.setStyles({"primary_color":"#a83232","button_text_color":"#171e9c","font_family":"sans-serif"})
6615
+ <dl>
6616
+ <dt><a href="#ApplePayWalletButtonExpress">ApplePayWalletButtonExpress</a> ⇐ <code>BaseWalletButton</code></dt>
6617
+ <dd><p>Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.</p>
6618
+ </dd>
6619
+ <dt><a href="#PaypalWalletButtonExpress">PaypalWalletButtonExpress</a> ⇐ <code>BaseWalletButton</code></dt>
6620
+ <dd><p>Class PaypalWalletButtonExpress to work with Paypal Wallet.</p>
6621
+ </dd>
6622
+ </dl>
6632
6623
 
6633
- ```
6634
- ## Event and Values
6624
+ ## Constants
6635
6625
 
6636
- | Event Value | Type | Description |
6637
- | ------------------- | ------------------- | -------------------------------------------------------------- |
6638
- | primary_color | <code>string</code> | HEX color for the principal buttons, example : #32a852 |
6639
- | button_text_color | <code>string</code> | HEX color for the text of the buttons, example : #32a852|
6640
- | font_family | <code>string</code> | Look more [mozilla.org/color](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)|
6641
- | card_schemes | <code>[string] - array of string</code> | Possible values "visa", "mastercard", "amex" and "discover" - Default show all logos
6626
+ <dl>
6627
+ <dt><a href="#EVENT">EVENT</a> : <code>object</code></dt>
6628
+ <dd><p>List of available event&#39;s name in the wallet button lifecycle</p>
6629
+ </dd>
6630
+ </dl>
6642
6631
 
6643
- ## Classes
6632
+ ## Typedefs
6644
6633
 
6645
6634
  <dl>
6646
- <dt><a href="#SRC">SRC</a></dt>
6647
- <dd><p>Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC</p>
6635
+ <dt><a href="#OnClickCallback">OnClickCallback</a> ⇒ <code>Promise.&lt;string&gt;</code></dt>
6636
+ <dd><p>Callback for onClick method.</p>
6637
+ </dd>
6638
+ <dt><a href="#OnPaymentSuccessfulCallback">OnPaymentSuccessfulCallback</a> : <code>function</code></dt>
6639
+ <dd><p>Callback for onPaymentSuccessful method.</p>
6640
+ </dd>
6641
+ <dt><a href="#OnPaymentInReviewCallback">OnPaymentInReviewCallback</a> : <code>function</code></dt>
6642
+ <dd><p>Callback for onPaymentInReview method.</p>
6643
+ </dd>
6644
+ <dt><a href="#OnPaymentErrorCallback">OnPaymentErrorCallback</a> : <code>function</code></dt>
6645
+ <dd><p>Callback for onPaymentError method.</p>
6646
+ </dd>
6647
+ <dt><a href="#OnCheckoutCloseCallback">OnCheckoutCloseCallback</a> : <code>function</code></dt>
6648
+ <dd><p>Callback for onCheckoutClose method.</p>
6649
+ </dd>
6650
+ <dt><a href="#OnUnavailableCallback">OnUnavailableCallback</a> : <code>function</code></dt>
6651
+ <dd><p>Callback for onUnavailable method.</p>
6652
+ </dd>
6653
+ <dt><a href="#OnErrorCallback">OnErrorCallback</a> : <code>function</code></dt>
6654
+ <dd><p>Callback for onError method.</p>
6648
6655
  </dd>
6649
6656
  </dl>
6650
6657
 
6651
6658
  ## Interfaces
6652
6659
 
6653
6660
  <dl>
6654
- <dt><a href="#IVisaSRCMeta">IVisaSRCMeta</a> : <code>object</code></dt>
6655
- <dd><p>Interface of data used for the Visa Checkout.</p>
6661
+ <dt><a href="#ApplePayWalletMeta">ApplePayWalletMeta</a> : <code>object</code></dt>
6662
+ <dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.</p>
6663
+ </dd>
6664
+ <dt><a href="#PaypalWalletMeta">PaypalWalletMeta</a> : <code>object</code></dt>
6665
+ <dd><p>Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
6666
+ For in-depth information, please refer to the <a href="https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/">Paypal documentation</a>.</p>
6667
+ </dd>
6668
+ <dt><a href="#OnClickEventData">OnClickEventData</a> : <code>object</code></dt>
6669
+ <dd><p>Interface for OnClickEventData</p>
6670
+ </dd>
6671
+ <dt><a href="#OnCloseEventData">OnCloseEventData</a> : <code>object</code></dt>
6672
+ <dd><p>Interface for OnCloseEventData</p>
6673
+ </dd>
6674
+ <dt><a href="#OnPaymentSuccessfulEventData">OnPaymentSuccessfulEventData</a> : <code>object</code></dt>
6675
+ <dd><p>Interface for OnPaymentSuccessfulEventData. For final secure results, fetch backend to backend data.</p>
6676
+ </dd>
6677
+ <dt><a href="#OnPaymentInReviewEventData">OnPaymentInReviewEventData</a> : <code>object</code></dt>
6678
+ <dd><p>Interface for OnPaymentInReviewEventData. For final secure results, fetch backend to backend data.</p>
6679
+ </dd>
6680
+ <dt><a href="#OnPaymentErrorEventData">OnPaymentErrorEventData</a> : <code>object</code></dt>
6681
+ <dd><p>Interface for OnPaymentErrorEventData. For final secure results, fetch backend to backend data.</p>
6682
+ </dd>
6683
+ <dt><a href="#OnUnavailableEventData">OnUnavailableEventData</a> : <code>object</code></dt>
6684
+ <dd><p>Interface for OnUnavailableEventData</p>
6685
+ </dd>
6686
+ <dt><a href="#OnErrorEventData">OnErrorEventData</a> : <code>object</code></dt>
6687
+ <dd><p>Interface for OnErrorEventData</p>
6656
6688
  </dd>
6657
6689
  </dl>
6658
6690
 
6659
- <a name="IVisaSRCMeta" id="IVisaSRCMeta" href="#IVisaSRCMeta">&nbsp;</a>
6691
+ <a name="ApplePayWalletMeta" id="ApplePayWalletMeta" href="#ApplePayWalletMeta">&nbsp;</a>
6660
6692
 
6661
- ## IVisaSRCMeta : <code>object</code>
6662
- Interface of data used for the Visa Checkout.
6693
+ ## ApplePayWalletMeta : <code>object</code>
6694
+ Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
6663
6695
 
6664
6696
  **Kind**: global interface
6665
6697
 
6666
6698
  | Param | Type | Description |
6667
6699
  | --- | --- | --- |
6668
- | [srci_transaction_id] | <code>string</code> | Used to identify the SRC Id. |
6669
- | [dpa_data] | <code>object</code> | Object where the DPA creation data is stored. |
6670
- | [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented in. |
6671
- | [dpa_data.dpa_uri] | <code>string</code> | Used for indicating the DPA URI. |
6672
- | [dpa_transaction_options] | <code>object</code> | Object that stores options for creating a trasaction with DPA. |
6673
- | [dpa_transaction_options.dpa_locale] | <code>string</code> | DPA’s preferred locale, example en_US. |
6674
- | [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array</code> | Used to indicate list of accepted billing countries for DPA. |
6675
- | [dpa_transaction_options.dpa_accepted_shipping_countries] | <code>Array</code> | Used to indicate list of accepted shipping countries for DPA. |
6676
- | [dpa_transaction_options.dpa_billing_preference] | <code>string</code> | Used for listing the enumeration for billing preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'. |
6677
- | [dpa_transaction_options.dpa_shipping_preference] | <code>string</code> | Used for listing the enumeration for shipping preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'. |
6678
- | [dpa_transaction_options.consumer_name_requested] | <code>boolean</code> | Used to check if the name of the consumer is needed. |
6679
- | [dpa_transaction_options.consumer_email_address_requested] | <code>boolean</code> | Used to check if the email of the consumer is needed. |
6680
- | [dpa_transaction_options.consumer_phone_number_requested] | <code>boolean</code> | Used to check if the phone number of the consumer is needed. |
6681
- | [dpa_transaction_options.payment_options] | <code>object</code> | Object used to check the payment options that are included. |
6682
- | [dpa_transaction_options.payment_options.dpa_dynamic_data_ttl_minutes] | <code>number</code> | The minimum requested validity period for the transaction credentials. |
6683
- | [dpa_transaction_options.payment_options.dynamic_data_type] | <code>string</code> | Used for listing the enumeration for dynamic data types. Options are 'TAVV' and 'DTVV'. |
6684
- | [dpa_transaction_options.payment_options.dpa_pan_requested] | <code>boolean</code> | Used to check if PAN number was requested. |
6685
- | [dpa_transaction_options.review_action] | <code>string</code> | Used for listing the enumeration of review actions. Options are 'pay' and 'continue'. |
6686
- | [dpa_transaction_options.checkout_description] | <code>string</code> | Used for indicating the description of the checkout. |
6687
- | [dpa_transaction_options.transaction_type] | <code>string</code> | Used for listing the enumeration of the type of the transaction. 'PURCHASE', 'BILL_PAYMENT' and 'MONEY_TRANSFER' |
6688
- | [dpa_transaction_options.order_type] | <code>string</code> | Used for listing the enumeration of the type of the order. Options are 'REAUTHORIZATION', 'RECURRING' and 'INSTALLMENT'. |
6689
- | [dpa_transaction_options.transaction_amount] | <code>object</code> | Object used to describe the details of the transaction. |
6690
- | [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Used to indicate the amount of the transaction. |
6691
- | [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Used to indicate the currency code of the transaction. 3 letter ISO code format. |
6692
- | [dpa_transaction_options.merchant_order_id] | <code>string</code> | Used to indicate the merchants order Id. |
6693
- | [dpa_transaction_options.merchant_category_code] | <code>string</code> | Used to indicate the merchants category code. |
6694
- | [dpa_transaction_options.merchant_country_code] | <code>string</code> | Used to indicate the merchants country code. 2 letter ISO code format. |
6695
- | [customer] | <code>object</code> | Object where the customer data is stored to prefill in the checkout. |
6696
- | [customer.email] | <code>string</code> | Customer email. |
6697
- | [customer.first_name] | <code>string</code> | Customer first name. |
6698
- | [customer.last_name] | <code>string</code> | Customer last name. |
6699
- | [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
6700
- | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
6701
- | [customer.phone.phone] | <code>string</code> | Customer phone number. |
6702
- | [customer.payment_source] | <code>object</code> | Object where the customer billing address data is stored. |
6703
- | [customer.payment_source.address_line1] | <code>string</code> | Customer billing address line 1. |
6704
- | [customer.payment_source.address_line2] | <code>string</code> | Customer billing address line 2. |
6705
- | [customer.payment_source.address_city] | <code>string</code> | Customer billing address city. |
6706
- | [customer.payment_source.address_postcode] | <code>string</code> | Customer billing address postcode. |
6707
- | [customer.payment_source.address_state] | <code>string</code> | Customer billing address state code (if applicable for the country, example "FL" for Florida). |
6708
- | [customer.payment_source.address_country] | <code>string</code> | Customer billing address country code (example "US"). |
6700
+ | amount_label | <code>string</code> | Label shown next to the total amount to be paid, used in ApplePay popups. |
6701
+ | country | <code>string</code> | Country of the user in 2 letter ISO code format, required for ApplePay. |
6702
+ | currency | <code>string</code> | Currency of the transaction. ISO 4217 currency code format. |
6703
+ | amount | <code>number</code> | Total transaction amount number. **Note:** this amount will be presented in the payment sheet regardless of amount sent in the Wallet Initialization Backend to Backend call. Use `setMeta` method to keep it up to date. |
6704
+ | [merchant_capabilities] | <code>Array.&lt;(&#x27;supports3DS&#x27;\|&#x27;supportsEMV&#x27;\|&#x27;supportsCredit&#x27;\|&#x27;supportsDebit&#x27;)&gt;</code> | Array of capabilities that the merchant supports, influencing the transaction processing features available. |
6705
+ | [supported_networks] | <code>Array.&lt;(&#x27;visa&#x27;\|&#x27;masterCard&#x27;\|&#x27;amex&#x27;\|&#x27;chinaUnionPay&#x27;\|&#x27;discover&#x27;\|&#x27;interac&#x27;\|&#x27;jcb&#x27;\|&#x27;privateLabel&#x27;)&gt;</code> | List of payment networks supported by the merchant for ApplePay transactions. |
6706
+ | [required_billing_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;name&#x27;\|&#x27;phone&#x27;\|&#x27;postalAddress&#x27;)&gt;</code> | Contact fields required from the user for billing purposes, improving transaction verification and fraud prevention. Phone and email are currently not returned by Apple. |
6707
+ | [required_shipping_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;phone&#x27;)&gt;</code> | Shipping contact fields that are mandatory to complete the transaction. Use email and phone to collect from customer wallet in the abscense of billing one. |
6708
+ | [supported_countries] | <code>Array.&lt;string&gt;</code> | List of countries where ApplePay is supported by the merchant, restricting usage to specified regions. |
6709
+ | [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
6710
+ | [style.button_type] | <code>ApplePayButtonType</code> | Enum type to select the type of ApplePay button (e.g., 'buy', 'donate', etc.), providing user interface customization. |
6711
+ | [style.button_style] | <code>ApplePayButtonStyle</code> | Style applied to the ApplePay button, which can include color and form factor adjustments according to the brand's visual guidelines. |
6712
+
6713
+ <a name="PaypalWalletMeta" id="PaypalWalletMeta" href="#PaypalWalletMeta">&nbsp;</a>
6714
+
6715
+ ## PaypalWalletMeta : <code>object</code>
6716
+ Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
6717
+ For in-depth information, please refer to the [Paypal documentation](https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/).
6718
+
6719
+ **Kind**: global interface
6720
+
6721
+ | Param | Type | Description |
6722
+ | --- | --- | --- |
6723
+ | amount | <code>number</code> | Total amount of the transaction. Represents the money to be charged. |
6724
+ | currency | <code>string</code> | Currency of the transaction in ISO 4217 currency code format. |
6725
+ | [pay_later] | <code>boolean</code> | Flag to enable Pay Later feature of PayPal, allowing Pay in 4. Default false. |
6726
+ | [standalone] | <code>boolean</code> | Flag to specify if the PayPal standalone button should be used. Default false. |
6727
+ | [capture] | <code>boolean</code> | Flag to specify if the transaction amount should be captured immediately or authorized for later capture. Default false. |
6728
+ | [style] | <code>object</code> | Styling configurations for the PayPal widget. |
6729
+ | [style.layout] | <code>&#x27;vertical&#x27;</code> \| <code>&#x27;horizontal&#x27;</code> | Layout orientation of the PayPal button. |
6730
+ | [style.color] | <code>&#x27;gold&#x27;</code> \| <code>&#x27;blue&#x27;</code> \| <code>&#x27;silver&#x27;</code> \| <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> | Color theme of the PayPal button. |
6731
+ | [style.shape] | <code>&#x27;rect&#x27;</code> \| <code>&#x27;pill&#x27;</code> \| <code>&#x27;sharp&#x27;</code> | Shape of the PayPal button. |
6732
+ | [style.borderRadius] | <code>number</code> | Border radius for the button, allowing customization of corner roundness. |
6733
+ | [style.height] | <code>number</code> | Height of the PayPal button, allowing for size customization. |
6734
+ | [style.disableMaxWidth] | <code>boolean</code> | Flag to disable the maximum width constraint of the button. |
6735
+ | [style.label] | <code>&#x27;paypal&#x27;</code> \| <code>&#x27;checkout&#x27;</code> \| <code>&#x27;buynow&#x27;</code> \| <code>&#x27;pay&#x27;</code> \| <code>&#x27;installment&#x27;</code> | Label text displayed on the PayPal button. |
6736
+ | [style.tagline] | <code>boolean</code> | Flag to include or exclude a tagline beneath the button text. |
6737
+ | [style.messages] | <code>object</code> | Messaging options related to the PayPal button to enhance user interaction. |
6738
+ | [style.messages.layout] | <code>&#x27;text&#x27;</code> \| <code>&#x27;flex&#x27;</code> | Layout type for the messages displayed near the PayPal button. |
6739
+ | [style.messages.logo] | <code>object</code> | Configuration for the logo to be displayed with the PayPal button. |
6740
+ | [style.messages.logo.type] | <code>&#x27;primary&#x27;</code> \| <code>&#x27;alternative&#x27;</code> \| <code>&#x27;inline&#x27;</code> \| <code>&#x27;none&#x27;</code> | Type of logo to display. |
6741
+ | [style.messages.logo.position] | <code>&#x27;left&#x27;</code> \| <code>&#x27;right&#x27;</code> \| <code>&#x27;top&#x27;</code> | Position of the logo relative to the button or message. |
6742
+ | [style.messages.text] | <code>object</code> | Text styling within the message component. |
6743
+ | [style.messages.text.color] | <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> \| <code>&#x27;monochrome&#x27;</code> \| <code>&#x27;grayscale&#x27;</code> | Color of the message text. |
6744
+ | [style.messages.text.size] | <code>10</code> \| <code>11</code> \| <code>12</code> \| <code>13</code> \| <code>14</code> \| <code>15</code> \| <code>16</code> | Font size of the message text. |
6745
+ | [style.messages.text.align] | <code>&#x27;left&#x27;</code> \| <code>&#x27;center&#x27;</code> \| <code>&#x27;right&#x27;</code> | Text alignment within the message area. |
6746
+ | [style.messages.color] | <code>&#x27;blue&#x27;</code> \| <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> \| <code>&#x27;white-no-border&#x27;</code> \| <code>&#x27;gray&#x27;</code> \| <code>&#x27;monochrome&#x27;</code> \| <code>&#x27;grayscale&#x27;</code> | Background color of the message area. |
6747
+ | [style.messages.ratio] | <code>&#x27;1x1&#x27;</code> \| <code>&#x27;1x4&#x27;</code> \| <code>&#x27;8x1&#x27;</code> \| <code>&#x27;20x1&#x27;</code> | Aspect ratio of the message area, affecting its layout and display. |
6748
+
6749
+ <a name="OnClickEventData" id="OnClickEventData" href="#OnClickEventData">&nbsp;</a>
6750
+
6751
+ ## OnClickEventData : <code>object</code>
6752
+ Interface for OnClickEventData
6753
+
6754
+ **Kind**: global interface
6755
+
6756
+ | Param | Type | Description |
6757
+ | --- | --- | --- |
6758
+ | event | <code>string</code> | Event Name is 'onClick' |
6759
+
6760
+ <a name="OnCloseEventData" id="OnCloseEventData" href="#OnCloseEventData">&nbsp;</a>
6761
+
6762
+ ## OnCloseEventData : <code>object</code>
6763
+ Interface for OnCloseEventData
6764
+
6765
+ **Kind**: global interface
6766
+
6767
+ | Param | Type | Description |
6768
+ | --- | --- | --- |
6769
+ | event | <code>string</code> | Event Name is 'onCheckoutClose' |
6770
+ | [chargeId] | <code>string</code> | chargeId in case it's already set after onClick event |
6709
6771
 
6710
- <a name="SRC" id="SRC" href="#SRC">&nbsp;</a>
6772
+ <a name="OnPaymentSuccessfulEventData" id="OnPaymentSuccessfulEventData" href="#OnPaymentSuccessfulEventData">&nbsp;</a>
6711
6773
 
6712
- ## SRC
6713
- Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC
6774
+ ## OnPaymentSuccessfulEventData : <code>object</code>
6775
+ Interface for OnPaymentSuccessfulEventData. For final secure results, fetch backend to backend data.
6776
+
6777
+ **Kind**: global interface
6778
+
6779
+ | Param | Type | Description |
6780
+ | --- | --- | --- |
6781
+ | event | <code>string</code> | Event Name is 'paymentSuccessful' |
6782
+ | chargeId | <code>string</code> | chargeId set after onClick event |
6783
+ | data.id | <code>string</code> | Charge ID returned by server |
6784
+ | data.amount | <code>string</code> | Charge amount returned by server |
6785
+ | data.currency | <code>string</code> | Charge currency returned by server |
6786
+ | data.status | <code>string</code> | Charge status returned by server |
6787
+
6788
+ <a name="OnPaymentInReviewEventData" id="OnPaymentInReviewEventData" href="#OnPaymentInReviewEventData">&nbsp;</a>
6789
+
6790
+ ## OnPaymentInReviewEventData : <code>object</code>
6791
+ Interface for OnPaymentInReviewEventData. For final secure results, fetch backend to backend data.
6792
+
6793
+ **Kind**: global interface
6794
+
6795
+ | Param | Type | Description |
6796
+ | --- | --- | --- |
6797
+ | event | <code>string</code> | Event Name is 'paymentInReview' |
6798
+ | chargeId | <code>string</code> | chargeId set after onClick event |
6799
+ | data.id | <code>string</code> | Charge ID returned by server |
6800
+ | data.amount | <code>string</code> | Charge amount returned by server |
6801
+ | data.currency | <code>string</code> | Charge currency returned by server |
6802
+ | data.status | <code>string</code> | Charge status returned by server |
6803
+
6804
+ <a name="OnPaymentErrorEventData" id="OnPaymentErrorEventData" href="#OnPaymentErrorEventData">&nbsp;</a>
6805
+
6806
+ ## OnPaymentErrorEventData : <code>object</code>
6807
+ Interface for OnPaymentErrorEventData. For final secure results, fetch backend to backend data.
6808
+
6809
+ **Kind**: global interface
6810
+
6811
+ | Param | Type | Description |
6812
+ | --- | --- | --- |
6813
+ | event | <code>string</code> | Event Name is 'paymentError' |
6814
+ | chargeId | <code>string</code> | chargeId set after onClick event |
6815
+ | [data.message] | <code>string</code> | Error message |
6816
+ | [data.code] | <code>string</code> | Error code |
6817
+
6818
+ <a name="OnUnavailableEventData" id="OnUnavailableEventData" href="#OnUnavailableEventData">&nbsp;</a>
6819
+
6820
+ ## OnUnavailableEventData : <code>object</code>
6821
+ Interface for OnUnavailableEventData
6822
+
6823
+ **Kind**: global interface
6824
+
6825
+ | Param | Type | Description |
6826
+ | --- | --- | --- |
6827
+ | event | <code>string</code> | Event Name is 'unavailable' |
6828
+
6829
+ <a name="OnErrorEventData" id="OnErrorEventData" href="#OnErrorEventData">&nbsp;</a>
6830
+
6831
+ ## OnErrorEventData : <code>object</code>
6832
+ Interface for OnErrorEventData
6833
+
6834
+ **Kind**: global interface
6835
+
6836
+ | Param | Type | Description |
6837
+ | --- | --- | --- |
6838
+ | event | <code>string</code> | Event Name is 'error' |
6839
+ | [chargeId] | <code>string</code> | chargeId in case it's already set after onClick event |
6840
+ | [data] | <code>Error</code> | Error object if present |
6841
+
6842
+ <a name="ApplePayWalletButtonExpress" id="ApplePayWalletButtonExpress" href="#ApplePayWalletButtonExpress">&nbsp;</a>
6843
+
6844
+ ## ApplePayWalletButtonExpress ⇐ <code>BaseWalletButton</code>
6845
+ Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.
6714
6846
 
6715
6847
  **Kind**: global class
6848
+ **Extends**: <code>BaseWalletButton</code>
6716
6849
 
6717
- * [SRC](#SRC)
6718
- * [new SRC(button_selector, iframe_selector, service_id, public_key_or_access_token, meta)](#new_SRC_new)
6719
- * [.setStyles(fields)](#SRC+setStyles)
6720
- * [.load()](#SRC+load)
6721
- * [.setEnv(env, [alias])](#SRC+setEnv)
6722
- * [.getEnv()](#SRC+getEnv)
6723
- * [.on(eventName, [cb])](#SRC+on) ⇒ <code>Promise.&lt;any&gt;</code> \| <code>void</code>
6724
- * [.hideButton([saveSize])](#SRC+hideButton)
6725
- * [.showButton()](#SRC+showButton)
6726
- * [.hideCheckout([saveSize])](#SRC+hideCheckout)
6727
- * [.showCheckout()](#SRC+showCheckout)
6728
- * [.reload()](#SRC+reload)
6729
- * [.useAutoResize()](#SRC+useAutoResize)
6850
+ * [ApplePayWalletButtonExpress](#ApplePayWalletButtonExpress) ⇐ <code>BaseWalletButton</code>
6851
+ * [new ApplePayWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)](#new_ApplePayWalletButtonExpress_new)
6852
+ * [.load()](#ApplePayWalletButtonExpress+load)
6853
+ * [.setMeta(meta)](#ApplePayWalletButtonExpress+setMeta)
6854
+ * [.setEnv(env, [alias])](#BaseWalletButton+setEnv)
6855
+ * [.onClick(handler)](#BaseWalletButton+onClick)
6856
+ * [.onPaymentSuccessful([handler])](#BaseWalletButton+onPaymentSuccessful)
6857
+ * [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
6858
+ * [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
6859
+ * [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
6860
+ * [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
6861
+ * [.onError(handler)](#BaseWalletButton+onError)
6730
6862
 
6731
- <a name="new_SRC_new" id="new_SRC_new" href="#new_SRC_new">&nbsp;</a>
6863
+ <a name="new_ApplePayWalletButtonExpress_new" id="new_ApplePayWalletButtonExpress_new" href="#new_ApplePayWalletButtonExpress_new">&nbsp;</a>
6732
6864
 
6733
- ### new SRC(button_selector, iframe_selector, service_id, public_key_or_access_token, meta)
6865
+ ### new ApplePayWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)
6734
6866
 
6735
6867
  | Param | Type | Description |
6736
6868
  | --- | --- | --- |
6737
- | button_selector | <code>string</code> | Selector of html element. Container for SRC checkout button. |
6738
- | iframe_selector | <code>string</code> | Selector of html element. Container for SRC checkout iFrame. |
6739
- | service_id | <code>string</code> | Card Scheme Service ID |
6740
- | public_key_or_access_token | <code>string</code> | Paydock public key or Access Token |
6741
- | meta | [<code>IVisaSRCMeta</code>](#IVisaSRCMeta) | Data that configures the SRC checkout |
6869
+ | selector | <code>string</code> | Selector of html element. Container for the ApplePayWalletButtonExpress. |
6870
+ | publicKeyOrAccessToken | <code>string</code> | Public key or Access token for the ApplePayWalletButtonExpress. |
6871
+ | gatewayId | <code>string</code> | Gateway ID for the ApplePayWalletButtonExpress. |
6872
+ | meta | [<code>ApplePayWalletMeta</code>](#ApplePayWalletMeta) | data that configures the Apple Pay Wallet. |
6742
6873
 
6743
6874
  **Example**
6744
6875
  ```js
6745
- var SRC = new SRC('#checkoutButton', '#checkoutIframe', 'service_id', 'public_key', {});
6876
+ var button = new ApplePayWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
6746
6877
  ```
6747
- <a name="SRC+setStyles" id="SRC+setStyles" href="#SRC+setStyles">&nbsp;</a>
6878
+ <a name="ApplePayWalletButtonExpress+load" id="ApplePayWalletButtonExpress+load" href="#ApplePayWalletButtonExpress+load">&nbsp;</a>
6748
6879
 
6749
- ### srC.setStyles(fields)
6750
- Object contain styles for widget - call before `.load()`.
6880
+ ### applePayWalletButtonExpress.load()
6881
+ Initializes the availability checks and inserts the button if possible.
6882
+ Otherwise function onUnavailable(handler: VoidFunction) will be called.
6883
+ **Important**: Is required to invoke this method to render the wallet button.
6884
+
6885
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6886
+ **Example**
6887
+ ```js
6888
+ button.load();
6889
+ ```
6890
+ <a name="ApplePayWalletButtonExpress+setMeta" id="ApplePayWalletButtonExpress+setMeta" href="#ApplePayWalletButtonExpress+setMeta">&nbsp;</a>
6751
6891
 
6752
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6892
+ ### applePayWalletButtonExpress.setMeta(meta)
6893
+ Call this method if updating the originally-provided meta object after order information changed.
6894
+ For example, if the order amount has changed from the time where the button was originally rendered.
6895
+
6896
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6753
6897
 
6754
6898
  | Param | Type | Description |
6755
6899
  | --- | --- | --- |
6756
- | fields | <code>IStyles</code> | name of styles which can be shown in widget [STYLE](STYLE) |
6900
+ | meta | [<code>ApplePayWalletMeta</code>](#ApplePayWalletMeta) | // data that configures the Apple Pay Wallet. |
6757
6901
 
6758
6902
  **Example**
6759
6903
  ```js
6760
- widget.setStyles({
6761
- button_text_color: '#32a852',
6762
- primary_color: '#32a852',
6763
- font_family: 'sans-serif',
6764
- card_schemes: ['visa']
6765
- });
6904
+ button.setMeta(meta);
6766
6905
  ```
6767
- <a name="SRC+load" id="SRC+load" href="#SRC+load">&nbsp;</a>
6768
-
6769
- ### srC.load()
6770
- The final method after configuring the SRC to start the load process of SRC checkout
6771
-
6772
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6773
- <a name="SRC+setEnv" id="SRC+setEnv" href="#SRC+setEnv">&nbsp;</a>
6906
+ <a name="BaseWalletButton+setEnv" id="BaseWalletButton+setEnv" href="#BaseWalletButton+setEnv">&nbsp;</a>
6774
6907
 
6775
- ### srC.setEnv(env, [alias])
6908
+ ### applePayWalletButtonExpress.setEnv(env, [alias])
6776
6909
  Current method can change environment. By default environment = sandbox.
6777
6910
  Also we can change domain alias for this environment. By default domain_alias = paydock.com
6911
+ Bear in mind that you must set an environment before calling `button.load()`.
6778
6912
 
6779
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6913
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6914
+ **Overrides**: [<code>setEnv</code>](#BaseWalletButton+setEnv)
6780
6915
 
6781
6916
  | Param | Type | Description |
6782
6917
  | --- | --- | --- |
@@ -6785,126 +6920,1620 @@ Also we can change domain alias for this environment. By default domain_alias =
6785
6920
 
6786
6921
  **Example**
6787
6922
  ```js
6788
- SRC.setEnv('production');
6923
+ button.setEnv('production', 'paydock.com');
6789
6924
  ```
6790
- <a name="SRC+getEnv" id="SRC+getEnv" href="#SRC+getEnv">&nbsp;</a>
6925
+ <a name="BaseWalletButton+onClick" id="BaseWalletButton+onClick" href="#BaseWalletButton+onClick">&nbsp;</a>
6791
6926
 
6792
- ### srC.getEnv()
6793
- Method to read the current environment
6927
+ ### applePayWalletButtonExpress.onClick(handler)
6928
+ Registers a callback function to be invoked when the wallet button gets clicked.
6929
+ **Note:** is mandatory to handle this event to perform the wallet initialization (and optionally any validation logic).
6930
+ The event handler needs to return the wallet token string in order for the Wallet charge processing to proceed, or throw an error in case of failure or validation errors.
6931
+ **Note:** this callback may be called multiple times as the customer closes the payment checkout and re-clicks the button.
6932
+ It's the merchant's responsibility to handle this situation and evaluate in each case if generating a new WalletCharge Token is required or the previous one can be used in each case, depending on order data and updates.
6933
+ In case a new one needs to be generated, remember it will need to be preceded by a `setMeta` call.
6934
+
6935
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6936
+ **Overrides**: [<code>onClick</code>](#BaseWalletButton+onClick)
6937
+
6938
+ | Param | Type | Description |
6939
+ | --- | --- | --- |
6940
+ | handler | [<code>OnClickCallback</code>](#OnClickCallback) | Function to be called when the wallet button is clicked. |
6794
6941
 
6795
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6796
6942
  **Example**
6797
6943
  ```js
6798
- SRC.getEnv();
6944
+ button.onClick(async (data) => {
6945
+ const responseData = await fetch('https://your-server.com/init-wallet-charge');
6946
+ return responseData.walletToken;
6947
+ });
6799
6948
  ```
6800
- <a name="SRC+on" id="SRC+on" href="#SRC+on">&nbsp;</a>
6949
+ <a name="BaseWalletButton+onPaymentSuccessful" id="BaseWalletButton+onPaymentSuccessful" href="#BaseWalletButton+onPaymentSuccessful">&nbsp;</a>
6801
6950
 
6802
- ### srC.on(eventName, [cb]) ⇒ <code>Promise.&lt;any&gt;</code> \| <code>void</code>
6803
- Listen to events of SRC
6951
+ ### applePayWalletButtonExpress.onPaymentSuccessful([handler])
6952
+ If the payment was successful, the function passed as parameter will be called.
6953
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
6804
6954
 
6805
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6955
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6956
+ **Overrides**: [<code>onPaymentSuccessful</code>](#BaseWalletButton+onPaymentSuccessful)
6806
6957
 
6807
6958
  | Param | Type | Description |
6808
6959
  | --- | --- | --- |
6809
- | eventName | <code>string</code> | Available event names [EVENT](#EVENT) |
6810
- | [cb] | <code>listener</code> | |
6960
+ | [handler] | [<code>OnPaymentSuccessfulCallback</code>](#OnPaymentSuccessfulCallback) | Function to be called when the payment was successful. |
6811
6961
 
6812
6962
  **Example**
6813
6963
  ```js
6814
- SRC.on('checkoutCompleted', function (token) {
6815
- console.log(token);
6964
+ button.onPaymentSuccessful((data) => {
6965
+ console.log('Payment successful!');
6816
6966
  });
6817
- // or
6818
- SRC.on('checkoutCompleted').then(function (token) {
6819
- console.log(token);
6967
+ ```
6968
+ **Example**
6969
+ ```js
6970
+ button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
6971
+ ```
6972
+ <a name="BaseWalletButton+onPaymentInReview" id="BaseWalletButton+onPaymentInReview" href="#BaseWalletButton+onPaymentInReview">&nbsp;</a>
6973
+
6974
+ ### applePayWalletButtonExpress.onPaymentInReview([handler])
6975
+ If the payment was left in fraud review, the function passed as parameter will be called.
6976
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
6977
+
6978
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6979
+ **Overrides**: [<code>onPaymentInReview</code>](#BaseWalletButton+onPaymentInReview)
6980
+
6981
+ | Param | Type | Description |
6982
+ | --- | --- | --- |
6983
+ | [handler] | [<code>OnPaymentInReviewCallback</code>](#OnPaymentInReviewCallback) | Function to be called when the payment was left in fraud review status. |
6984
+
6985
+ **Example**
6986
+ ```js
6987
+ button.onPaymentInReview((data) => {
6988
+ console.log('Payment in fraud review');
6820
6989
  });
6821
6990
  ```
6822
- <a name="SRC+hideButton" id="SRC+hideButton" href="#SRC+hideButton">&nbsp;</a>
6991
+ **Example**
6992
+ ```js
6993
+ button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
6994
+ ```
6995
+ <a name="BaseWalletButton+onPaymentError" id="BaseWalletButton+onPaymentError" href="#BaseWalletButton+onPaymentError">&nbsp;</a>
6823
6996
 
6824
- ### srC.hideButton([saveSize])
6825
- Using this method you can hide button
6997
+ ### applePayWalletButtonExpress.onPaymentError([handler])
6998
+ If the payment was not successful, the function passed as parameter will be called.
6999
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
6826
7000
 
6827
- **Kind**: instance method of [<code>SRC</code>](#SRC)
7001
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7002
+ **Overrides**: [<code>onPaymentError</code>](#BaseWalletButton+onPaymentError)
6828
7003
 
6829
- | Param | Type | Default | Description |
6830
- | --- | --- | --- | --- |
6831
- | [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
7004
+ | Param | Type | Description |
7005
+ | --- | --- | --- |
7006
+ | [handler] | [<code>OnPaymentErrorCallback</code>](#OnPaymentErrorCallback) | Function to be called when the payment was not successful. |
7007
+
7008
+ **Example**
7009
+ ```js
7010
+ button.onPaymentError((err) => {
7011
+ console.log('Payment not successful');
7012
+ });
7013
+ ```
7014
+ **Example**
7015
+ ```js
7016
+ button.onPaymentError().then((err) => console.log('Payment not successful'));
7017
+ ```
7018
+ <a name="BaseWalletButton+onCheckoutClose" id="BaseWalletButton+onCheckoutClose" href="#BaseWalletButton+onCheckoutClose">&nbsp;</a>
7019
+
7020
+ ### applePayWalletButtonExpress.onCheckoutClose(handler)
7021
+ Registers a callback function to be invoked when the wallet checkout closes.
7022
+
7023
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7024
+ **Overrides**: [<code>onCheckoutClose</code>](#BaseWalletButton+onCheckoutClose)
7025
+
7026
+ | Param | Type | Description |
7027
+ | --- | --- | --- |
7028
+ | handler | [<code>OnCheckoutCloseCallback</code>](#OnCheckoutCloseCallback) | Function to be called when the wallet checkout closes. |
6832
7029
 
6833
7030
  **Example**
6834
7031
  ```js
6835
- SRC.hideButton();
7032
+ button.onCheckoutClose(() => {
7033
+ console.log('Wallet checkout closes');
7034
+ });
6836
7035
  ```
6837
- <a name="SRC+showButton" id="SRC+showButton" href="#SRC+showButton">&nbsp;</a>
7036
+ <a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable">&nbsp;</a>
7037
+
7038
+ ### applePayWalletButtonExpress.onUnavailable(handler)
7039
+ Registers a callback function to be invoked when the wallet is not available in the current context.
6838
7040
 
6839
- ### srC.showButton()
6840
- Using this method you can show the SRC button after using hideButton method
7041
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7042
+ **Overrides**: [<code>onUnavailable</code>](#BaseWalletButton+onUnavailable)
7043
+
7044
+ | Param | Type | Description |
7045
+ | --- | --- | --- |
7046
+ | handler | [<code>OnUnavailableCallback</code>](#OnUnavailableCallback) | Function to be called when the wallet is not available in the current context. |
6841
7047
 
6842
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6843
7048
  **Example**
6844
7049
  ```js
6845
- SRC.showButton();
7050
+ button.onUnavailable(() => {
7051
+ console.log('Wallet not available');
7052
+ });
6846
7053
  ```
6847
- <a name="SRC+hideCheckout" id="SRC+hideCheckout" href="#SRC+hideCheckout">&nbsp;</a>
7054
+ <a name="BaseWalletButton+onError" id="BaseWalletButton+onError" href="#BaseWalletButton+onError">&nbsp;</a>
6848
7055
 
6849
- ### srC.hideCheckout([saveSize])
6850
- Using this method you can hide checkout after load and button click
7056
+ ### applePayWalletButtonExpress.onError(handler)
7057
+ Registers a callback function to be invoked when an error that is not related to payment execution occurs.
7058
+ For example, if the amount of the wallet token injected via the `onClick` event handler does not match the amount provided via the initial `meta` or `setMeta` method.
6851
7059
 
6852
- **Kind**: instance method of [<code>SRC</code>](#SRC)
7060
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7061
+ **Overrides**: [<code>onError</code>](#BaseWalletButton+onError)
6853
7062
 
6854
- | Param | Type | Default | Description |
6855
- | --- | --- | --- | --- |
6856
- | [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
7063
+ | Param | Type | Description |
7064
+ | --- | --- | --- |
7065
+ | handler | [<code>OnErrorCallback</code>](#OnErrorCallback) | Function to be called when the WalletButton has an error. |
6857
7066
 
6858
7067
  **Example**
6859
7068
  ```js
6860
- SRC.hideCheckout();
7069
+ button.onError((error) => {
7070
+ console.log('WalletButtonExpress error', error);
7071
+ });
6861
7072
  ```
6862
- <a name="SRC+showCheckout" id="SRC+showCheckout" href="#SRC+showCheckout">&nbsp;</a>
7073
+ <a name="PaypalWalletButtonExpress" id="PaypalWalletButtonExpress" href="#PaypalWalletButtonExpress">&nbsp;</a>
6863
7074
 
6864
- ### srC.showCheckout()
6865
- Using this method you can show checkout after using hideCheckout method
7075
+ ## PaypalWalletButtonExpress ⇐ <code>BaseWalletButton</code>
7076
+ Class PaypalWalletButtonExpress to work with Paypal Wallet.
7077
+
7078
+ **Kind**: global class
7079
+ **Extends**: <code>BaseWalletButton</code>
7080
+
7081
+ * [PaypalWalletButtonExpress](#PaypalWalletButtonExpress) ⇐ <code>BaseWalletButton</code>
7082
+ * [new PaypalWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)](#new_PaypalWalletButtonExpress_new)
7083
+ * [.load()](#PaypalWalletButtonExpress+load)
7084
+ * [.setMeta(meta)](#PaypalWalletButtonExpress+setMeta)
7085
+ * [.setEnv(env, [alias])](#BaseWalletButton+setEnv)
7086
+ * [.onClick(handler)](#BaseWalletButton+onClick)
7087
+ * [.onPaymentSuccessful([handler])](#BaseWalletButton+onPaymentSuccessful)
7088
+ * [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
7089
+ * [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
7090
+ * [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
7091
+ * [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
7092
+ * [.onError(handler)](#BaseWalletButton+onError)
7093
+
7094
+ <a name="new_PaypalWalletButtonExpress_new" id="new_PaypalWalletButtonExpress_new" href="#new_PaypalWalletButtonExpress_new">&nbsp;</a>
7095
+
7096
+ ### new PaypalWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)
7097
+
7098
+ | Param | Type | Description |
7099
+ | --- | --- | --- |
7100
+ | selector | <code>string</code> | Selector of html element. Container for the PaypalWalletButtonExpress. |
7101
+ | publicKeyOrAccessToken | <code>string</code> | Public key or Access token for the PaypalWalletButtonExpress. |
7102
+ | gatewayId | <code>string</code> | Gateway ID for the PaypalWalletButtonExpress. |
7103
+ | meta | [<code>PaypalWalletMeta</code>](#PaypalWalletMeta) | data that configures the Paypal Wallet. |
6866
7104
 
6867
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6868
7105
  **Example**
6869
7106
  ```js
6870
- SRC.showCheckout()
7107
+ var button = new PaypalWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
6871
7108
  ```
6872
- <a name="SRC+reload" id="SRC+reload" href="#SRC+reload">&nbsp;</a>
7109
+ <a name="PaypalWalletButtonExpress+load" id="PaypalWalletButtonExpress+load" href="#PaypalWalletButtonExpress+load">&nbsp;</a>
6873
7110
 
6874
- ### srC.reload()
6875
- Using this method you can reload the whole checkout
7111
+ ### paypalWalletButtonExpress.load()
7112
+ Initializes the availability checks and inserts the button if possible.
7113
+ Otherwise function onUnavailable(handler: VoidFunction) will be called.
7114
+ **Important**: Is required to invoke this method to render the wallet button.
6876
7115
 
6877
- **Kind**: instance method of [<code>SRC</code>](#SRC)
7116
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
6878
7117
  **Example**
6879
7118
  ```js
6880
- SRC.reload()
7119
+ button.load();
6881
7120
  ```
6882
- <a name="SRC+useAutoResize" id="SRC+useAutoResize" href="#SRC+useAutoResize">&nbsp;</a>
7121
+ <a name="PaypalWalletButtonExpress+setMeta" id="PaypalWalletButtonExpress+setMeta" href="#PaypalWalletButtonExpress+setMeta">&nbsp;</a>
6883
7122
 
6884
- ### srC.useAutoResize()
6885
- Use this method for resize checkout iFrame according to content height, if applicable
7123
+ ### paypalWalletButtonExpress.setMeta(meta)
7124
+ Call this method if updating the originally-provided meta object after order information changed.
7125
+ For example, if the order amount has changed from the time where the button was originally rendered.
7126
+
7127
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7128
+
7129
+ | Param | Type | Description |
7130
+ | --- | --- | --- |
7131
+ | meta | [<code>PaypalWalletMeta</code>](#PaypalWalletMeta) | // data that configures the Paypal Wallet. |
6886
7132
 
6887
- **Kind**: instance method of [<code>SRC</code>](#SRC)
6888
7133
  **Example**
6889
7134
  ```js
6890
- SRC.useAutoResize();
7135
+ button.setMeta(meta);
6891
7136
  ```
6892
- <a name="EVENT" id="EVENT" href="#EVENT">&nbsp;</a>
7137
+ <a name="BaseWalletButton+setEnv" id="BaseWalletButton+setEnv" href="#BaseWalletButton+setEnv">&nbsp;</a>
6893
7138
 
6894
- ## EVENT : <code>enum</code>
6895
- List of available event's name in the SRC checkout lifecycle
7139
+ ### paypalWalletButtonExpress.setEnv(env, [alias])
7140
+ Current method can change environment. By default environment = sandbox.
7141
+ Also we can change domain alias for this environment. By default domain_alias = paydock.com
7142
+ Bear in mind that you must set an environment before calling `button.load()`.
6896
7143
 
6897
- **Kind**: global enum
7144
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7145
+ **Overrides**: [<code>setEnv</code>](#BaseWalletButton+setEnv)
6898
7146
 
6899
- | Param | Type | Default |
7147
+ | Param | Type | Description |
6900
7148
  | --- | --- | --- |
6901
- | CHECKOUT_BUTTON_LOADED | <code>string</code> | <code>&quot;checkoutButtonLoaded&quot;</code> |
6902
- | CHECKOUT_BUTTON_CLICKED | <code>string</code> | <code>&quot;checkoutButtonClicked&quot;</code> |
6903
- | IFRAME_LOADED | <code>string</code> | <code>&quot;iframeLoaded&quot;</code> |
6904
- | CHECKOUT_READY | <code>string</code> | <code>&quot;checkoutReady&quot;</code> |
6905
- | CHECKOUT_COMPLETED | <code>string</code> | <code>&quot;checkoutCompleted&quot;</code> |
6906
- | CHECKOUT_ERROR | <code>string</code> | <code>&quot;checkoutError&quot;</code> |
7149
+ | env | <code>string</code> | sandbox, production |
7150
+ | [alias] | <code>string</code> | Own domain alias |
7151
+
7152
+ **Example**
7153
+ ```js
7154
+ button.setEnv('production', 'paydock.com');
7155
+ ```
7156
+ <a name="BaseWalletButton+onClick" id="BaseWalletButton+onClick" href="#BaseWalletButton+onClick">&nbsp;</a>
7157
+
7158
+ ### paypalWalletButtonExpress.onClick(handler)
7159
+ Registers a callback function to be invoked when the wallet button gets clicked.
7160
+ **Note:** is mandatory to handle this event to perform the wallet initialization (and optionally any validation logic).
7161
+ The event handler needs to return the wallet token string in order for the Wallet charge processing to proceed, or throw an error in case of failure or validation errors.
7162
+ **Note:** this callback may be called multiple times as the customer closes the payment checkout and re-clicks the button.
7163
+ It's the merchant's responsibility to handle this situation and evaluate in each case if generating a new WalletCharge Token is required or the previous one can be used in each case, depending on order data and updates.
7164
+ In case a new one needs to be generated, remember it will need to be preceded by a `setMeta` call.
7165
+
7166
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7167
+ **Overrides**: [<code>onClick</code>](#BaseWalletButton+onClick)
7168
+
7169
+ | Param | Type | Description |
7170
+ | --- | --- | --- |
7171
+ | handler | [<code>OnClickCallback</code>](#OnClickCallback) | Function to be called when the wallet button is clicked. |
7172
+
7173
+ **Example**
7174
+ ```js
7175
+ button.onClick(async (data) => {
7176
+ const responseData = await fetch('https://your-server.com/init-wallet-charge');
7177
+ return responseData.walletToken;
7178
+ });
7179
+ ```
7180
+ <a name="BaseWalletButton+onPaymentSuccessful" id="BaseWalletButton+onPaymentSuccessful" href="#BaseWalletButton+onPaymentSuccessful">&nbsp;</a>
7181
+
7182
+ ### paypalWalletButtonExpress.onPaymentSuccessful([handler])
7183
+ If the payment was successful, the function passed as parameter will be called.
7184
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
7185
+
7186
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7187
+ **Overrides**: [<code>onPaymentSuccessful</code>](#BaseWalletButton+onPaymentSuccessful)
7188
+
7189
+ | Param | Type | Description |
7190
+ | --- | --- | --- |
7191
+ | [handler] | [<code>OnPaymentSuccessfulCallback</code>](#OnPaymentSuccessfulCallback) | Function to be called when the payment was successful. |
7192
+
7193
+ **Example**
7194
+ ```js
7195
+ button.onPaymentSuccessful((data) => {
7196
+ console.log('Payment successful!');
7197
+ });
7198
+ ```
7199
+ **Example**
7200
+ ```js
7201
+ button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
7202
+ ```
7203
+ <a name="BaseWalletButton+onPaymentInReview" id="BaseWalletButton+onPaymentInReview" href="#BaseWalletButton+onPaymentInReview">&nbsp;</a>
7204
+
7205
+ ### paypalWalletButtonExpress.onPaymentInReview([handler])
7206
+ If the payment was left in fraud review, the function passed as parameter will be called.
7207
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
7208
+
7209
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7210
+ **Overrides**: [<code>onPaymentInReview</code>](#BaseWalletButton+onPaymentInReview)
7211
+
7212
+ | Param | Type | Description |
7213
+ | --- | --- | --- |
7214
+ | [handler] | [<code>OnPaymentInReviewCallback</code>](#OnPaymentInReviewCallback) | Function to be called when the payment was left in fraud review status. |
7215
+
7216
+ **Example**
7217
+ ```js
7218
+ button.onPaymentInReview((data) => {
7219
+ console.log('Payment in fraud review');
7220
+ });
7221
+ ```
7222
+ **Example**
7223
+ ```js
7224
+ button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
7225
+ ```
7226
+ <a name="BaseWalletButton+onPaymentError" id="BaseWalletButton+onPaymentError" href="#BaseWalletButton+onPaymentError">&nbsp;</a>
7227
+
7228
+ ### paypalWalletButtonExpress.onPaymentError([handler])
7229
+ If the payment was not successful, the function passed as parameter will be called.
7230
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
7231
+
7232
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7233
+ **Overrides**: [<code>onPaymentError</code>](#BaseWalletButton+onPaymentError)
7234
+
7235
+ | Param | Type | Description |
7236
+ | --- | --- | --- |
7237
+ | [handler] | [<code>OnPaymentErrorCallback</code>](#OnPaymentErrorCallback) | Function to be called when the payment was not successful. |
7238
+
7239
+ **Example**
7240
+ ```js
7241
+ button.onPaymentError((err) => {
7242
+ console.log('Payment not successful');
7243
+ });
7244
+ ```
7245
+ **Example**
7246
+ ```js
7247
+ button.onPaymentError().then((err) => console.log('Payment not successful'));
7248
+ ```
7249
+ <a name="BaseWalletButton+onCheckoutClose" id="BaseWalletButton+onCheckoutClose" href="#BaseWalletButton+onCheckoutClose">&nbsp;</a>
7250
+
7251
+ ### paypalWalletButtonExpress.onCheckoutClose(handler)
7252
+ Registers a callback function to be invoked when the wallet checkout closes.
7253
+
7254
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7255
+ **Overrides**: [<code>onCheckoutClose</code>](#BaseWalletButton+onCheckoutClose)
7256
+
7257
+ | Param | Type | Description |
7258
+ | --- | --- | --- |
7259
+ | handler | [<code>OnCheckoutCloseCallback</code>](#OnCheckoutCloseCallback) | Function to be called when the wallet checkout closes. |
7260
+
7261
+ **Example**
7262
+ ```js
7263
+ button.onCheckoutClose(() => {
7264
+ console.log('Wallet checkout closes');
7265
+ });
7266
+ ```
7267
+ <a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable">&nbsp;</a>
7268
+
7269
+ ### paypalWalletButtonExpress.onUnavailable(handler)
7270
+ Registers a callback function to be invoked when the wallet is not available in the current context.
7271
+
7272
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7273
+ **Overrides**: [<code>onUnavailable</code>](#BaseWalletButton+onUnavailable)
7274
+
7275
+ | Param | Type | Description |
7276
+ | --- | --- | --- |
7277
+ | handler | [<code>OnUnavailableCallback</code>](#OnUnavailableCallback) | Function to be called when the wallet is not available in the current context. |
7278
+
7279
+ **Example**
7280
+ ```js
7281
+ button.onUnavailable(() => {
7282
+ console.log('Wallet not available');
7283
+ });
7284
+ ```
7285
+ <a name="BaseWalletButton+onError" id="BaseWalletButton+onError" href="#BaseWalletButton+onError">&nbsp;</a>
7286
+
7287
+ ### paypalWalletButtonExpress.onError(handler)
7288
+ Registers a callback function to be invoked when an error that is not related to payment execution occurs.
7289
+ For example, if the amount of the wallet token injected via the `onClick` event handler does not match the amount provided via the initial `meta` or `setMeta` method.
7290
+
7291
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7292
+ **Overrides**: [<code>onError</code>](#BaseWalletButton+onError)
7293
+
7294
+ | Param | Type | Description |
7295
+ | --- | --- | --- |
7296
+ | handler | [<code>OnErrorCallback</code>](#OnErrorCallback) | Function to be called when the WalletButton has an error. |
7297
+
7298
+ **Example**
7299
+ ```js
7300
+ button.onError((error) => {
7301
+ console.log('WalletButtonExpress error', error);
7302
+ });
7303
+ ```
7304
+ <a name="EVENT" id="EVENT" href="#EVENT">&nbsp;</a>
7305
+
7306
+ ## EVENT : <code>object</code>
7307
+ List of available event's name in the wallet button lifecycle
7308
+
7309
+ **Kind**: global constant
7310
+
7311
+ | Param | Type | Default |
7312
+ | --- | --- | --- |
7313
+ | UNAVAILABLE | <code>string</code> | <code>&quot;unavailable&quot;</code> |
7314
+ | ERROR | <code>string</code> | <code>&quot;error&quot;</code> |
7315
+ | PAYMENT_SUCCESSFUL | <code>string</code> | <code>&quot;paymentSuccessful&quot;</code> |
7316
+ | PAYMENT_ERROR | <code>string</code> | <code>&quot;paymentError&quot;</code> |
7317
+ | PAYMENT_IN_REVIEW | <code>string</code> | <code>&quot;paymentInReview&quot;</code> |
7318
+ | ON_CLICK | <code>string</code> | <code>&quot;onClick&quot;</code> |
7319
+ | ON_CHECKOUT_CLOSE | <code>string</code> | <code>&quot;onCheckoutClose&quot;</code> |
7320
+
7321
+ <a name="OnClickCallback" id="OnClickCallback" href="#OnClickCallback">&nbsp;</a>
7322
+
7323
+ ## OnClickCallback ⇒ <code>Promise.&lt;string&gt;</code>
7324
+ Callback for onClick method.
7325
+
7326
+ **Kind**: global typedef
7327
+ **Returns**: <code>Promise.&lt;string&gt;</code> - walletToken string result
7328
+
7329
+ | Param | Type |
7330
+ | --- | --- |
7331
+ | data | [<code>OnClickEventData</code>](#OnClickEventData) |
7332
+
7333
+ <a name="OnPaymentSuccessfulCallback" id="OnPaymentSuccessfulCallback" href="#OnPaymentSuccessfulCallback">&nbsp;</a>
7334
+
7335
+ ## OnPaymentSuccessfulCallback : <code>function</code>
7336
+ Callback for onPaymentSuccessful method.
7337
+
7338
+ **Kind**: global typedef
7339
+
7340
+ | Param | Type |
7341
+ | --- | --- |
7342
+ | data | [<code>OnPaymentSuccessfulEventData</code>](#OnPaymentSuccessfulEventData) |
7343
+
7344
+ <a name="OnPaymentInReviewCallback" id="OnPaymentInReviewCallback" href="#OnPaymentInReviewCallback">&nbsp;</a>
7345
+
7346
+ ## OnPaymentInReviewCallback : <code>function</code>
7347
+ Callback for onPaymentInReview method.
7348
+
7349
+ **Kind**: global typedef
7350
+
7351
+ | Param | Type |
7352
+ | --- | --- |
7353
+ | data | [<code>OnPaymentInReviewEventData</code>](#OnPaymentInReviewEventData) |
7354
+
7355
+ <a name="OnPaymentErrorCallback" id="OnPaymentErrorCallback" href="#OnPaymentErrorCallback">&nbsp;</a>
7356
+
7357
+ ## OnPaymentErrorCallback : <code>function</code>
7358
+ Callback for onPaymentError method.
7359
+
7360
+ **Kind**: global typedef
7361
+
7362
+ | Param | Type |
7363
+ | --- | --- |
7364
+ | data | [<code>OnPaymentErrorEventData</code>](#OnPaymentErrorEventData) |
7365
+
7366
+ <a name="OnCheckoutCloseCallback" id="OnCheckoutCloseCallback" href="#OnCheckoutCloseCallback">&nbsp;</a>
7367
+
7368
+ ## OnCheckoutCloseCallback : <code>function</code>
7369
+ Callback for onCheckoutClose method.
7370
+
7371
+ **Kind**: global typedef
7372
+
7373
+ | Param | Type |
7374
+ | --- | --- |
7375
+ | data | [<code>OnCloseEventData</code>](#OnCloseEventData) |
7376
+
7377
+ <a name="OnUnavailableCallback" id="OnUnavailableCallback" href="#OnUnavailableCallback">&nbsp;</a>
7378
+
7379
+ ## OnUnavailableCallback : <code>function</code>
7380
+ Callback for onUnavailable method.
7381
+
7382
+ **Kind**: global typedef
7383
+
7384
+ | Param | Type |
7385
+ | --- | --- |
7386
+ | data | [<code>OnUnavailableEventData</code>](#OnUnavailableEventData) |
7387
+
7388
+ <a name="OnErrorCallback" id="OnErrorCallback" href="#OnErrorCallback">&nbsp;</a>
7389
+
7390
+ ## OnErrorCallback : <code>function</code>
7391
+ Callback for onError method.
7392
+
7393
+ **Kind**: global typedef
7394
+
7395
+ | Param | Type |
7396
+ | --- | --- |
7397
+ | data | [<code>OnErrorEventData</code>](#OnErrorEventData) |
7398
+
7399
+
7400
+ # Click To Pay
7401
+
7402
+ ## Overview
7403
+
7404
+ Integrate with Click To Pay using Paydock's Click To Pay widget.
7405
+ For a full description of the methods and parameters, reference the [README file](https://www.npmjs.com/package/@paydock/client-sdk#ClickToPay).
7406
+
7407
+ ## Click To Pay simple example
7408
+
7409
+ The following section provides an example use case and integration for the widget.
7410
+
7411
+ ### Create a Container
7412
+
7413
+ To integrate the Click To Pay checkout iFrame, create a container in your HTML code. This container serves as the placeholder for the iFrame.
7414
+
7415
+ ```html
7416
+ <div id="checkoutIframe"></div>
7417
+ ```
7418
+
7419
+ ### Initialize the Widget
7420
+
7421
+ Use the following code to initialize your widget:
7422
+
7423
+ ```javascript
7424
+ var src = new paydock.ClickToPay(
7425
+ "#checkoutIframe",
7426
+ "service_id",
7427
+ "paydock_public_key_or_access_token",
7428
+ {}, // meta
7429
+ );
7430
+ src.load();
7431
+ ```
7432
+
7433
+ ```javascript
7434
+ // ES2015 | TypeScript
7435
+ import { ClickToPay } from '@paydock/client-sdk';
7436
+ var src = new ClickToPay(
7437
+ "#checkoutIframe",
7438
+ "service_id",
7439
+ "paydock_public_key_or_access_token",
7440
+ {}, // meta
7441
+ );
7442
+ src.load();
7443
+ ```
7444
+
7445
+ *NOTE:* Paydock recommends that you use a Paydock Access Token instead of a public key for security reasons in production environments. When creating your access token, you must enable the `Secure Remote Commerce` and add a whitelist for the domain of your checkout screen.
7446
+
7447
+ ### Full example
7448
+
7449
+ A full example of the container and the initialized widget is as follows:
7450
+
7451
+ ```html
7452
+ <!DOCTYPE html>
7453
+ <html lang="en">
7454
+ <head>
7455
+ <meta charset="UTF-8">
7456
+ <title>Title</title>
7457
+ <style>iframe {border: 0;width: 40%;height: 300px;}</style>
7458
+ </head>
7459
+ <body>
7460
+ <div id="checkoutIframe"></div>
7461
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
7462
+ <script>
7463
+ var src = new paydock.ClickToPay(
7464
+ "#checkoutIframe",
7465
+ "service_id",
7466
+ "paydock_public_key_or_access_token",
7467
+ {},
7468
+ );
7469
+ src.load();
7470
+ </script>
7471
+ </body>
7472
+ </html>
7473
+ ```
7474
+
7475
+ ## Customize your Click To Pay Checkout
7476
+
7477
+ The following is an advanced example that includes customization. You can use these methods to enhance your checkout experience.
7478
+
7479
+ ### Settings
7480
+
7481
+ ```javascript
7482
+ src.setEnv('sandbox'); // set environment
7483
+ src.hideCheckout(); // hide checkout iframe
7484
+ src.showCheckout(); // show checkout iframe
7485
+ src.on('iframeLoaded', () => {
7486
+ console.log("Initial iframe loaded");
7487
+ });
7488
+ src.on('checkoutReady', () => {
7489
+ console.log("Checkout ready to be used");
7490
+ });
7491
+ src.on('checkoutCompleted', (token) => {
7492
+ console.log(token);
7493
+ });
7494
+ src.on('checkoutError', (error) => {
7495
+ console.log(error);
7496
+ });
7497
+ ```
7498
+
7499
+ ### Full example
7500
+
7501
+ ```html
7502
+ <!DOCTYPE html>
7503
+ <html lang="en">
7504
+ <head>
7505
+ <meta charset="UTF-8">
7506
+ <title>Title</title>
7507
+ <style>iframe {border: 0;width: 40%;height: 450px;}</style>
7508
+ </head>
7509
+ <body>
7510
+ <div id="checkoutIframe"></div>
7511
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
7512
+ <script>
7513
+ var src = new paydock.ClickToPay(
7514
+ "#checkoutIframe",
7515
+ "service_id",
7516
+ "paydock_public_key_or_access_token",
7517
+ {},
7518
+ );
7519
+ src.on('iframeLoaded', () => {
7520
+ console.log("Initial iframe loaded");
7521
+ });
7522
+ src.on('checkoutReady', () => {
7523
+ console.log("Checkout ready to be used");
7524
+ });
7525
+ src.on('checkoutCompleted', (token) => {
7526
+ console.log(token);
7527
+ });
7528
+ src.on('checkoutError', (error) => {
7529
+ console.log(error);
7530
+ });
7531
+ src.load();
7532
+ </script>
7533
+ </body>
7534
+ </html>
7535
+ ```
7536
+
7537
+ ## Customize your billing address fields
7538
+
7539
+ To customize your billing address experience, Paydock uses a flag that manages whether a customer's billing address is mandatory.
7540
+ The options for this customization are NONE (default option), and POSTAL_COUNTRY or FULL.
7541
+
7542
+ ```
7543
+ var src = new paydock.ClickToPay(
7544
+ "#checkoutIframe",
7545
+ "service_id",
7546
+ "paydock_public_key_or_access_token",
7547
+ {
7548
+ "dpa_transaction_options": {
7549
+ "dpa_billing_preference": "FULL"
7550
+ }
7551
+ },
7552
+ );
7553
+ ```
7554
+
7555
+ The Click To Pay checkout in the example requires the billing address from the customer, which is then returned as a part of the checkout data. The data is then stored and leveraged in the Paydock charge.
7556
+ You can also provide the billing address at the time of creating the charge. For example, if you have a different method for collecting the billing address, such as outside of the Click To Pay checkout, you can provide it alongside other information at the charge creation step:
7557
+ 1. Disable the billing address in Paydock's Click To Pay widget.
7558
+ 2. Get your One Time Token from the Click To Pay widget alongside other details that may have been collected outside the Click To Pay checkout as the shipping address.
7559
+ 3. Send the billing address when creating the charge.
7560
+
7561
+ ```
7562
+ POST v1/charges
7563
+ {
7564
+ "amount": "10.00",
7565
+ "currency": "AUD",
7566
+ "token": "one_time_token",
7567
+ "customer": {
7568
+ "payment_source": {
7569
+ "gateway_id": "gateway_id",
7570
+ "address_line1": "address_line1",
7571
+ "address_line2": "address_line2",
7572
+ "address_city": "address_city",
7573
+ "address_postcode": "address_postcode",
7574
+ "address_state": "address_state",
7575
+ "address_country": "address_country"
7576
+ }
7577
+ },
7578
+ "shipping": {
7579
+ "address_line1": "address_line1",
7580
+ "address_line2": "address_line2",
7581
+ "address_line3": "address_line3",
7582
+ "address_city": "address_city",
7583
+ "address_postcode": "address_postcode",
7584
+ "address_state": "address_state",
7585
+ "address_country": "address_country"
7586
+ }
7587
+ }
7588
+ ```
7589
+
7590
+ ## How to customize accepted cards
7591
+
7592
+ You can send a flag `unaccepted_card_type` to block the usage of a specific card type. The available options are 'DEBIT' and 'CREDIT'.
7593
+
7594
+ ### Example code
7595
+
7596
+ The following example demonstrates how to block the card:
7597
+
7598
+ ```
7599
+ var src = new paydock.ClickToPay(
7600
+ "#checkoutIframe",
7601
+ "service_id",
7602
+ "paydock_public_key",
7603
+ {
7604
+ unaccepted_card_type: 'DEBIT'
7605
+ },
7606
+ );
7607
+ ```
7608
+
7609
+ ## Personalize the Style
7610
+
7611
+ Customize the look and feel of your UI. The following example demonstrates changes in the styling of the buttons.
7612
+
7613
+ ### Example code
7614
+
7615
+ ```
7616
+ var src = new paydock.ClickToPay(
7617
+ "#checkoutIframe",
7618
+ "service_id",
7619
+ "paydock_public_key",
7620
+ {},
7621
+ );
7622
+ src.setStyles({
7623
+ enable_src_popup: true,
7624
+ primary_button_color: 'red',
7625
+ secondary_button_color: 'red',
7626
+ primary_button_text_color: 'red',
7627
+ secondary_button_text_color: 'red',
7628
+ font_family: 'Arial',
7629
+ });
7630
+ ```
7631
+
7632
+ ## Recognition token
7633
+
7634
+ In order to store user information for further payments, click to pay provides a recognition token that is used to load user information.
7635
+ If you already have a recognitionToken stored, you can use it in meta to load the user information.
7636
+
7637
+ ### Storage suggestions
7638
+ Merchant can store the tokens by dropping the token as a 1st party cookie in the browser, and must ensure to manage all the security aspects around dropping/storing the cookie by following the security standards:
7639
+
7640
+ - `Expiration Date=` cookie should be set to expire at a max 180 days
7641
+ - `Secure` flag
7642
+ - `httpOnly` flag
7643
+ - `sameSite=` strict
7644
+ - `Value=` recognition token JWT
7645
+
7646
+ ### Example code
7647
+
7648
+ ```javascript
7649
+ var src = new paydock.ClickToPay(
7650
+ "#checkoutIframe",
7651
+ "service_id",
7652
+ "paydock_public_key",
7653
+ {
7654
+ "recognition_token": "eyJraWQiOiIy...",
7655
+ },
7656
+ );
7657
+ src.on('recognitionTokenRequested', (data) => {
7658
+ console.log('Recognition token was found: ' + data.data.recognitionToken);
7659
+ // Add recognition token to your store
7660
+ });
7661
+
7662
+ src.on('recognitionTokenDropped', () => {
7663
+ console.log('Recognition token was droped');
7664
+ // Delete recognition token from your store
7665
+ });
7666
+ ```
7667
+
7668
+ ## Classes
7669
+
7670
+ <dl>
7671
+ <dt><a href="#ClickToPay">ClickToPay</a> ⇐ <code>SRC</code></dt>
7672
+ <dd><p>Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option</p>
7673
+ </dd>
7674
+ </dl>
7675
+
7676
+ ## Interfaces
7677
+
7678
+ <dl>
7679
+ <dt><a href="#IMastercardSRCMeta">IMastercardSRCMeta</a> : <code>object</code></dt>
7680
+ <dd><p>Interface of data used for the Mastercard Checkout. For further information refer to <a href="https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/init">the documentation</a>.</p>
7681
+ </dd>
7682
+ <dt><a href="#EventData">EventData</a> : <code>object</code></dt>
7683
+ <dd><p>Interface for data returned in callbacks</p>
7684
+ </dd>
7685
+ <dt><a href="#EventDataCheckoutCompletedData">EventDataCheckoutCompletedData</a> : <code>object</code></dt>
7686
+ <dd><p>Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
7687
+ When the flow type is src, masked checkoutData available is also returned</p>
7688
+ </dd>
7689
+ <dt><a href="#IStyles">IStyles</a> : <code>object</code></dt>
7690
+ <dd><p>Interface for style configs inyected to the Click to Pay checkout</p>
7691
+ </dd>
7692
+ </dl>
7693
+
7694
+ <a name="IMastercardSRCMeta" id="IMastercardSRCMeta" href="#IMastercardSRCMeta">&nbsp;</a>
7695
+
7696
+ ## IMastercardSRCMeta : <code>object</code>
7697
+ Interface of data used for the Mastercard Checkout. For further information refer to [the documentation](https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/init).
7698
+
7699
+ **Kind**: global interface
7700
+
7701
+ | Param | Type | Description |
7702
+ | --- | --- | --- |
7703
+ | [disable_summary_screen] | <code>boolean</code> | Boolean flag that controls if a final summary screen is presented in the checkout flow. |
7704
+ | [dpa_data] | <code>object</code> | Object where the DPA creation data is stored. |
7705
+ | [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented. |
7706
+ | [dpa_data.dpa_uri] | <code>string</code> | Used for indicating the DPA URI. |
7707
+ | [dpa_data.dpa_address] | <code>string</code> | Address associated with the DPA. |
7708
+ | [dpa_data.dpa_email_address] | <code>string</code> | Email address for DPA communication. |
7709
+ | [dpa_data.dpa_phone_number] | <code>object</code> | Phone number structure for DPA communication. |
7710
+ | [dpa_data.dpa_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
7711
+ | [dpa_data.dpa_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
7712
+ | [dpa_data.dpa_logo_uri] | <code>string</code> | URI for the DPA logo. |
7713
+ | [dpa_data.dpa_supported_email_address] | <code>string</code> | Supported email address for DPA support. |
7714
+ | [dpa_data.dpa_supported_phone_number] | <code>object</code> | Supported phone number for DPA support. |
7715
+ | [dpa_data.dpa_supported_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
7716
+ | [dpa_data.dpa_supported_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
7717
+ | [dpa_data.dpa_support_uri] | <code>string</code> | URI for DPA support. |
7718
+ | [dpa_data.application_type] | <code>string</code> | Application type, either 'WEB_BROWSER' or 'MOBILE_APP'. |
7719
+ | [co_brand_names] | <code>Array.&lt;string&gt;</code> | List of co-brand names associated with the Click to Pay experience. |
7720
+ | [checkout_experience] | <code>string</code> | Checkout experience type, either 'WITHIN_CHECKOUT' or 'PAYMENT_SETTINGS'. |
7721
+ | [services] | <code>string</code> | Services offered, such as 'INLINE_CHECKOUT' or 'INLINE_INSTALLMENTS'. |
7722
+ | [dpa_transaction_options] | <code>object</code> | Object that stores options for creating a transaction with DPA. |
7723
+ | [dpa_transaction_options.dpa_locale] | <code>string</code> | DPA’s preferred locale, example en_US. |
7724
+ | [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array.&lt;string&gt;</code> | List of accepted billing countries for DPA in ISO 3166-1 alpha-2 format. |
7725
+ | [dpa_transaction_options.dpa_billing_preference] | <code>string</code> | Billing preferences for DPA, options are 'FULL', 'POSTAL_COUNTRY', 'NONE'. |
7726
+ | [dpa_transaction_options.payment_options] | <code>Array.&lt;object&gt;</code> | Payment options included in the transaction. |
7727
+ | [dpa_transaction_options.payment_options.dynamic_data_type] | <code>string</code> | Dynamic data types. |
7728
+ | [dpa_transaction_options.order_type] | <code>string</code> | Type of the order, options are 'SPLIT_SHIPMENT', 'PREFERRED_CARD'. |
7729
+ | [dpa_transaction_options.three_ds_preference] | <code>string</code> | Preference for 3DS usage in the transaction. |
7730
+ | [dpa_transaction_options.confirm_payment] | <code>boolean</code> | Indicates if payment confirmation is required. |
7731
+ | [dpa_transaction_options.consumer_name_requested] | <code>boolean</code> | Indicates if consumer name is requested. |
7732
+ | [dpa_transaction_options.consumer_email_address_requested] | <code>boolean</code> | Indicates if consumer email address is requested. |
7733
+ | [dpa_transaction_options.consumer_phone_number_requested] | <code>boolean</code> | Indicates if consumer phone number is requested. |
7734
+ | [dpa_transaction_options.transaction_amount] | <code>object</code> | Details of the transaction amount. |
7735
+ | [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Amount of the transaction. |
7736
+ | [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Currency code of the transaction in 3 letter ISO code format. |
7737
+ | [dpa_transaction_options.merchant_order_id] | <code>string</code> | Merchant's order ID. |
7738
+ | [dpa_transaction_options.merchant_category_code] | <code>string</code> | Merchant's category code. |
7739
+ | [dpa_transaction_options.merchant_country_code] | <code>string</code> | Merchant's country code in ISO 3166-1 alpha-2 format. |
7740
+ | [customer] | <code>object</code> | Object where the customer data is stored to prefill in the checkout. |
7741
+ | [customer.email] | <code>string</code> | Customer email. |
7742
+ | [customer.first_name] | <code>string</code> | Customer first name. |
7743
+ | [customer.last_name] | <code>string</code> | Customer last name. |
7744
+ | [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
7745
+ | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
7746
+ | [customer.phone.phone] | <code>string</code> | Customer phone number. |
7747
+ | [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
7748
+ | [recognition_token] | <code>string</code> | Used for Click to Pay to load user information and preferences. |
7749
+
7750
+ <a name="EventData" id="EventData" href="#EventData">&nbsp;</a>
7751
+
7752
+ ## EventData : <code>object</code>
7753
+ Interface for data returned in callbacks
7754
+
7755
+ **Kind**: global interface
7756
+
7757
+ | Param | Type | Description |
7758
+ | --- | --- | --- |
7759
+ | type | [<code>EVENT\_DATA\_TYPE</code>](#EVENT_DATA_TYPE) | Event type of type [EVENT_DATA_TYPE](#EVENT_DATA_TYPE) |
7760
+ | data | <code>string</code> \| [<code>EventDataCheckoutCompletedData</code>](#EventDataCheckoutCompletedData) | optional data returning a string for checkoutError event or [EventDataCheckoutCompletedData](#EventDataCheckoutCompletedData) for checkoutCompleted |
7761
+
7762
+ <a name="EventDataCheckoutCompletedData" id="EventDataCheckoutCompletedData" href="#EventDataCheckoutCompletedData">&nbsp;</a>
7763
+
7764
+ ## EventDataCheckoutCompletedData : <code>object</code>
7765
+ Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
7766
+ When the flow type is src, masked checkoutData available is also returned
7767
+
7768
+ **Kind**: global interface
7769
+
7770
+ | Param | Type | Description |
7771
+ | --- | --- | --- |
7772
+ | type | <code>string</code> | type of the checkout, can be `src` or `manual`. |
7773
+ | token | <code>string</code> | one time token value. |
7774
+ | [checkoutData] | <code>object</code> | Optional checkout data related to the checkout information. Only available on src flow. |
7775
+ | [checkoutData.card_number_bin] | <code>string</code> | The BIN of the card used for the transaction. |
7776
+ | [checkoutData.card_number_last4] | <code>string</code> | The last four digits of the card number. |
7777
+ | [checkoutData.card_scheme] | <code>string</code> | The card scheme. Values: visa, mastercard, amex, diners, discover. |
7778
+ | [checkoutData.card_type] | <code>string</code> | The type of card. Values: credit, debit, prepaid, combo, flex. |
7779
+ | [checkoutData.address_line1] | <code>string</code> | Address line 1 for billing address. |
7780
+ | [checkoutData.address_line2] | <code>string</code> | Address line 2 for billing address. |
7781
+ | [checkoutData.address_line3] | <code>string</code> | Address line 3 for billing address. |
7782
+ | [checkoutData.address_city] | <code>string</code> | City for billing address. |
7783
+ | [checkoutData.address_postcode] | <code>string</code> | Postal code for billing address. |
7784
+ | [checkoutData.address_state] | <code>string</code> | State or province for billing address. |
7785
+ | [checkoutData.address_country] | <code>string</code> | Country for billing address. |
7786
+ | [checkoutData.shipping] | <code>object</code> | Optional shipping information. |
7787
+ | [checkoutData.shipping.address_line1] | <code>string</code> | Address line 1 for shipping address. |
7788
+ | [checkoutData.shipping.address_line2] | <code>string</code> | Address line 2 for shipping address. |
7789
+ | [checkoutData.shipping.address_line3] | <code>string</code> | Address line 3 for shipping address. |
7790
+ | [checkoutData.shipping.address_city] | <code>string</code> | City for shipping address. |
7791
+ | [checkoutData.shipping.address_postcode] | <code>string</code> | Postal code for shipping address. |
7792
+ | [checkoutData.shipping.address_state] | <code>string</code> | State or province for shipping address. |
7793
+ | [checkoutData.shipping.address_country] | <code>string</code> | Country for shipping address. |
7794
+
7795
+ <a name="IStyles" id="IStyles" href="#IStyles">&nbsp;</a>
7796
+
7797
+ ## IStyles : <code>object</code>
7798
+ Interface for style configs inyected to the Click to Pay checkout
7799
+
7800
+ **Kind**: global interface
7801
+
7802
+ | Param | Type | Description |
7803
+ | --- | --- | --- |
7804
+ | [primary_button_color] | <code>string</code> | Color Code for primary button. |
7805
+ | [primary_button_text_color] | <code>string</code> | Color Code for primary button text. |
7806
+ | [secondary_button_color] | <code>string</code> | Color Code for secondary button. |
7807
+ | [secondary_button_text_color] | <code>string</code> | Color Code for secondary button text. |
7808
+ | [font_family] | <code>string</code> | Font family to be used. |
7809
+ | [enable_src_popup] | <code>boolean</code> | Boolean flag to make the Click to Pay checkout show in a popup window instead of embedded in iframe. |
7810
+
7811
+ <a name="ClickToPay" id="ClickToPay" href="#ClickToPay">&nbsp;</a>
7812
+
7813
+ ## ClickToPay ⇐ <code>SRC</code>
7814
+ Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option
7815
+
7816
+ **Kind**: global class
7817
+ **Extends**: <code>SRC</code>
7818
+
7819
+ * [ClickToPay](#ClickToPay) ⇐ <code>SRC</code>
7820
+ * [new ClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)](#new_ClickToPay_new)
7821
+ * [.load()](#ClickToPay+load)
7822
+ * [.setStyles(fields)](#SRC+setStyles)
7823
+ * [.setEnv(env, [alias])](#SRC+setEnv)
7824
+ * [.getEnv()](#SRC+getEnv)
7825
+ * [.on(eventName, [cb])](#SRC+on) ⇒ <code>Promise.&lt;any&gt;</code> \| <code>void</code>
7826
+ * [.hideCheckout([saveSize])](#SRC+hideCheckout)
7827
+ * [.showCheckout()](#SRC+showCheckout)
7828
+ * [.reload()](#SRC+reload)
7829
+ * [.useAutoResize()](#SRC+useAutoResize)
7830
+
7831
+ <a name="new_ClickToPay_new" id="new_ClickToPay_new" href="#new_ClickToPay_new">&nbsp;</a>
7832
+
7833
+ ### new ClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)
7834
+
7835
+ | Param | Type | Description |
7836
+ | --- | --- | --- |
7837
+ | iframe_selector | <code>string</code> | Selector of html element. Container for Click To Pay checkout iFrame. |
7838
+ | service_id | <code>string</code> | Card Scheme Service ID |
7839
+ | public_key_or_access_token | <code>string</code> | Paydock public key or Access Token |
7840
+ | meta | <code>IClickToPayMeta</code> | Data that configures the Click To Pay checkout |
7841
+
7842
+ **Example**
7843
+ ```js
7844
+ var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
7845
+ ```
7846
+ <a name="ClickToPay+load" id="ClickToPay+load" href="#ClickToPay+load">&nbsp;</a>
7847
+
7848
+ ### clickToPay.load()
7849
+ The final method after configuring the SRC to start the load process of Click To Pay checkout
7850
+
7851
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7852
+ <a name="SRC+setStyles" id="SRC+setStyles" href="#SRC+setStyles">&nbsp;</a>
7853
+
7854
+ ### clickToPay.setStyles(fields)
7855
+ Object contain styles for widget - call before `.load()`.
7856
+
7857
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7858
+ **Overrides**: [<code>setStyles</code>](#SRC+setStyles)
7859
+
7860
+ | Param | Type | Description |
7861
+ | --- | --- | --- |
7862
+ | fields | [<code>IStyles</code>](#IStyles) | name of styles which can be shown in widget [STYLE](STYLE) |
7863
+
7864
+ **Example**
7865
+ ```js
7866
+ widget.setStyles({
7867
+ enable_src_popup: true
7868
+ primary_button_color: 'red',
7869
+ secondary_button_color: 'blue',
7870
+ primary_button_text_color: 'white',
7871
+ secondary_button_text_color: 'white',
7872
+ font_family: 'Arial',
7873
+ });
7874
+ ```
7875
+ <a name="SRC+setEnv" id="SRC+setEnv" href="#SRC+setEnv">&nbsp;</a>
7876
+
7877
+ ### clickToPay.setEnv(env, [alias])
7878
+ Current method can change environment. By default environment = sandbox.
7879
+ Also we can change domain alias for this environment. By default domain_alias = paydock.com
7880
+
7881
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7882
+ **Overrides**: [<code>setEnv</code>](#SRC+setEnv)
7883
+
7884
+ | Param | Type | Description |
7885
+ | --- | --- | --- |
7886
+ | env | <code>string</code> | sandbox, production |
7887
+ | [alias] | <code>string</code> | Own domain alias |
7888
+
7889
+ **Example**
7890
+ ```js
7891
+ SRC.setEnv('production');
7892
+ ```
7893
+ <a name="SRC+getEnv" id="SRC+getEnv" href="#SRC+getEnv">&nbsp;</a>
7894
+
7895
+ ### clickToPay.getEnv()
7896
+ Method to read the current environment
7897
+
7898
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7899
+ **Overrides**: [<code>getEnv</code>](#SRC+getEnv)
7900
+ **Example**
7901
+ ```js
7902
+ SRC.getEnv();
7903
+ ```
7904
+ <a name="SRC+on" id="SRC+on" href="#SRC+on">&nbsp;</a>
7905
+
7906
+ ### clickToPay.on(eventName, [cb]) ⇒ <code>Promise.&lt;any&gt;</code> \| <code>void</code>
7907
+ Listen to events of SRC
7908
+
7909
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7910
+ **Overrides**: [<code>on</code>](#SRC+on)
7911
+
7912
+ | Param | Type | Description |
7913
+ | --- | --- | --- |
7914
+ | eventName | <code>string</code> | Available event names [EVENT](#EVENT) |
7915
+ | [cb] | <code>listener</code> | The callback to handle the event. When available, it will send back data of type [EventData](#EventData) |
7916
+
7917
+ **Example**
7918
+ ```js
7919
+ SRC.on('checkoutCompleted', function (token) {
7920
+ console.log(token);
7921
+ });
7922
+ // or
7923
+ SRC.on('checkoutCompleted').then(function (token) {
7924
+ console.log(token);
7925
+ });
7926
+ ```
7927
+ <a name="SRC+hideCheckout" id="SRC+hideCheckout" href="#SRC+hideCheckout">&nbsp;</a>
7928
+
7929
+ ### clickToPay.hideCheckout([saveSize])
7930
+ Using this method you can hide checkout after load and button click
7931
+
7932
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7933
+ **Overrides**: [<code>hideCheckout</code>](#SRC+hideCheckout)
7934
+
7935
+ | Param | Type | Default | Description |
7936
+ | --- | --- | --- | --- |
7937
+ | [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
7938
+
7939
+ **Example**
7940
+ ```js
7941
+ SRC.hideCheckout();
7942
+ ```
7943
+ <a name="SRC+showCheckout" id="SRC+showCheckout" href="#SRC+showCheckout">&nbsp;</a>
7944
+
7945
+ ### clickToPay.showCheckout()
7946
+ Using this method you can show checkout after using hideCheckout method
7947
+
7948
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7949
+ **Overrides**: [<code>showCheckout</code>](#SRC+showCheckout)
7950
+ **Example**
7951
+ ```js
7952
+ SRC.showCheckout()
7953
+ ```
7954
+ <a name="SRC+reload" id="SRC+reload" href="#SRC+reload">&nbsp;</a>
7955
+
7956
+ ### clickToPay.reload()
7957
+ Using this method you can reload the whole checkout
7958
+
7959
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7960
+ **Overrides**: [<code>reload</code>](#SRC+reload)
7961
+ **Example**
7962
+ ```js
7963
+ SRC.reload()
7964
+ ```
7965
+ <a name="SRC+useAutoResize" id="SRC+useAutoResize" href="#SRC+useAutoResize">&nbsp;</a>
7966
+
7967
+ ### clickToPay.useAutoResize()
7968
+ Use this method for resize checkout iFrame according to content height, if applicable
7969
+
7970
+ **Kind**: instance method of [<code>ClickToPay</code>](#ClickToPay)
7971
+ **Overrides**: [<code>useAutoResize</code>](#SRC+useAutoResize)
7972
+ **Example**
7973
+ ```js
7974
+ SRC.useAutoResize();
7975
+ ```
7976
+ <a name="EVENT" id="EVENT" href="#EVENT">&nbsp;</a>
7977
+
7978
+ ## EVENT : <code>enum</code>
7979
+ List of available event's name in the Click To Pay checkout lifecycle
7980
+
7981
+ **Kind**: global enum
7982
+
7983
+ | Param | Type | Default | Description |
7984
+ | --- | --- | --- | --- |
7985
+ | IFRAME_LOADED | <code>string</code> | <code>&quot;iframeLoaded&quot;</code> | Initial event sent when IFrame is initially loaded. |
7986
+ | CHECKOUT_READY | <code>string</code> | <code>&quot;checkoutReady&quot;</code> | Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout). |
7987
+ | CHECKOUT_POPUP_OPEN | <code>string</code> | <code>&quot;checkoutPopupOpen&quot;</code> | Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode. |
7988
+ | CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>&quot;checkoutPopupClose&quot;</code> | Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode. |
7989
+ | CHECKOUT_COMPLETED | <code>string</code> | <code>&quot;checkoutCompleted&quot;</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
7990
+ | CHECKOUT_ERROR | <code>string</code> | <code>&quot;checkoutError&quot;</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
7991
+ | RECOGNITION_TOKEN_REQUESTED | <code>string</code> | <code>&quot;recognitionTokenRequested&quot;</code> | Event sent when a recognition token was found on the mastercard SDK response. |
7992
+ | RECOGNITION_TOKEN_DROPPED | <code>string</code> | <code>&quot;recognitionTokenDropped&quot;</code> | Event sent when a recognition token needs to be dropped for user be no longer remembered. |
7993
+
7994
+ <a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE">&nbsp;</a>
7995
+
7996
+ ## EVENT\_DATA\_TYPE : <code>enum</code>
7997
+ List of available event data types
7998
+
7999
+ **Kind**: global enum
8000
+
8001
+ | Param | Type | Default | Description |
8002
+ | --- | --- | --- | --- |
8003
+ | CRITICAL_ERROR | <code>string</code> | <code>&quot;CriticalError&quot;</code> | in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user |
8004
+ | USER_ERROR | <code>string</code> | <code>&quot;UserError&quot;</code> | in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow |
8005
+ | SUCCESS | <code>string</code> | <code>&quot;Success&quot;</code> | |
8006
+
8007
+
8008
+ ## PayPalSavePaymentSource Widget
8009
+
8010
+ PayPalSavePaymentSource Widget allows to obtain a Paydock one time token linked with a Paypal payment source from the customer.
8011
+
8012
+ The general flow to use the widgets is:
8013
+ 1. Configure your PayPal gateway and connect it using Paydock API or Dashboard.
8014
+ 2. Create a container in your site
8015
+ ```html
8016
+ <div id="widget"></div>
8017
+ ```
8018
+ 3. Initialize the specific `PayPalSavePaymentSourceWidget`, providing your Access token or Public Key, the Gateway ID that Paydock provides plus required and optional config parameter for the widget in use. The general format is:
8019
+ ```js
8020
+ new paydock.PayPalSavePaymentSourceWidget(
8021
+ "#widget",
8022
+ accessTokenOrPublicKey,
8023
+ gatewayId,
8024
+ widgetSpecificConfig,
8025
+ );
8026
+ ```
8027
+ 4. Handle the `onSuccess`, `onError` and `onCancel` for paypal setup token results.
8028
+ 5. If `onSuccess` event is emmited, event data should contain `token` and `email` ready to use.
8029
+
8030
+ ### Example
8031
+
8032
+ A full description of the config parameters for [PayPalSavePaymentSourceWidget](#PayPalSavePaymentSourceWidget) meta parameters can be found [here](#PayPalSavePaymentSourceWidgetConfig). Below you will find a fully working html example.
8033
+
8034
+ ```html
8035
+ <!DOCTYPE html>
8036
+ <html lang="en">
8037
+ <head>
8038
+ <meta charset="UTF-8">
8039
+ <title>Title</title>
8040
+ </head>
8041
+ <body>
8042
+ <h2>Using PayDock PayPalSavePaymentSourceWidget!</h2>
8043
+ <div id="widget"></div>
8044
+ </body>
8045
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
8046
+ <script>
8047
+ let button = new paydock.PayPalSavePaymentSourceWidget(
8048
+ "#widget",
8049
+ accessTokenOrPublicKey,
8050
+ gatewayId,
8051
+ {
8052
+ style: {
8053
+ layout: 'vertical',
8054
+ color: 'gold',
8055
+ shape: 'pill',
8056
+ label: 'paypal'
8057
+ }
8058
+ }
8059
+ );
8060
+
8061
+ payPalSavePaymentSourceWidget.onSuccess((data) => console.log('On success: ', data));
8062
+ payPalSavePaymentSourceWidget.onError((data) => console.log('On error: ', data));
8063
+ payPalSavePaymentSourceWidget.onCancel(() => console.log('On cancelled'));
8064
+
8065
+ button.setEnv('sandbox');
8066
+
8067
+ button.load();
8068
+ </script>
8069
+ </html>
8070
+ ```
8071
+
8072
+ ## Classes
8073
+
8074
+ <dl>
8075
+ <dt><a href="#PayPalSavePaymentSourceWidget">PayPalSavePaymentSourceWidget</a></dt>
8076
+ <dd><p>PayPal Save Payment Source Widget constructor</p>
8077
+ </dd>
8078
+ </dl>
8079
+
8080
+ ## Typedefs
8081
+
8082
+ <dl>
8083
+ <dt><a href="#OnSuccessCallback">OnSuccessCallback</a> : <code>function</code></dt>
8084
+ <dd><p>Callback for onSuccess method.</p>
8085
+ </dd>
8086
+ <dt><a href="#OnErrorCallback">OnErrorCallback</a> : <code>function</code></dt>
8087
+ <dd><p>Callback for onError method.</p>
8088
+ </dd>
8089
+ <dt><a href="#OnCancelCallback">OnCancelCallback</a> : <code>function</code></dt>
8090
+ <dd><p>Callback for onCancel method.</p>
8091
+ </dd>
8092
+ </dl>
8093
+
8094
+ ## Interfaces
8095
+
8096
+ <dl>
8097
+ <dt><a href="#PayPalSavePaymentSourceWidgetConfig">PayPalSavePaymentSourceWidgetConfig</a> : <code>object</code></dt>
8098
+ <dd><p>Interface of data used for PayPal configuration. For further information refer to <a href="https://developer.paypal.com/sdk/js/reference/#style">the documentation</a>.</p>
8099
+ </dd>
8100
+ <dt><a href="#ErrorCodes">ErrorCodes</a> : <code>object</code></dt>
8101
+ <dd><p>Interface of possible error codes inside onError event data.</p>
8102
+ </dd>
8103
+ <dt><a href="#IOnSuccessEventData">IOnSuccessEventData</a> : <code>object</code></dt>
8104
+ <dd><p>Interface for IOnSuccessEventData</p>
8105
+ </dd>
8106
+ <dt><a href="#IOnErrorEventData">IOnErrorEventData</a> : <code>object</code></dt>
8107
+ <dd><p>Interface for IOnErrorEventData</p>
8108
+ </dd>
8109
+ <dt><a href="#IOnCancelEventData">IOnCancelEventData</a> : <code>object</code></dt>
8110
+ <dd><p>Interface for IOnCancelEventData</p>
8111
+ </dd>
8112
+ </dl>
8113
+
8114
+ <a name="PayPalSavePaymentSourceWidgetConfig" id="PayPalSavePaymentSourceWidgetConfig" href="#PayPalSavePaymentSourceWidgetConfig">&nbsp;</a>
8115
+
8116
+ ## PayPalSavePaymentSourceWidgetConfig : <code>object</code>
8117
+ Interface of data used for PayPal configuration. For further information refer to [the documentation](https://developer.paypal.com/sdk/js/reference/#style).
8118
+
8119
+ **Kind**: global interface
8120
+
8121
+ | Param | Type | Description |
8122
+ | --- | --- | --- |
8123
+ | [style.layout] | <code>&#x27;vertical&#x27;</code> \| <code>&#x27;horizontal&#x27;</code> | Used for indicating the PayPal Button layout. |
8124
+ | [style.color] | <code>&#x27;blue&#x27;</code> \| <code>&#x27;gold&#x27;</code> \| <code>&#x27;silver&#x27;</code> \| <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> | Used for indicating the main color of the PayPal Button. |
8125
+ | [style.shape] | <code>&#x27;rect&#x27;</code> \| <code>&#x27;sharp&#x27;</code> \| <code>&#x27;pill&#x27;</code> | Used for indicating the shape of the PayPal Button. |
8126
+ | [style.label] | <code>&#x27;paypal&#x27;</code> \| <code>&#x27;checkout&#x27;</code> \| <code>&#x27;buynow&#x27;</code> \| <code>&#x27;pay&#x27;</code> | Used for indicating the label of the PayPal Button. |
8127
+ | [style.disableMaxWidth] | <code>boolean</code> | Used for indicating if the max width will be disabled. |
8128
+ | [style.disableMaxHeight] | <code>boolean</code> | Used for indicating the max height will be disabled. |
8129
+ | [style.height] | <code>number</code> | Used for indicating the height of the PayPal Button, if disableMaxHeight is true. |
8130
+ | [style.borderRadius] | <code>number</code> | Used for indicating the border radius of the PayPal Button. |
8131
+ | [style.tagline] | <code>boolean</code> | Used for indicating the tagline of the PayPal Button. |
8132
+ | [message.amount] | <code>number</code> | Used for indicating an amount before the payment. |
8133
+ | [message.align] | <code>&#x27;center&#x27;</code> \| <code>&#x27;left&#x27;</code> \| <code>&#x27;right&#x27;</code> | Used for indicating the align of the message. |
8134
+ | [message.color] | <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> | Used for indicating the color of the message. |
8135
+ | [message.position] | <code>&#x27;top&#x27;</code> \| <code>&#x27;bottom&#x27;</code> | Used for indicating the position of the message. |
8136
+
8137
+ <a name="ErrorCodes" id="ErrorCodes" href="#ErrorCodes">&nbsp;</a>
8138
+
8139
+ ## ErrorCodes : <code>object</code>
8140
+ Interface of possible error codes inside onError event data.
8141
+
8142
+ **Kind**: global interface
8143
+
8144
+ | Param | Type | Description |
8145
+ | --- | --- | --- |
8146
+ | [unavailable] | <code>string</code> | Error code when an error occurs loading the widget. |
8147
+ | [onPaypalVaultSetupTokenError] | <code>string</code> | Error code when an error occrus on PayPal side. |
8148
+ | [onGetIdTokenError] | <code>string</code> | Error code when trying to get ID token from PayPal. |
8149
+ | [onGetWalletConfigError] | <code>string</code> | Error code when trying to get wallet config from Paydock. |
8150
+ | [onGetSetupTokenError] | <code>string</code> | Error code when trying to get the setup token from PayPal. |
8151
+ | [onOneTimeTokenError] | <code>string</code> | Error code when trying to get the one time token from Paydock. |
8152
+
8153
+ <a name="IOnSuccessEventData" id="IOnSuccessEventData" href="#IOnSuccessEventData">&nbsp;</a>
8154
+
8155
+ ## IOnSuccessEventData : <code>object</code>
8156
+ Interface for IOnSuccessEventData
8157
+
8158
+ **Kind**: global interface
8159
+
8160
+ | Param | Type | Description |
8161
+ | --- | --- | --- |
8162
+ | event | <code>EVENTS</code> | Event Name is 'ON_SUCCESS' |
8163
+ | data | <code>object</code> | Data object |
8164
+ | data.token | <code>string</code> | One Time Token to be exchanged for a Paydock Customer. |
8165
+ | [data.email] | <code>string</code> | Paypal account customer email if retrieved from Paypal servers. |
8166
+
8167
+ <a name="IOnErrorEventData" id="IOnErrorEventData" href="#IOnErrorEventData">&nbsp;</a>
8168
+
8169
+ ## IOnErrorEventData : <code>object</code>
8170
+ Interface for IOnErrorEventData
8171
+
8172
+ **Kind**: global interface
8173
+
8174
+ | Param | Type | Description |
8175
+ | --- | --- | --- |
8176
+ | event | <code>EVENTS</code> | Event Name is 'ON_ERROR' |
8177
+ | data | <code>object</code> | Error data object |
8178
+ | data.error_code | [<code>ErrorCodes</code>](#ErrorCodes) | Error code. One of ErrorCodes. |
8179
+ | [data.details] | <code>string</code> | Error details. |
8180
+ | [data.message] | <code>string</code> | Error message. |
8181
+
8182
+ <a name="IOnCancelEventData" id="IOnCancelEventData" href="#IOnCancelEventData">&nbsp;</a>
8183
+
8184
+ ## IOnCancelEventData : <code>object</code>
8185
+ Interface for IOnCancelEventData
8186
+
8187
+ **Kind**: global interface
8188
+
8189
+ | Param | Type | Description |
8190
+ | --- | --- | --- |
8191
+ | event | <code>EVENTS</code> | Event Name is 'ON_CANCEL' |
8192
+
8193
+ <a name="PayPalSavePaymentSourceWidget" id="PayPalSavePaymentSourceWidget" href="#PayPalSavePaymentSourceWidget">&nbsp;</a>
8194
+
8195
+ ## PayPalSavePaymentSourceWidget
8196
+ PayPal Save Payment Source Widget constructor
8197
+
8198
+ **Kind**: global class
8199
+
8200
+ * [PayPalSavePaymentSourceWidget](#PayPalSavePaymentSourceWidget)
8201
+ * [new PayPalSavePaymentSourceWidget(selector, publicKey, gatewayId, config)](#new_PayPalSavePaymentSourceWidget_new)
8202
+ * [.load()](#PayPalSavePaymentSourceWidget+load)
8203
+ * [.setEnv(env, [alias])](#PayPalSavePaymentSourceWidget+setEnv)
8204
+ * [.onSuccess([callback])](#PayPalSavePaymentSourceWidget+onSuccess)
8205
+ * [.onError([callback])](#PayPalSavePaymentSourceWidget+onError)
8206
+ * [.onCancel([callback])](#PayPalSavePaymentSourceWidget+onCancel)
8207
+
8208
+ <a name="new_PayPalSavePaymentSourceWidget_new" id="new_PayPalSavePaymentSourceWidget_new" href="#new_PayPalSavePaymentSourceWidget_new">&nbsp;</a>
8209
+
8210
+ ### new PayPalSavePaymentSourceWidget(selector, publicKey, gatewayId, config)
8211
+
8212
+ | Param | Type | Description |
8213
+ | --- | --- | --- |
8214
+ | selector | <code>string</code> | Selector of html element. Container for PayPal Save Payment Source Widget. |
8215
+ | publicKey | <code>string</code> | PayDock users public key. |
8216
+ | gatewayId | <code>string</code> | PayDock's PayPal gatewayId. |
8217
+ | config | [<code>PayPalSavePaymentSourceWidgetConfig</code>](#PayPalSavePaymentSourceWidgetConfig) | Extra configuration for the widget, like styles. |
8218
+
8219
+ **Example**
8220
+ ```js
8221
+ var payPalSavePaymentSourceWidget = new PayPalSavePaymentSourceWidget('#paypalButton', 'public_key', 'gateway_id');
8222
+ ```
8223
+ <a name="PayPalSavePaymentSourceWidget+load" id="PayPalSavePaymentSourceWidget+load" href="#PayPalSavePaymentSourceWidget+load">&nbsp;</a>
8224
+
8225
+ ### payPalSavePaymentSourceWidget.load()
8226
+ The final method after configuring the PayPalSavePaymentSource Widget to
8227
+ start the load process.
8228
+
8229
+ **Kind**: instance method of [<code>PayPalSavePaymentSourceWidget</code>](#PayPalSavePaymentSourceWidget)
8230
+ <a name="PayPalSavePaymentSourceWidget+setEnv" id="PayPalSavePaymentSourceWidget+setEnv" href="#PayPalSavePaymentSourceWidget+setEnv">&nbsp;</a>
8231
+
8232
+ ### payPalSavePaymentSourceWidget.setEnv(env, [alias])
8233
+ Current method can change environment. By default environment = sandbox.
8234
+ Also we can change domain alias for this environment. By default domain_alias = paydock.com
8235
+
8236
+ **Kind**: instance method of [<code>PayPalSavePaymentSourceWidget</code>](#PayPalSavePaymentSourceWidget)
8237
+
8238
+ | Param | Type | Description |
8239
+ | --- | --- | --- |
8240
+ | env | <code>string</code> | sandbox, production |
8241
+ | [alias] | <code>string</code> | Own domain alias |
8242
+
8243
+ **Example**
8244
+ ```js
8245
+ payPalSavePaymentSourceWidget.setEnv('production');
8246
+ ```
8247
+ <a name="PayPalSavePaymentSourceWidget+onSuccess" id="PayPalSavePaymentSourceWidget+onSuccess" href="#PayPalSavePaymentSourceWidget+onSuccess">&nbsp;</a>
8248
+
8249
+ ### payPalSavePaymentSourceWidget.onSuccess([callback])
8250
+ If the setup token was successfully approved and a OTT was generated, the function passed as parameter will be called.
8251
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
8252
+
8253
+ **Kind**: instance method of [<code>PayPalSavePaymentSourceWidget</code>](#PayPalSavePaymentSourceWidget)
8254
+
8255
+ | Param | Type | Description |
8256
+ | --- | --- | --- |
8257
+ | [callback] | [<code>OnSuccessCallback</code>](#OnSuccessCallback) | Function to be called when the result is successful. |
8258
+
8259
+ **Example**
8260
+ ```js
8261
+ payPalSavePaymentSourceWidget.onSuccess((eventData) => console.log('One time token and email obtained successfully'));
8262
+ ```
8263
+ <a name="PayPalSavePaymentSourceWidget+onError" id="PayPalSavePaymentSourceWidget+onError" href="#PayPalSavePaymentSourceWidget+onError">&nbsp;</a>
8264
+
8265
+ ### payPalSavePaymentSourceWidget.onError([callback])
8266
+ If in the process for obtaining the setup token fails, the function passed as parameter will be called.
8267
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
8268
+
8269
+ **Kind**: instance method of [<code>PayPalSavePaymentSourceWidget</code>](#PayPalSavePaymentSourceWidget)
8270
+
8271
+ | Param | Type | Description |
8272
+ | --- | --- | --- |
8273
+ | [callback] | [<code>OnErrorCallback</code>](#OnErrorCallback) | Function to be called when there is an error in the flow. |
8274
+
8275
+ **Example**
8276
+ ```js
8277
+ payPalSavePaymentSourceWidget.onError((eventData) => console.log('Some error occurred'));
8278
+ ```
8279
+ <a name="PayPalSavePaymentSourceWidget+onCancel" id="PayPalSavePaymentSourceWidget+onCancel" href="#PayPalSavePaymentSourceWidget+onCancel">&nbsp;</a>
8280
+
8281
+ ### payPalSavePaymentSourceWidget.onCancel([callback])
8282
+ If in the process for obtaining the setup token was cancelled, the function passed as parameter will be called.
8283
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
8284
+
8285
+ **Kind**: instance method of [<code>PayPalSavePaymentSourceWidget</code>](#PayPalSavePaymentSourceWidget)
8286
+
8287
+ | Param | Type | Description |
8288
+ | --- | --- | --- |
8289
+ | [callback] | [<code>OnCancelCallback</code>](#OnCancelCallback) | Function to be called when the operation is cancelled. |
8290
+
8291
+ **Example**
8292
+ ```js
8293
+ payPalSavePaymentSourceWidget.onCancel(() => console.log('Operation cancelled'));
8294
+ ```
8295
+ <a name="OnSuccessCallback" id="OnSuccessCallback" href="#OnSuccessCallback">&nbsp;</a>
8296
+
8297
+ ## OnSuccessCallback : <code>function</code>
8298
+ Callback for onSuccess method.
8299
+
8300
+ **Kind**: global typedef
8301
+
8302
+ | Param | Type |
8303
+ | --- | --- |
8304
+ | data | [<code>IOnSuccessEventData</code>](#IOnSuccessEventData) |
8305
+
8306
+ <a name="OnErrorCallback" id="OnErrorCallback" href="#OnErrorCallback">&nbsp;</a>
8307
+
8308
+ ## OnErrorCallback : <code>function</code>
8309
+ Callback for onError method.
8310
+
8311
+ **Kind**: global typedef
8312
+
8313
+ | Param | Type |
8314
+ | --- | --- |
8315
+ | data | [<code>IOnErrorEventData</code>](#IOnErrorEventData) |
8316
+
8317
+ <a name="OnCancelCallback" id="OnCancelCallback" href="#OnCancelCallback">&nbsp;</a>
8318
+
8319
+ ## OnCancelCallback : <code>function</code>
8320
+ Callback for onCancel method.
8321
+
8322
+ **Kind**: global typedef
8323
+
8324
+ | Param | Type |
8325
+ | --- | --- |
8326
+ | data | [<code>IOnCancelEventData</code>](#IOnCancelEventData) |
8327
+
8328
+
8329
+ ## PayPalDataCollector Widget
8330
+
8331
+ Widget that collect browser-based data to help reduce fraud. Upon checkout, these data elements are sent directly to PayPal Risk Services for fraud and risk assessment.
8332
+
8333
+ The general flow to use the widgets is:
8334
+ 1. Initialize the PayPal Data Collector Widget, providing a Source Website Identifier (Flow ID), plus optional config parameters for the widget. The general format is:
8335
+ ```js
8336
+ vat paypalDataCollector = new paydock.PayPalDataCollector(
8337
+ sourceWebsiteIdentifier,
8338
+ widgetConfigParams,
8339
+ );
8340
+ ```
8341
+ 2. Handle the `collectDeviceData` function, that will return the generated correlation ID, like following:
8342
+ ```js
8343
+ const collectedDeviceData = await paypalDataCollector.collectDeviceData();
8344
+ const correlationId = collectedDeviceData.correlation_id;
8345
+ ```
8346
+ 3. Use freely the correlation_id value as is needed.
8347
+ 4. Handle the `onError` callback.
8348
+ 5. If you are using Content Security Policy (CSP), you must allowlist the paypal fraudnet script URL: `https://c.paypal.com`. See reference [here](https://developer.paypal.com/limited-release/fraudnet/integrate/#link-contentsecuritypolicyintegration).
8349
+
8350
+ ### PayPalDataCollector Widget example
8351
+
8352
+ A full description of the config parameters for [PayPalDataCollector](#PayPalDataCollector) meta parameters can be found [here](#PayPalDataCollectorConfig). Below you will find a fully working html example.
8353
+
8354
+ ```html
8355
+ <!DOCTYPE html>
8356
+ <html lang="en">
8357
+ <head>
8358
+ <meta charset="UTF-8">
8359
+ <title>Title</title>
8360
+ </head>
8361
+ <body>
8362
+ <h2>Using PayDock PayPalDataCollector Widget!</h2>
8363
+ <div id="widget"></div>
8364
+ </body>
8365
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
8366
+ <script>
8367
+ let payPalDataCollector = new paydock.PayPalDataCollector(
8368
+ sourceWebsiteIdentifier,
8369
+ {
8370
+ mouse_movement: true
8371
+ }
8372
+ );
8373
+
8374
+ payPalDataCollector.setEnv('test');
8375
+
8376
+ payPalDataCollector.onError(function(error) {
8377
+ console.log("On Error Callback", error);
8378
+ });
8379
+
8380
+ const collectedDeviceData = await payPalDataCollector.collectDeviceData();
8381
+
8382
+ //Here when the promise is resolved, it should be able to see the correlation_id.
8383
+ const correlationId = collectedDeviceData.correlation_id
8384
+ </script>
8385
+ </html>
8386
+ ```
8387
+
8388
+ ## Classes
8389
+
8390
+ <dl>
8391
+ <dt><a href="#PayPalDataCollector">PayPalDataCollector</a></dt>
8392
+ <dd><p>PayPal Data Collector Widget constructor</p>
8393
+ </dd>
8394
+ </dl>
8395
+
8396
+ ## Typedefs
8397
+
8398
+ <dl>
8399
+ <dt><a href="#OnErrorCallback">OnErrorCallback</a> : <code>function</code></dt>
8400
+ <dd><p>Callback for onError method.</p>
8401
+ </dd>
8402
+ </dl>
8403
+
8404
+ ## Interfaces
8405
+
8406
+ <dl>
8407
+ <dt><a href="#PayPalDataCollectorConfig">PayPalDataCollectorConfig</a> : <code>object</code></dt>
8408
+ <dd><p>Interface of data used for PayPal configuration. For further information refer to <a href="https://developer.paypal.com/sdk/js/reference/#style">the documentation</a>.</p>
8409
+ </dd>
8410
+ <dt><a href="#CollectedDeviceData">CollectedDeviceData</a> : <code>object</code></dt>
8411
+ <dd><p>Data object with the corresponding <code>correlation_id</code>.</p>
8412
+ </dd>
8413
+ <dt><a href="#IOnErrorEventData">IOnErrorEventData</a> : <code>object</code></dt>
8414
+ <dd><p>Interface for IOnErrorEventData</p>
8415
+ </dd>
8416
+ </dl>
8417
+
8418
+ <a name="PayPalDataCollectorConfig" id="PayPalDataCollectorConfig" href="#PayPalDataCollectorConfig">&nbsp;</a>
8419
+
8420
+ ## PayPalDataCollectorConfig : <code>object</code>
8421
+ Interface of data used for PayPal configuration. For further information refer to [the documentation](https://developer.paypal.com/sdk/js/reference/#style).
8422
+
8423
+ **Kind**: global interface
8424
+
8425
+ | Param | Type | Description |
8426
+ | --- | --- | --- |
8427
+ | [mouse_movement] | <code>boolean</code> | Used for indicating if is enabled mouse movement collection. |
8428
+
8429
+ <a name="CollectedDeviceData" id="CollectedDeviceData" href="#CollectedDeviceData">&nbsp;</a>
8430
+
8431
+ ## CollectedDeviceData : <code>object</code>
8432
+ Data object with the corresponding `correlation_id`.
8433
+
8434
+ **Kind**: global interface
8435
+
8436
+ | Param | Type | Description |
8437
+ | --- | --- | --- |
8438
+ | [correlation_id] | <code>string</code> | The correlation ID that was used on the subsecuent requests. |
8439
+
8440
+ <a name="IOnErrorEventData" id="IOnErrorEventData" href="#IOnErrorEventData">&nbsp;</a>
8441
+
8442
+ ## IOnErrorEventData : <code>object</code>
8443
+ Interface for IOnErrorEventData
8444
+
8445
+ **Kind**: global interface
8446
+
8447
+ | Param | Type | Description |
8448
+ | --- | --- | --- |
8449
+ | error_code | <code>string</code> | Error code. One of 'promise_not_enabled' or 'script_error'. |
8450
+
8451
+ <a name="PayPalDataCollector" id="PayPalDataCollector" href="#PayPalDataCollector">&nbsp;</a>
8452
+
8453
+ ## PayPalDataCollector
8454
+ PayPal Data Collector Widget constructor
8455
+
8456
+ **Kind**: global class
8457
+
8458
+ * [PayPalDataCollector](#PayPalDataCollector)
8459
+ * [new PayPalDataCollector(flowId, config)](#new_PayPalDataCollector_new)
8460
+ * [.collectDeviceData()](#PayPalDataCollector+collectDeviceData) ⇒ [<code>Promise.&lt;CollectedDeviceData&gt;</code>](#CollectedDeviceData)
8461
+ * [.onError([callback])](#PayPalDataCollector+onError)
8462
+ * [.setEnv(env)](#PayPalDataCollector+setEnv)
8463
+
8464
+ <a name="new_PayPalDataCollector_new" id="new_PayPalDataCollector_new" href="#new_PayPalDataCollector_new">&nbsp;</a>
8465
+
8466
+ ### new PayPalDataCollector(flowId, config)
8467
+
8468
+ | Param | Type | Description |
8469
+ | --- | --- | --- |
8470
+ | flowId | <code>string</code> | This string identifies the source website of the FraudNet request. |
8471
+ | config | [<code>PayPalDataCollectorConfig</code>](#PayPalDataCollectorConfig) | Extra configuration for the widget. |
8472
+
8473
+ **Example**
8474
+ ```js
8475
+ var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
8476
+ ```
8477
+ <a name="PayPalDataCollector+collectDeviceData" id="PayPalDataCollector+collectDeviceData" href="#PayPalDataCollector+collectDeviceData">&nbsp;</a>
8478
+
8479
+ ### payPalDataCollector.collectDeviceData() ⇒ [<code>Promise.&lt;CollectedDeviceData&gt;</code>](#CollectedDeviceData)
8480
+ After configuring the PayPalDataCollector Widget, starts the process and returns
8481
+ the correlation id used among the requests.
8482
+
8483
+ **Kind**: instance method of [<code>PayPalDataCollector</code>](#PayPalDataCollector)
8484
+ **Returns**: [<code>Promise.&lt;CollectedDeviceData&gt;</code>](#CollectedDeviceData) - Promise when resolved, returnsa an object
8485
+ that contains the `correlation_id` key.
8486
+ **Example**
8487
+ ```js
8488
+ const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
8489
+ console.log(collectedDeviceData.correlation_id)
8490
+ ```
8491
+ <a name="PayPalDataCollector+onError" id="PayPalDataCollector+onError" href="#PayPalDataCollector+onError">&nbsp;</a>
8492
+
8493
+ ### payPalDataCollector.onError([callback])
8494
+ If the process fails, the function passed as parameter will be called.
8495
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
8496
+
8497
+ **Kind**: instance method of [<code>PayPalDataCollector</code>](#PayPalDataCollector)
8498
+
8499
+ | Param | Type | Description |
8500
+ | --- | --- | --- |
8501
+ | [callback] | [<code>OnErrorCallback</code>](#OnErrorCallback) | Function to be called when there is an error in the flow. |
8502
+
8503
+ **Example**
8504
+ ```js
8505
+ PayPalDataCollector.onError((eventData) => console.log('Some error occur'));
8506
+ ```
8507
+ <a name="PayPalDataCollector+setEnv" id="PayPalDataCollector+setEnv" href="#PayPalDataCollector+setEnv">&nbsp;</a>
8508
+
8509
+ ### payPalDataCollector.setEnv(env)
8510
+ Current method can change environment. By default environment = test.
8511
+ This method does not affect Paydock's API calls or environments, is only for PayPal Data Collector
8512
+ script, in order to know if the script is injected on a live server or is a testing
8513
+ environment. The available values are `test` and `live`. This should match with the used
8514
+ `gateway.mode` in Paydock to process the transaction.
8515
+
8516
+ **Kind**: instance method of [<code>PayPalDataCollector</code>](#PayPalDataCollector)
8517
+
8518
+ | Param | Type | Description |
8519
+ | --- | --- | --- |
8520
+ | env | <code>string</code> | test, live |
8521
+
8522
+ **Example**
8523
+ ```js
8524
+ PayPalDataCollector.setEnv('live');
8525
+ ```
8526
+ <a name="OnErrorCallback" id="OnErrorCallback" href="#OnErrorCallback">&nbsp;</a>
8527
+
8528
+ ## OnErrorCallback : <code>function</code>
8529
+ Callback for onError method.
8530
+
8531
+ **Kind**: global typedef
8532
+
8533
+ | Param | Type |
8534
+ | --- | --- |
8535
+ | data | [<code>IOnErrorEventData</code>](#IOnErrorEventData) \| <code>null</code> |
6907
8536
 
6908
8537
 
6909
8538
  ## License
6910
- Copyright (c) 2023 paydock
8539
+ Copyright (c) 2024 paydock