@bigcommerce/checkout-sdk 1.271.1 → 1.271.2

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 (366) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/checkout-button.d.ts +651 -730
  3. package/dist/checkout-button.js +1 -1
  4. package/dist/checkout-button.js.map +1 -1
  5. package/dist/checkout-button.umd.js +1 -1
  6. package/dist/checkout-button.umd.js.map +1 -1
  7. package/dist/checkout-sdk.d.ts +763 -7438
  8. package/dist/checkout-sdk.js +1 -1
  9. package/dist/checkout-sdk.js.map +1 -1
  10. package/dist/checkout-sdk.umd.js +1 -1
  11. package/dist/checkout-sdk.umd.js.map +1 -1
  12. package/dist/embedded-checkout.d.ts +218 -242
  13. package/dist/internal-mappers.d.ts +763 -762
  14. package/dist/tsdoc-metadata.json +11 -11
  15. package/docs/README.md +126 -811
  16. package/docs/classes/CacheKeyResolver.md +58 -0
  17. package/package.json +2 -2
  18. package/docs/classes/CartChangedError.md +0 -76
  19. package/docs/classes/CheckoutButtonErrorSelector.md +0 -52
  20. package/docs/classes/CheckoutButtonInitializer.md +0 -177
  21. package/docs/classes/CheckoutButtonStatusSelector.md +0 -52
  22. package/docs/classes/CheckoutService.md +0 -1645
  23. package/docs/classes/CurrencyService.md +0 -54
  24. package/docs/classes/EmbeddedCheckout.md +0 -40
  25. package/docs/classes/LanguageService.md +0 -101
  26. package/docs/classes/RequestError.md +0 -106
  27. package/docs/classes/StandardError.md +0 -71
  28. package/docs/enums/AmazonPayV2CheckoutLanguage.md +0 -57
  29. package/docs/enums/AmazonPayV2LedgerCurrency.md +0 -36
  30. package/docs/enums/AmazonPayV2PayOptions.md +0 -26
  31. package/docs/enums/AmazonPayV2Placement.md +0 -53
  32. package/docs/enums/BraintreeFormFieldType.md +0 -50
  33. package/docs/enums/ButtonColor.md +0 -29
  34. package/docs/enums/ButtonType.md +0 -22
  35. package/docs/enums/CheckoutButtonMethodType.md +0 -141
  36. package/docs/enums/CheckoutIncludes.md +0 -29
  37. package/docs/enums/EmbeddedCheckoutEventType.md +0 -50
  38. package/docs/enums/HostedFieldType.md +0 -50
  39. package/docs/enums/HostedInputEventType.md +0 -85
  40. package/docs/enums/IconStyle.md +0 -22
  41. package/docs/enums/PaypalButtonStyleColorOption.md +0 -36
  42. package/docs/enums/PaypalButtonStyleLabelOption.md +0 -43
  43. package/docs/enums/PaypalButtonStyleLayoutOption.md +0 -22
  44. package/docs/enums/PaypalButtonStyleShapeOption.md +0 -22
  45. package/docs/enums/PaypalButtonStyleSizeOption.md +0 -36
  46. package/docs/enums/PaypalCommerceFormFieldType.md +0 -50
  47. package/docs/enums/RadiusUnit.md +0 -22
  48. package/docs/enums/StyleButtonColor.md +0 -43
  49. package/docs/enums/StyleButtonLabel.md +0 -43
  50. package/docs/enums/StyleButtonLayout.md +0 -22
  51. package/docs/enums/StyleButtonShape.md +0 -22
  52. package/docs/interfaces/Address.md +0 -164
  53. package/docs/interfaces/AddressRequestBody.md +0 -100
  54. package/docs/interfaces/AdyenAdditionalActionCallbacks.md +0 -68
  55. package/docs/interfaces/AdyenAdditionalActionCallbacks_2.md +0 -66
  56. package/docs/interfaces/AdyenAdditionalActionOptions.md +0 -106
  57. package/docs/interfaces/AdyenAdditionalActionOptions_2.md +0 -106
  58. package/docs/interfaces/AdyenBaseCardComponentOptions.md +0 -33
  59. package/docs/interfaces/AdyenBaseCardComponentOptions_2.md +0 -33
  60. package/docs/interfaces/AdyenComponent.md +0 -72
  61. package/docs/interfaces/AdyenComponentEvents.md +0 -74
  62. package/docs/interfaces/AdyenComponentEvents_2.md +0 -74
  63. package/docs/interfaces/AdyenComponent_2.md +0 -72
  64. package/docs/interfaces/AdyenCreditCardComponentOptions.md +0 -185
  65. package/docs/interfaces/AdyenIdealComponentOptions.md +0 -17
  66. package/docs/interfaces/AdyenPaymentMethodState.md +0 -21
  67. package/docs/interfaces/AdyenPaymentMethodState_2.md +0 -15
  68. package/docs/interfaces/AdyenPlaceholderData.md +0 -33
  69. package/docs/interfaces/AdyenPlaceholderData_2.md +0 -33
  70. package/docs/interfaces/AdyenThreeDS2Options.md +0 -97
  71. package/docs/interfaces/AdyenV2PaymentInitializeOptions.md +0 -161
  72. package/docs/interfaces/AdyenV3CreditCardComponentOptions.md +0 -185
  73. package/docs/interfaces/AdyenV3PaymentInitializeOptions.md +0 -135
  74. package/docs/interfaces/AmazonPayCustomerInitializeOptions.md +0 -65
  75. package/docs/interfaces/AmazonPayOrderReference.md +0 -30
  76. package/docs/interfaces/AmazonPayPaymentInitializeOptions.md +0 -100
  77. package/docs/interfaces/AmazonPayShippingInitializeOptions.md +0 -85
  78. package/docs/interfaces/AmazonPayV2ButtonParams.md +0 -71
  79. package/docs/interfaces/AmazonPayV2CheckoutSession.md +0 -35
  80. package/docs/interfaces/AmazonPayV2CustomerInitializeOptions.md +0 -24
  81. package/docs/interfaces/AmazonPayV2PaymentInitializeOptions.md +0 -39
  82. package/docs/interfaces/AmazonPayV2ShippingInitializeOptions.md +0 -26
  83. package/docs/interfaces/AmazonPayWidgetError.md +0 -25
  84. package/docs/interfaces/ApplePayButtonInitializeOptions.md +0 -38
  85. package/docs/interfaces/ApplePayButtonInitializeOptions_2.md +0 -38
  86. package/docs/interfaces/ApplePayCustomerInitializeOptions.md +0 -77
  87. package/docs/interfaces/ApplePayCustomerInitializeOptions_2.md +0 -77
  88. package/docs/interfaces/ApplePayPaymentInitializeOptions.md +0 -40
  89. package/docs/interfaces/ApplePayPaymentInitializeOptions_2.md +0 -40
  90. package/docs/interfaces/BankInstrument.md +0 -112
  91. package/docs/interfaces/Banner.md +0 -22
  92. package/docs/interfaces/BaseAccountInstrument.md +0 -91
  93. package/docs/interfaces/BaseElementOptions.md +0 -17
  94. package/docs/interfaces/BaseElementOptions_2.md +0 -48
  95. package/docs/interfaces/BaseIndividualElementOptions.md +0 -67
  96. package/docs/interfaces/BaseInstrument.md +0 -58
  97. package/docs/interfaces/BillingAddress.md +0 -182
  98. package/docs/interfaces/BillingAddressRequestBody.md +0 -153
  99. package/docs/interfaces/BlockElementStyles.md +0 -105
  100. package/docs/interfaces/BlueSnapV2PaymentInitializeOptions.md +0 -72
  101. package/docs/interfaces/BlueSnapV2StyleProps.md +0 -29
  102. package/docs/interfaces/BodyStyles.md +0 -15
  103. package/docs/interfaces/BoltCustomerInitializeOptions.md +0 -30
  104. package/docs/interfaces/BoltPaymentInitializeOptions.md +0 -94
  105. package/docs/interfaces/BraintreeError.md +0 -35
  106. package/docs/interfaces/BraintreeFormFieldCardTypeChangeEventData.md +0 -15
  107. package/docs/interfaces/BraintreeFormFieldKeyboardEventData.md +0 -15
  108. package/docs/interfaces/BraintreeFormFieldOptions.md +0 -35
  109. package/docs/interfaces/BraintreeFormFieldStylesMap.md +0 -29
  110. package/docs/interfaces/BraintreeFormFieldValidateErrorData.md +0 -29
  111. package/docs/interfaces/BraintreeFormFieldValidateEventData.md +0 -33
  112. package/docs/interfaces/BraintreeFormFieldsMap.md +0 -36
  113. package/docs/interfaces/BraintreeFormOptions.md +0 -110
  114. package/docs/interfaces/BraintreePaymentInitializeOptions.md +0 -101
  115. package/docs/interfaces/BraintreePaypalButtonInitializeOptions.md +0 -96
  116. package/docs/interfaces/BraintreePaypalCreditButtonInitializeOptions.md +0 -87
  117. package/docs/interfaces/BraintreeStoredCardFieldOptions.md +0 -54
  118. package/docs/interfaces/BraintreeStoredCardFieldsMap.md +0 -22
  119. package/docs/interfaces/BraintreeThreeDSecureOptions.md +0 -51
  120. package/docs/interfaces/BraintreeVenmoButtonInitializeOptions.md +0 -27
  121. package/docs/interfaces/BraintreeVerifyPayload.md +0 -51
  122. package/docs/interfaces/BraintreeVisaCheckoutCustomerInitializeOptions.md +0 -35
  123. package/docs/interfaces/BraintreeVisaCheckoutPaymentInitializeOptions.md +0 -70
  124. package/docs/interfaces/BrowserInfo.md +0 -50
  125. package/docs/interfaces/ButtonResponse.md +0 -19
  126. package/docs/interfaces/ButtonStyles.md +0 -141
  127. package/docs/interfaces/CardCvcElementOptions.md +0 -72
  128. package/docs/interfaces/CardDataPaymentMethodState.md +0 -15
  129. package/docs/interfaces/CardDataPaymentMethodState_2.md +0 -15
  130. package/docs/interfaces/CardElementOptions.md +0 -91
  131. package/docs/interfaces/CardExpiryElementOptions.md +0 -72
  132. package/docs/interfaces/CardInstrument.md +0 -115
  133. package/docs/interfaces/CardNumberElementOptions.md +0 -88
  134. package/docs/interfaces/CardPaymentMethodState.md +0 -60
  135. package/docs/interfaces/CardPaymentMethodState_2.md +0 -43
  136. package/docs/interfaces/CardState.md +0 -40
  137. package/docs/interfaces/CardStateErrors.md +0 -7
  138. package/docs/interfaces/CardStateErrors_2.md +0 -7
  139. package/docs/interfaces/CardState_2.md +0 -40
  140. package/docs/interfaces/Cart.md +0 -99
  141. package/docs/interfaces/ChasePayCustomerInitializeOptions.md +0 -15
  142. package/docs/interfaces/ChasePayInitializeOptions.md +0 -98
  143. package/docs/interfaces/CheckableInputStyles.md +0 -175
  144. package/docs/interfaces/ChecklistStyles.md +0 -127
  145. package/docs/interfaces/Checkout.md +0 -195
  146. package/docs/interfaces/CheckoutButtonInitializeOptions_3.md +0 -68
  147. package/docs/interfaces/CheckoutButtonInitializeOptions_4.md +0 -244
  148. package/docs/interfaces/CheckoutButtonInitializerOptions.md +0 -22
  149. package/docs/interfaces/CheckoutButtonOptions.md +0 -55
  150. package/docs/interfaces/CheckoutButtonOptions_2.md +0 -55
  151. package/docs/interfaces/CheckoutButtonSelectors.md +0 -22
  152. package/docs/interfaces/CheckoutParams.md +0 -15
  153. package/docs/interfaces/CheckoutPayment.md +0 -42
  154. package/docs/interfaces/CheckoutRequestBody.md +0 -15
  155. package/docs/interfaces/CheckoutSelectors.md +0 -29
  156. package/docs/interfaces/CheckoutServiceOptions.md +0 -36
  157. package/docs/interfaces/CheckoutSettings.md +0 -201
  158. package/docs/interfaces/CheckoutStoreErrorSelector.md +0 -636
  159. package/docs/interfaces/CheckoutStoreSelector.md +0 -501
  160. package/docs/interfaces/CheckoutStoreStatusSelector.md +0 -758
  161. package/docs/interfaces/Consignment.md +0 -71
  162. package/docs/interfaces/ConsignmentAssignmentBaseRequestBodyWithAddress.md +0 -29
  163. package/docs/interfaces/ConsignmentAssignmentBaseRequestBodyWithShippingAddress.md +0 -29
  164. package/docs/interfaces/ConsignmentCreateRequestBody.md +0 -36
  165. package/docs/interfaces/ConsignmentLineItem.md +0 -22
  166. package/docs/interfaces/ConsignmentPickupOption.md +0 -15
  167. package/docs/interfaces/ConsignmentUpdateRequestBody.md +0 -43
  168. package/docs/interfaces/Coordinates.md +0 -22
  169. package/docs/interfaces/Country.md +0 -43
  170. package/docs/interfaces/Coupon.md +0 -43
  171. package/docs/interfaces/CreditCardInstrument.md +0 -85
  172. package/docs/interfaces/CreditCardPaymentInitializeOptions.md +0 -91
  173. package/docs/interfaces/CreditCardPlaceHolder.md +0 -29
  174. package/docs/interfaces/CreditCardPlaceHolder_2.md +0 -29
  175. package/docs/interfaces/CssProperties.md +0 -211
  176. package/docs/interfaces/CssProperties_2.md +0 -211
  177. package/docs/interfaces/Currency.md +0 -36
  178. package/docs/interfaces/CustomError.md +0 -43
  179. package/docs/interfaces/CustomItem.md +0 -50
  180. package/docs/interfaces/Customer.md +0 -84
  181. package/docs/interfaces/CustomerAccountRequestBody.md +0 -50
  182. package/docs/interfaces/CustomerAddress.md +0 -182
  183. package/docs/interfaces/CustomerCredentials.md +0 -22
  184. package/docs/interfaces/CustomerGroup.md +0 -22
  185. package/docs/interfaces/CustomerInitializeOptions_3.md +0 -29
  186. package/docs/interfaces/CustomerInitializeOptions_4.md +0 -221
  187. package/docs/interfaces/CustomerPasswordRequirements.md +0 -36
  188. package/docs/interfaces/CustomerRequestOptions.md +0 -23
  189. package/docs/interfaces/CustomerRequestOptions_2.md +0 -60
  190. package/docs/interfaces/DigitalItem.md +0 -310
  191. package/docs/interfaces/DigitalRiverElementClasses.md +0 -67
  192. package/docs/interfaces/DigitalRiverPaymentInitializeOptions.md +0 -146
  193. package/docs/interfaces/Discount.md +0 -22
  194. package/docs/interfaces/EmbeddedCheckoutCompleteEvent.md +0 -15
  195. package/docs/interfaces/EmbeddedCheckoutError.md +0 -29
  196. package/docs/interfaces/EmbeddedCheckoutErrorEvent.md +0 -22
  197. package/docs/interfaces/EmbeddedCheckoutFrameErrorEvent.md +0 -22
  198. package/docs/interfaces/EmbeddedCheckoutFrameLoadedEvent.md +0 -22
  199. package/docs/interfaces/EmbeddedCheckoutLoadedEvent.md +0 -15
  200. package/docs/interfaces/EmbeddedCheckoutMessenger.md +0 -109
  201. package/docs/interfaces/EmbeddedCheckoutMessengerOptions.md +0 -22
  202. package/docs/interfaces/EmbeddedCheckoutOptions.md +0 -134
  203. package/docs/interfaces/EmbeddedCheckoutSignedOutEvent.md +0 -15
  204. package/docs/interfaces/EmbeddedCheckoutStyles.md +0 -141
  205. package/docs/interfaces/EmbeddedContentOptions.md +0 -15
  206. package/docs/interfaces/ExecutePaymentMethodCheckoutOptions.md +0 -76
  207. package/docs/interfaces/FlashMessage.md +0 -29
  208. package/docs/interfaces/FormField.md +0 -113
  209. package/docs/interfaces/FormFieldItem.md +0 -22
  210. package/docs/interfaces/FormFieldOptions.md +0 -29
  211. package/docs/interfaces/FormFields.md +0 -29
  212. package/docs/interfaces/GatewayOrderPayment.md +0 -108
  213. package/docs/interfaces/GiftCertificate.md +0 -43
  214. package/docs/interfaces/GiftCertificateItem.md +0 -78
  215. package/docs/interfaces/GiftCertificateOrderPayment.md +0 -94
  216. package/docs/interfaces/GooglePayButtonInitializeOptions.md +0 -31
  217. package/docs/interfaces/GooglePayCustomerInitializeOptions.md +0 -42
  218. package/docs/interfaces/GooglePayPaymentInitializeOptions.md +0 -93
  219. package/docs/interfaces/HostedCardFieldOptions.md +0 -35
  220. package/docs/interfaces/HostedCardFieldOptionsMap.md +0 -36
  221. package/docs/interfaces/HostedFieldStylesMap.md +0 -29
  222. package/docs/interfaces/HostedFormOptions.md +0 -114
  223. package/docs/interfaces/HostedInputBlurEvent.md +0 -28
  224. package/docs/interfaces/HostedInputCardTypeChangeEvent.md +0 -28
  225. package/docs/interfaces/HostedInputEnterEvent.md +0 -28
  226. package/docs/interfaces/HostedInputFocusEvent.md +0 -28
  227. package/docs/interfaces/HostedInputValidateErrorData.md +0 -29
  228. package/docs/interfaces/HostedInputValidateErrorDataMap.md +0 -50
  229. package/docs/interfaces/HostedInputValidateEvent.md +0 -22
  230. package/docs/interfaces/HostedInputValidateResults.md +0 -22
  231. package/docs/interfaces/HostedInstrument.md +0 -22
  232. package/docs/interfaces/HostedStoredCardFieldOptions.md +0 -54
  233. package/docs/interfaces/HostedStoredCardFieldOptionsMap.md +0 -22
  234. package/docs/interfaces/IbanElementOptions.md +0 -82
  235. package/docs/interfaces/IdealElementOptions.md +0 -70
  236. package/docs/interfaces/IndividualCardElementOptions.md +0 -36
  237. package/docs/interfaces/InitializationStrategy.md +0 -21
  238. package/docs/interfaces/InlineElementStyles.md +0 -53
  239. package/docs/interfaces/InputDetail.md +0 -80
  240. package/docs/interfaces/InputDetail_2.md +0 -80
  241. package/docs/interfaces/InputStyles.md +0 -152
  242. package/docs/interfaces/Item.md +0 -22
  243. package/docs/interfaces/Item_2.md +0 -26
  244. package/docs/interfaces/Item_3.md +0 -26
  245. package/docs/interfaces/KlarnaLoadResponse.md +0 -28
  246. package/docs/interfaces/KlarnaLoadResponse_2.md +0 -28
  247. package/docs/interfaces/KlarnaPaymentInitializeOptions.md +0 -73
  248. package/docs/interfaces/KlarnaV2PaymentInitializeOptions.md +0 -73
  249. package/docs/interfaces/LabelStyles.md +0 -76
  250. package/docs/interfaces/LanguageConfig.md +0 -57
  251. package/docs/interfaces/LineItem.md +0 -191
  252. package/docs/interfaces/LineItemCategory.md +0 -15
  253. package/docs/interfaces/LineItemMap.md +0 -36
  254. package/docs/interfaces/LineItemOption.md +0 -36
  255. package/docs/interfaces/LineItemSocialData.md +0 -36
  256. package/docs/interfaces/LinkStyles.md +0 -90
  257. package/docs/interfaces/LoadingIndicatorStyles.md +0 -29
  258. package/docs/interfaces/Locales.md +0 -7
  259. package/docs/interfaces/MasterpassCustomerInitializeOptions.md +0 -17
  260. package/docs/interfaces/MasterpassPaymentInitializeOptions.md +0 -35
  261. package/docs/interfaces/MolliePaymentInitializeOptions.md +0 -96
  262. package/docs/interfaces/MonerisPaymentInitializeOptions.md +0 -57
  263. package/docs/interfaces/MonerisStylingProps.md +0 -80
  264. package/docs/interfaces/NonceGenerationError.md +0 -29
  265. package/docs/interfaces/NonceInstrument.md +0 -36
  266. package/docs/interfaces/Option.md +0 -22
  267. package/docs/interfaces/OptionsResponse.md +0 -77
  268. package/docs/interfaces/OpyPaymentInitializeOptions.md +0 -40
  269. package/docs/interfaces/Order.md +0 -190
  270. package/docs/interfaces/OrderConsignment.md +0 -15
  271. package/docs/interfaces/OrderPayment.md +0 -58
  272. package/docs/interfaces/OrderPaymentRequestBody.md +0 -39
  273. package/docs/interfaces/OrderRequestBody.md +0 -33
  274. package/docs/interfaces/OrderShippingConsignment.md +0 -218
  275. package/docs/interfaces/PasswordRequirements.md +0 -36
  276. package/docs/interfaces/PayPalInstrument.md +0 -91
  277. package/docs/interfaces/PaymentInitializeOptions_3.md +0 -74
  278. package/docs/interfaces/PaymentInitializeOptions_4.md +0 -406
  279. package/docs/interfaces/PaymentMethod.md +0 -98
  280. package/docs/interfaces/PaymentMethodConfig.md +0 -120
  281. package/docs/interfaces/PaymentRequestOptions.md +0 -67
  282. package/docs/interfaces/PaymentRequestOptions_2.md +0 -67
  283. package/docs/interfaces/PaymentSettings.md +0 -22
  284. package/docs/interfaces/PaypalButtonInitializeOptions.md +0 -76
  285. package/docs/interfaces/PaypalButtonStyleOptions.md +0 -64
  286. package/docs/interfaces/PaypalButtonStyleOptions_2.md +0 -50
  287. package/docs/interfaces/PaypalCommerceAlternativeMethodsButtonOptions.md +0 -35
  288. package/docs/interfaces/PaypalCommerceButtonInitializeOptions.md +0 -26
  289. package/docs/interfaces/PaypalCommerceCreditCardPaymentInitializeOptions.md +0 -90
  290. package/docs/interfaces/PaypalCommerceFormFieldCardTypeChangeEventData.md +0 -15
  291. package/docs/interfaces/PaypalCommerceFormFieldKeyboardEventData.md +0 -15
  292. package/docs/interfaces/PaypalCommerceFormFieldOptions.md +0 -28
  293. package/docs/interfaces/PaypalCommerceFormFieldStylesMap.md +0 -29
  294. package/docs/interfaces/PaypalCommerceFormFieldValidateErrorData.md +0 -29
  295. package/docs/interfaces/PaypalCommerceFormFieldValidateEventData.md +0 -33
  296. package/docs/interfaces/PaypalCommerceFormFieldsMap.md +0 -36
  297. package/docs/interfaces/PaypalCommerceFormOptions.md +0 -148
  298. package/docs/interfaces/PaypalCommercePaymentInitializeOptions.md +0 -186
  299. package/docs/interfaces/PaypalCommerceStoredCardFieldOptions.md +0 -43
  300. package/docs/interfaces/PaypalCommerceStoredCardFieldsMap.md +0 -22
  301. package/docs/interfaces/PaypalCommerceVenmoButtonInitializeOptions.md +0 -26
  302. package/docs/interfaces/PaypalExpressPaymentInitializeOptions.md +0 -36
  303. package/docs/interfaces/PaypalFieldsStyleOptions.md +0 -46
  304. package/docs/interfaces/PhysicalItem.md +0 -311
  305. package/docs/interfaces/PickupMethod.md +0 -43
  306. package/docs/interfaces/PickupOptionRequestBody.md +0 -22
  307. package/docs/interfaces/PickupOptionResult.md +0 -15
  308. package/docs/interfaces/Promotion.md +0 -15
  309. package/docs/interfaces/Radius.md +0 -22
  310. package/docs/interfaces/Region.md +0 -22
  311. package/docs/interfaces/RequestOptions.md +0 -48
  312. package/docs/interfaces/RequestOptions_2.md +0 -44
  313. package/docs/interfaces/SearchArea.md +0 -22
  314. package/docs/interfaces/SepaPlaceHolder.md +0 -22
  315. package/docs/interfaces/SepaPlaceHolder_2.md +0 -22
  316. package/docs/interfaces/ShippingInitializeOptions.md +0 -88
  317. package/docs/interfaces/ShippingOption.md +0 -64
  318. package/docs/interfaces/ShippingRequestOptions.md +0 -65
  319. package/docs/interfaces/ShopperConfig.md +0 -29
  320. package/docs/interfaces/ShopperCurrency.md +0 -94
  321. package/docs/interfaces/SignInEmail.md +0 -22
  322. package/docs/interfaces/SignInEmailRequestBody.md +0 -22
  323. package/docs/interfaces/SpamProtectionOptions.md +0 -25
  324. package/docs/interfaces/SquareFormElement.md +0 -28
  325. package/docs/interfaces/SquarePaymentInitializeOptions.md +0 -131
  326. package/docs/interfaces/StepStyles.md +0 -120
  327. package/docs/interfaces/StepTracker.md +0 -64
  328. package/docs/interfaces/StepTrackerConfig.md +0 -15
  329. package/docs/interfaces/StoreConfig.md +0 -109
  330. package/docs/interfaces/StoreCurrency.md +0 -56
  331. package/docs/interfaces/StoreLinks.md +0 -57
  332. package/docs/interfaces/StoreProfile.md +0 -71
  333. package/docs/interfaces/StripeElementCSSProperties.md +0 -170
  334. package/docs/interfaces/StripeElementClasses.md +0 -63
  335. package/docs/interfaces/StripeElementStyle.md +0 -44
  336. package/docs/interfaces/StripeElementStyleVariant.md +0 -285
  337. package/docs/interfaces/StripeUPEPaymentInitializeOptions.md +0 -70
  338. package/docs/interfaces/StripeV3PaymentInitializeOptions.md +0 -76
  339. package/docs/interfaces/StyleOptions.md +0 -44
  340. package/docs/interfaces/StyleOptions_2.md +0 -44
  341. package/docs/interfaces/SubInputDetail.md +0 -62
  342. package/docs/interfaces/SubInputDetail_2.md +0 -62
  343. package/docs/interfaces/Subscriptions.md +0 -29
  344. package/docs/interfaces/Tax.md +0 -22
  345. package/docs/interfaces/TextInputStyles.md +0 -175
  346. package/docs/interfaces/ThreeDSecure.md +0 -50
  347. package/docs/interfaces/ThreeDSecureToken.md +0 -15
  348. package/docs/interfaces/TranslationData.md +0 -7
  349. package/docs/interfaces/Translations.md +0 -7
  350. package/docs/interfaces/UnknownObject.md +0 -7
  351. package/docs/interfaces/VaultedInstrument.md +0 -29
  352. package/docs/interfaces/WechatDataPaymentMethodState.md +0 -15
  353. package/docs/interfaces/WechatDataPaymentMethodState_2.md +0 -15
  354. package/docs/interfaces/WechatState.md +0 -15
  355. package/docs/interfaces/WechatState_2.md +0 -15
  356. package/docs/interfaces/WithAccountCreation.md +0 -15
  357. package/docs/interfaces/WithApplePayButtonInitializeOptions.md +0 -15
  358. package/docs/interfaces/WithApplePayCustomerInitializeOptions.md +0 -15
  359. package/docs/interfaces/WithApplePayPaymentInitializeOptions.md +0 -15
  360. package/docs/interfaces/WithCheckoutcomFawryInstrument.md +0 -22
  361. package/docs/interfaces/WithCheckoutcomSEPAInstrument.md +0 -22
  362. package/docs/interfaces/WithCheckoutcomiDealInstrument.md +0 -15
  363. package/docs/interfaces/WithDocumentInstrument.md +0 -15
  364. package/docs/interfaces/WithMollieIssuerInstrument.md +0 -22
  365. package/docs/interfaces/WorldpayPaymentInitializeOptions.md +0 -30
  366. package/docs/interfaces/ZipCodeElementOptions.md +0 -15
@@ -1,730 +1,651 @@
1
- import { Timeout } from '@bigcommerce/request-sender';
2
- import { createTimeout } from '@bigcommerce/request-sender';
3
-
4
- declare interface Address extends AddressRequestBody {
5
- country: string;
6
- shouldSaveAddress?: boolean;
7
- }
8
-
9
- declare interface AddressRequestBody {
10
- firstName: string;
11
- lastName: string;
12
- company: string;
13
- address1: string;
14
- address2: string;
15
- city: string;
16
- stateOrProvince: string;
17
- stateOrProvinceCode: string;
18
- countryCode: string;
19
- postalCode: string;
20
- phone: string;
21
- customFields: Array<{
22
- fieldId: string;
23
- fieldValue: string | number | string[];
24
- }>;
25
- }
26
-
27
- /**
28
- * The required config to render the AmazonPayV2 buttton.
29
- */
30
- declare type AmazonPayV2ButtonInitializeOptions = AmazonPayV2ButtonParams;
31
-
32
- declare interface AmazonPayV2ButtonParams {
33
- /**
34
- * Amazon Pay merchant account identifier.
35
- */
36
- merchantId: string;
37
- /**
38
- * Configuration for calling the endpoint to Create Checkout Session.
39
- */
40
- createCheckoutSession: AmazonPayV2CheckoutSession;
41
- /**
42
- * Placement of the Amazon Pay button on your website.
43
- */
44
- placement: AmazonPayV2Placement;
45
- /**
46
- * Ledger currency provided during registration for the given merchant identifier.
47
- */
48
- ledgerCurrency: AmazonPayV2LedgerCurrency;
49
- /**
50
- * Product type selected for checkout. Default is 'PayAndShip'.
51
- */
52
- productType?: AmazonPayV2PayOptions;
53
- /**
54
- * Language used to render the button and text on Amazon Pay hosted pages.
55
- */
56
- checkoutLanguage?: AmazonPayV2CheckoutLanguage;
57
- /**
58
- * Sets button to Sandbox environment. Default is false.
59
- */
60
- sandbox?: boolean;
61
- }
62
-
63
- declare enum AmazonPayV2CheckoutLanguage {
64
- en_US = "en_US",
65
- en_GB = "en_GB",
66
- de_DE = "de_DE",
67
- fr_FR = "fr_FR",
68
- it_IT = "it_IT",
69
- es_ES = "es_ES",
70
- ja_JP = "ja_JP"
71
- }
72
-
73
- declare interface AmazonPayV2CheckoutSession {
74
- /**
75
- * Endpoint URL to Create Checkout Session.
76
- */
77
- url: string;
78
- /**
79
- * HTTP request method. Default is 'POST'.
80
- */
81
- method?: 'GET' | 'POST';
82
- /**
83
- * Checkout Session ID parameter in the response. Default is 'checkoutSessionId'.
84
- */
85
- extractAmazonCheckoutSessionId?: string;
86
- }
87
-
88
- declare enum AmazonPayV2LedgerCurrency {
89
- USD = "USD",
90
- EUR = "EUR",
91
- GBP = "GBP",
92
- JPY = "JPY"
93
- }
94
-
95
- declare enum AmazonPayV2PayOptions {
96
- /** Select this product type if you need the buyer's shipping details. */
97
- PayAndShip = "PayAndShip",
98
- /** Select this product type if you do not need the buyer's shipping details. */
99
- PayOnly = "PayOnly"
100
- }
101
-
102
- declare enum AmazonPayV2Placement {
103
- /** Initial or main page. */
104
- Home = "Home",
105
- /** Product details page. */
106
- Product = "Product",
107
- /** Cart review page before buyer starts checkout. */
108
- Cart = "Cart",
109
- /** Any page after buyer starts checkout. */
110
- Checkout = "Checkout",
111
- /** Any page that doesn't fit the previous descriptions. */
112
- Other = "Other"
113
- }
114
-
115
- /**
116
- * A set of options that are required to initialize ApplePay in cart.
117
- *
118
- * When ApplePay is initialized, an ApplePay button will be inserted into the
119
- * DOM. When a customer clicks on it, it will trigger Apple sheet.
120
- */
121
- declare interface ApplePayButtonInitializeOptions {
122
- /**
123
- * The class name of the ApplePay button style.
124
- */
125
- buttonClassName?: string;
126
- /**
127
- * A callback that gets called when a payment is successfully completed.
128
- */
129
- onPaymentAuthorize(): void;
130
- }
131
-
132
- /**
133
- * A set of options that are required to initialize ApplePay in cart.
134
- *
135
- * When ApplePay is initialized, an ApplePay button will be inserted into the
136
- * DOM. When a customer clicks on it, it will trigger Apple sheet.
137
- */
138
- declare interface ApplePayButtonInitializeOptions_2 {
139
- /**
140
- * The class name of the ApplePay button style.
141
- */
142
- buttonClassName?: string;
143
- /**
144
- * A callback that gets called when a payment is successfully completed.
145
- */
146
- onPaymentAuthorize(): void;
147
- }
148
-
149
- declare interface BraintreeError extends Error {
150
- type: 'CUSTOMER' | 'MERCHANT' | 'NETWORK' | 'INTERNAL' | 'UNKNOWN';
151
- code: string;
152
- details?: unknown;
153
- }
154
-
155
- declare interface BraintreePaypalButtonInitializeOptions {
156
- /**
157
- * The ID of a container which the messaging should be inserted.
158
- */
159
- messagingContainerId?: string;
160
- /**
161
- * A set of styling options for the checkout button.
162
- */
163
- style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
164
- /**
165
- * Address to be used for shipping.
166
- * If not provided, it will use the first saved address from the active customer.
167
- */
168
- shippingAddress?: Address | null;
169
- /**
170
- * A callback that gets called if unable to authorize and tokenize payment.
171
- *
172
- * @param error - The error object describing the failure.
173
- */
174
- onAuthorizeError?(error: BraintreeError | StandardError): void;
175
- /**
176
- * A callback that gets called if unable to submit payment.
177
- *
178
- * @param error - The error object describing the failure.
179
- */
180
- onPaymentError?(error: BraintreeError | StandardError): void;
181
- /**
182
- * A callback that gets called on any error instead of submit payment or authorization errors.
183
- *
184
- * @param error - The error object describing the failure.
185
- */
186
- onError?(error: BraintreeError | StandardError): void;
187
- }
188
-
189
- declare interface BraintreePaypalCreditButtonInitializeOptions {
190
- /**
191
- * A set of styling options for the checkout button.
192
- */
193
- style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
194
- /**
195
- * Address to be used for shipping.
196
- * If not provided, it will use the first saved address from the active customer.
197
- */
198
- shippingAddress?: Address | null;
199
- /**
200
- * A callback that gets called if unable to authorize and tokenize payment.
201
- *
202
- * @param error - The error object describing the failure.
203
- */
204
- onAuthorizeError?(error: BraintreeError | StandardError): void;
205
- /**
206
- * A callback that gets called if unable to submit payment.
207
- *
208
- * @param error - The error object describing the failure.
209
- */
210
- onPaymentError?(error: BraintreeError | StandardError): void;
211
- /**
212
- * A callback that gets called on any error instead of submit payment or authorization errors.
213
- *
214
- * @param error - The error object describing the failure.
215
- */
216
- onError?(error: BraintreeError | StandardError): void;
217
- }
218
-
219
- declare interface BraintreeVenmoButtonInitializeOptions {
220
- /**
221
- * A callback that gets called on any error.
222
- *
223
- * @param error - The error object describing the failure.
224
- */
225
- onError?(error: BraintreeError | StandardError): void;
226
- }
227
-
228
- declare enum ButtonColor {
229
- Default = "default",
230
- Black = "black",
231
- White = "white"
232
- }
233
-
234
- declare enum ButtonType {
235
- Long = "long",
236
- Short = "short"
237
- }
238
-
239
- declare class CheckoutButtonErrorSelector {
240
- private _checkoutButton;
241
- getInitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
242
- getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
243
- }
244
-
245
- declare type CheckoutButtonInitializeOptions = CheckoutButtonInitializeOptions_2 & CheckoutButtonInitializeOptions_4;
246
-
247
- declare type CheckoutButtonInitializeOptions_2 = CheckoutButtonInitializeOptions_3 & WithApplePayButtonInitializeOptions;
248
-
249
- declare interface CheckoutButtonInitializeOptions_3 extends CheckoutButtonOptions {
250
- /**
251
- * The ID of a container which the checkout button should be inserted.
252
- */
253
- containerId: string;
254
- [key: string]: unknown;
255
- }
256
-
257
- declare interface CheckoutButtonInitializeOptions_4 extends CheckoutButtonOptions_2 {
258
- /**
259
- * The options that are required to initialize the ApplePay payment method.
260
- * They can be omitted unless you need to support ApplePay in cart.
261
- */
262
- applepay?: ApplePayButtonInitializeOptions_2;
263
- /**
264
- * The options that are required to facilitate AmazonPayV2. They can be
265
- * omitted unless you need to support AmazonPayV2.
266
- */
267
- amazonpay?: AmazonPayV2ButtonInitializeOptions;
268
- /**
269
- * The options that are required to facilitate Braintree PayPal. They can be
270
- * omitted unless you need to support Braintree PayPal.
271
- */
272
- braintreepaypal?: BraintreePaypalButtonInitializeOptions;
273
- /**
274
- * The options that are required to facilitate Braintree Credit. They can be
275
- * omitted unless you need to support Braintree Credit.
276
- */
277
- braintreepaypalcredit?: BraintreePaypalCreditButtonInitializeOptions;
278
- /**
279
- * The options that are required to facilitate Braintree Venmo. They can be
280
- * omitted unless you need to support Braintree Venmo.
281
- */
282
- braintreevenmo?: BraintreeVenmoButtonInitializeOptions;
283
- /**
284
- * The ID of a container which the checkout button should be inserted.
285
- */
286
- containerId: string;
287
- /**
288
- * The options that are required to initialize the GooglePay payment method.
289
- * They can be omitted unless you need to support adyenv2 GooglePay.
290
- */
291
- googlepayadyenv2?: GooglePayButtonInitializeOptions;
292
- /**
293
- * The options that are required to initialize the GooglePay payment method.
294
- * They can be omitted unless you need to support adyenv2 GooglePay.
295
- */
296
- googlepayadyenv3?: GooglePayButtonInitializeOptions;
297
- /**
298
- * The options that are required to facilitate Braintree GooglePay. They can be
299
- * omitted unless you need to support Braintree GooglePay.
300
- */
301
- googlepaybraintree?: GooglePayButtonInitializeOptions;
302
- /**
303
- * The options that are required to facilitate Checkout.com GooglePay. They can be
304
- * omitted unless you need to support Checkout.com GooglePay.
305
- */
306
- googlepaycheckoutcom?: GooglePayButtonInitializeOptions;
307
- /**
308
- * The options that are required to facilitate CybersourceV2 GooglePay. They can be
309
- * omitted unless you need to support CybersourceV2 GooglePay.
310
- */
311
- googlepaycybersourcev2?: GooglePayButtonInitializeOptions;
312
- /**
313
- * The options that are required to facilitate Orbital GooglePay. They can be
314
- * omitted unless you need to support Orbital GooglePay.
315
- */
316
- googlepayorbital?: GooglePayButtonInitializeOptions;
317
- /**
318
- * The options that are required to facilitate Stripe GooglePay. They can be
319
- * omitted unless you need to support Stripe GooglePay.
320
- */
321
- googlepaystripe?: GooglePayButtonInitializeOptions;
322
- /**
323
- * The options that are required to facilitate Stripe GooglePay. They can be
324
- * omitted unless you need to support Stripe GooglePay.
325
- */
326
- googlepaystripeupe?: GooglePayButtonInitializeOptions;
327
- /**
328
- * The options that are required to facilitate Authorize.Net GooglePay.
329
- * They can be omitted unless you need to support Authorize.Net GooglePay.
330
- */
331
- googlepayauthorizenet?: GooglePayButtonInitializeOptions;
332
- /**
333
- * The options that are required to facilitate PayPal. They can be omitted
334
- * unless you need to support Paypal.
335
- */
336
- paypal?: PaypalButtonInitializeOptions;
337
- /**
338
- * The options that are required to facilitate PayPal Commerce. They can be omitted
339
- * unless you need to support Paypal.
340
- */
341
- paypalCommerce?: PaypalCommerceButtonInitializeOptions;
342
- /**
343
- * The options that are required to facilitate PayPal Commerce. They can be omitted
344
- * unless you need to support PayPal Commerce Alternative Payment Methods.
345
- */
346
- paypalcommercealternativemethods?: PaypalCommerceAlternativeMethodsButtonOptions;
347
- /**
348
- * The options that are required to facilitate PayPal Commerce Venmo. They can be omitted
349
- * unless you need to support PayPal Commerce Venmo.
350
- */
351
- paypalcommercevenmo?: PaypalCommerceVenmoButtonInitializeOptions;
352
- }
353
-
354
- declare class CheckoutButtonInitializer {
355
- private _store;
356
- private _buttonStrategyActionCreator;
357
- private _state;
358
- /**
359
- * Returns a snapshot of the current state.
360
- *
361
- * The method returns a new instance every time there is a change in the
362
- * state. You can query the state by calling any of its getter methods.
363
- *
364
- * ```js
365
- * const state = service.getState();
366
- *
367
- * console.log(state.errors.getInitializeButtonError());
368
- * console.log(state.statuses.isInitializingButton());
369
- * ```
370
- *
371
- * @returns The current customer's checkout state
372
- */
373
- getState(): CheckoutButtonSelectors;
374
- /**
375
- * Subscribes to any changes to the current state.
376
- *
377
- * The method registers a callback function and executes it every time there
378
- * is a change in the current state.
379
- *
380
- * ```js
381
- * service.subscribe(state => {
382
- * console.log(state.statuses.isInitializingButton());
383
- * });
384
- * ```
385
- *
386
- * The method can be configured to notify subscribers only regarding
387
- * relevant changes, by providing a filter function.
388
- *
389
- * ```js
390
- * const filter = state => state.errors.getInitializeButtonError();
391
- *
392
- * // Only trigger the subscriber when the cart changes.
393
- * service.subscribe(state => {
394
- * console.log(state.errors.getInitializeButtonError())
395
- * }, filter);
396
- * ```
397
- *
398
- * @param subscriber - The function to subscribe to state changes.
399
- * @param filters - One or more functions to filter out irrelevant state
400
- * changes. If more than one function is provided, the subscriber will only
401
- * be triggered if all conditions are met.
402
- * @returns A function, if called, will unsubscribe the subscriber.
403
- */
404
- subscribe(subscriber: (state: CheckoutButtonSelectors) => void, ...filters: Array<(state: CheckoutButtonSelectors) => any>): () => void;
405
- /**
406
- * Initializes the checkout button of a payment method.
407
- *
408
- * When the checkout button is initialized, it will be inserted into the DOM,
409
- * ready to be interacted with by the customer.
410
- *
411
- * ```js
412
- * initializer.initializeButton({
413
- * methodId: 'braintreepaypal',
414
- * containerId: 'checkoutButton',
415
- * braintreepaypal: {
416
- * },
417
- * });
418
- * ```
419
- *
420
- * @param options - Options for initializing the checkout button.
421
- * @returns A promise that resolves to the current state.
422
- */
423
- initializeButton(options: CheckoutButtonInitializeOptions): Promise<CheckoutButtonSelectors>;
424
- /**
425
- * De-initializes the checkout button by performing any necessary clean-ups.
426
- *
427
- * ```js
428
- * await service.deinitializeButton({
429
- * methodId: 'braintreepaypal',
430
- * });
431
- * ```
432
- *
433
- * @param options - Options for deinitializing the checkout button.
434
- * @returns A promise that resolves to the current state.
435
- */
436
- deinitializeButton(options: CheckoutButtonOptions_2): Promise<CheckoutButtonSelectors>;
437
- }
438
-
439
- declare interface CheckoutButtonInitializerOptions {
440
- host?: string;
441
- locale?: string;
442
- }
443
-
444
- declare enum CheckoutButtonMethodType {
445
- APPLEPAY = "applepay",
446
- AMAZON_PAY_V2 = "amazonpay",
447
- BRAINTREE_PAYPAL = "braintreepaypal",
448
- BRAINTREE_VENMO = "braintreevenmo",
449
- BRAINTREE_PAYPAL_CREDIT = "braintreepaypalcredit",
450
- GOOGLEPAY_ADYENV2 = "googlepayadyenv2",
451
- GOOGLEPAY_ADYENV3 = "googlepayadyenv3",
452
- GOOGLEPAY_AUTHORIZENET = "googlepayauthorizenet",
453
- GOOGLEPAY_BRAINTREE = "googlepaybraintree",
454
- GOOGLEPAY_CHECKOUTCOM = "googlepaycheckoutcom",
455
- GOOGLEPAY_CYBERSOURCEV2 = "googlepaycybersourcev2",
456
- GOOGLEPAY_ORBITAL = "googlepayorbital",
457
- GOOGLEPAY_STRIPE = "googlepaystripe",
458
- GOOGLEPAY_STRIPEUPE = "googlepaystripeupe",
459
- MASTERPASS = "masterpass",
460
- PAYPALEXPRESS = "paypalexpress",
461
- PAYPALCOMMERCE = "paypalcommerce",
462
- PAYPALCOMMERCE_APMS = "paypalcommercealternativemethods",
463
- PAYPALCOMMERCE_VENMO = "paypalcommercevenmo"
464
- }
465
-
466
- /**
467
- * The set of options for configuring the checkout button.
468
- */
469
- declare interface CheckoutButtonOptions extends RequestOptions {
470
- /**
471
- * The identifier of the payment method.
472
- */
473
- methodId: string;
474
- }
475
-
476
- /**
477
- * The set of options for configuring the checkout button.
478
- */
479
- declare interface CheckoutButtonOptions_2 extends RequestOptions_2 {
480
- /**
481
- * The identifier of the payment method.
482
- */
483
- methodId: CheckoutButtonMethodType;
484
- }
485
-
486
- declare interface CheckoutButtonSelectors {
487
- errors: CheckoutButtonErrorSelector;
488
- statuses: CheckoutButtonStatusSelector;
489
- }
490
-
491
- declare class CheckoutButtonStatusSelector {
492
- private _checkoutButton;
493
- isInitializingButton(methodId?: CheckoutButtonMethodType): boolean;
494
- isDeinitializingButton(methodId?: CheckoutButtonMethodType): boolean;
495
- }
496
-
497
- declare interface CustomError extends Error {
498
- message: string;
499
- type: string;
500
- subtype?: string;
501
- }
502
-
503
- declare interface GooglePayButtonInitializeOptions {
504
- /**
505
- * The color of the GooglePay button that will be inserted.
506
- * black (default): a black button suitable for use on white or light backgrounds.
507
- * white: a white button suitable for use on colorful backgrounds.
508
- */
509
- buttonColor?: ButtonColor;
510
- /**
511
- * The size of the GooglePay button that will be inserted.
512
- * long: "Buy with Google Pay" button (default). A translated button label may appear
513
- * if a language specified in the viewer's browser matches an available language.
514
- * short: Google Pay payment button without the "Buy with" text.
515
- */
516
- buttonType?: ButtonType;
517
- }
518
-
519
- declare interface PaypalButtonInitializeOptions {
520
- /**
521
- * The Client ID of the Paypal App
522
- */
523
- clientId: string;
524
- /**
525
- * Whether or not to show a credit button.
526
- */
527
- allowCredit?: boolean;
528
- /**
529
- * A set of styling options for the checkout button.
530
- */
531
- style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons'>;
532
- /**
533
- * A callback that gets called if unable to authorize and tokenize payment.
534
- *
535
- * @param error - The error object describing the failure.
536
- */
537
- onAuthorizeError?(error: StandardError): void;
538
- /**
539
- * A callback that gets called if unable to submit payment.
540
- *
541
- * @param error - The error object describing the failure.
542
- */
543
- onPaymentError?(error: StandardError): void;
544
- }
545
-
546
- declare enum PaypalButtonStyleColorOption {
547
- GOLD = "gold",
548
- BLUE = "blue",
549
- SIlVER = "silver",
550
- BLACK = "black"
551
- }
552
-
553
- declare enum PaypalButtonStyleLabelOption {
554
- CHECKOUT = "checkout",
555
- PAY = "pay",
556
- BUYNOW = "buynow",
557
- PAYPAL = "paypal",
558
- CREDIT = "credit"
559
- }
560
-
561
- declare enum PaypalButtonStyleLayoutOption {
562
- HORIZONTAL = "horizontal",
563
- VERTICAL = "vertical"
564
- }
565
-
566
- declare interface PaypalButtonStyleOptions {
567
- layout?: PaypalButtonStyleLayoutOption;
568
- size?: PaypalButtonStyleSizeOption;
569
- color?: PaypalButtonStyleColorOption;
570
- label?: PaypalButtonStyleLabelOption;
571
- shape?: PaypalButtonStyleShapeOption;
572
- tagline?: boolean;
573
- fundingicons?: boolean;
574
- height?: number;
575
- }
576
-
577
- declare interface PaypalButtonStyleOptions_2 {
578
- layout?: StyleButtonLayout;
579
- color?: StyleButtonColor;
580
- shape?: StyleButtonShape;
581
- height?: number;
582
- label?: StyleButtonLabel;
583
- tagline?: boolean;
584
- }
585
-
586
- declare enum PaypalButtonStyleShapeOption {
587
- PILL = "pill",
588
- RECT = "rect"
589
- }
590
-
591
- declare enum PaypalButtonStyleSizeOption {
592
- SMALL = "small",
593
- MEDIUM = "medium",
594
- LARGE = "large",
595
- RESPONSIVE = "responsive"
596
- }
597
-
598
- declare interface PaypalCommerceAlternativeMethodsButtonOptions {
599
- /**
600
- * Alternative payment method id what used for initialization PayPal button as funding source.
601
- */
602
- apm: string;
603
- /**
604
- * Flag which helps to detect that the strategy initializes on Checkout page.
605
- */
606
- initializesOnCheckoutPage?: boolean;
607
- /**
608
- * A set of styling options for the checkout button.
609
- */
610
- style?: PaypalButtonStyleOptions_2;
611
- }
612
-
613
- declare interface PaypalCommerceButtonInitializeOptions {
614
- /**
615
- * A set of styling options for the checkout button.
616
- */
617
- style?: PaypalButtonStyleOptions_2;
618
- /**
619
- * Container id for messaging banner container
620
- */
621
- messagingContainer?: string;
622
- }
623
-
624
- declare interface PaypalCommerceVenmoButtonInitializeOptions {
625
- /**
626
- * A set of styling options for the checkout button.
627
- */
628
- style?: PaypalButtonStyleOptions_2;
629
- /**
630
- * Flag which helps to detect that the strategy initializes on Checkout page
631
- */
632
- initializesOnCheckoutPage?: boolean;
633
- }
634
-
635
- /**
636
- * A set of options for configuring an asynchronous request.
637
- */
638
- declare interface RequestOptions<TParams = {}> {
639
- /**
640
- * Provide this option if you want to cancel or time out the request. If the
641
- * timeout object completes before the request, the request will be
642
- * cancelled.
643
- */
644
- timeout?: Timeout;
645
- /**
646
- * The parameters of the request, if required.
647
- */
648
- params?: TParams;
649
- }
650
-
651
- /**
652
- * A set of options for configuring an asynchronous request.
653
- */
654
- declare interface RequestOptions_2<TParams = {}> {
655
- /**
656
- * Provide this option if you want to cancel or time out the request. If the
657
- * timeout object completes before the request, the request will be
658
- * cancelled.
659
- */
660
- timeout?: Timeout;
661
- /**
662
- * The parameters of the request, if required.
663
- */
664
- params?: TParams;
665
- }
666
-
667
- /**
668
- * This error type should not be constructed directly. It is a base class for
669
- * all custom errors thrown in this library.
670
- */
671
- declare abstract class StandardError extends Error implements CustomError {
672
- name: string;
673
- type: string;
674
- constructor(message?: string);
675
- }
676
-
677
- declare enum StyleButtonColor {
678
- gold = "gold",
679
- blue = "blue",
680
- silver = "silver",
681
- black = "black",
682
- white = "white"
683
- }
684
-
685
- declare enum StyleButtonLabel {
686
- paypal = "paypal",
687
- checkout = "checkout",
688
- buynow = "buynow",
689
- pay = "pay",
690
- installment = "installment"
691
- }
692
-
693
- declare enum StyleButtonLayout {
694
- vertical = "vertical",
695
- horizontal = "horizontal"
696
- }
697
-
698
- declare enum StyleButtonShape {
699
- pill = "pill",
700
- rect = "rect"
701
- }
702
-
703
- declare interface WithApplePayButtonInitializeOptions {
704
- applepay?: ApplePayButtonInitializeOptions;
705
- }
706
-
707
- /**
708
- * Creates an instance of `CheckoutButtonInitializer`.
709
- *
710
- * @remarks
711
- * ```js
712
- * const initializer = createCheckoutButtonInitializer();
713
- *
714
- * initializer.initializeButton({
715
- * methodId: 'braintreepaypal',
716
- * braintreepaypal: {
717
- * container: '#checkoutButton',
718
- * },
719
- * });
720
- * ```
721
- *
722
- * @alpha
723
- * Please note that `CheckoutButtonInitializer` is currently in an early stage
724
- * of development. Therefore the API is unstable and not ready for public
725
- * consumption.
726
- *
727
- * @param options - A set of construction options.
728
- * @returns an instance of `CheckoutButtonInitializer`.
729
- */
730
- export declare function createCheckoutButtonInitializer(options?: CheckoutButtonInitializerOptions): CheckoutButtonInitializer;
1
+ import { createTimeout } from '@bigcommerce/request-sender';
2
+ import { Timeout } from '@bigcommerce/request-sender';
3
+
4
+ declare interface Address extends AddressRequestBody {
5
+ country: string;
6
+ shouldSaveAddress?: boolean;
7
+ }
8
+
9
+ declare interface AddressRequestBody {
10
+ firstName: string;
11
+ lastName: string;
12
+ company: string;
13
+ address1: string;
14
+ address2: string;
15
+ city: string;
16
+ stateOrProvince: string;
17
+ stateOrProvinceCode: string;
18
+ countryCode: string;
19
+ postalCode: string;
20
+ phone: string;
21
+ customFields: Array<{
22
+ fieldId: string;
23
+ fieldValue: string | number | string[];
24
+ }>;
25
+ }
26
+
27
+ /**
28
+ * The required config to render the AmazonPayV2 buttton.
29
+ */
30
+ declare type AmazonPayV2ButtonInitializeOptions = AmazonPayV2ButtonParams;
31
+
32
+ declare interface AmazonPayV2ButtonParams {
33
+ /**
34
+ * Amazon Pay merchant account identifier.
35
+ */
36
+ merchantId: string;
37
+ /**
38
+ * Configuration for calling the endpoint to Create Checkout Session.
39
+ */
40
+ createCheckoutSession: AmazonPayV2CheckoutSession;
41
+ /**
42
+ * Placement of the Amazon Pay button on your website.
43
+ */
44
+ placement: AmazonPayV2Placement;
45
+ /**
46
+ * Ledger currency provided during registration for the given merchant identifier.
47
+ */
48
+ ledgerCurrency: AmazonPayV2LedgerCurrency;
49
+ /**
50
+ * Product type selected for checkout. Default is 'PayAndShip'.
51
+ */
52
+ productType?: AmazonPayV2PayOptions;
53
+ /**
54
+ * Language used to render the button and text on Amazon Pay hosted pages.
55
+ */
56
+ checkoutLanguage?: AmazonPayV2CheckoutLanguage;
57
+ /**
58
+ * Sets button to Sandbox environment. Default is false.
59
+ */
60
+ sandbox?: boolean;
61
+ }
62
+
63
+ declare enum AmazonPayV2CheckoutLanguage {
64
+ en_US = "en_US",
65
+ en_GB = "en_GB",
66
+ de_DE = "de_DE",
67
+ fr_FR = "fr_FR",
68
+ it_IT = "it_IT",
69
+ es_ES = "es_ES",
70
+ ja_JP = "ja_JP"
71
+ }
72
+
73
+ declare interface AmazonPayV2CheckoutSession {
74
+ /**
75
+ * Endpoint URL to Create Checkout Session.
76
+ */
77
+ url: string;
78
+ /**
79
+ * HTTP request method. Default is 'POST'.
80
+ */
81
+ method?: 'GET' | 'POST';
82
+ /**
83
+ * Checkout Session ID parameter in the response. Default is 'checkoutSessionId'.
84
+ */
85
+ extractAmazonCheckoutSessionId?: string;
86
+ }
87
+
88
+ declare enum AmazonPayV2LedgerCurrency {
89
+ USD = "USD",
90
+ EUR = "EUR",
91
+ GBP = "GBP",
92
+ JPY = "JPY"
93
+ }
94
+
95
+ declare enum AmazonPayV2PayOptions {
96
+ /** Select this product type if you need the buyer's shipping details. */
97
+ PayAndShip = "PayAndShip",
98
+ /** Select this product type if you do not need the buyer's shipping details. */
99
+ PayOnly = "PayOnly"
100
+ }
101
+
102
+ declare enum AmazonPayV2Placement {
103
+ /** Initial or main page. */
104
+ Home = "Home",
105
+ /** Product details page. */
106
+ Product = "Product",
107
+ /** Cart review page before buyer starts checkout. */
108
+ Cart = "Cart",
109
+ /** Any page after buyer starts checkout. */
110
+ Checkout = "Checkout",
111
+ /** Any page that doesn't fit the previous descriptions. */
112
+ Other = "Other"
113
+ }
114
+
115
+ /**
116
+ * A set of options that are required to initialize ApplePay in cart.
117
+ *
118
+ * When ApplePay is initialized, an ApplePay button will be inserted into the
119
+ * DOM. When a customer clicks on it, it will trigger Apple sheet.
120
+ */
121
+ declare interface ApplePayButtonInitializeOptions {
122
+ /**
123
+ * The class name of the ApplePay button style.
124
+ */
125
+ buttonClassName?: string;
126
+ /**
127
+ * A callback that gets called when a payment is successfully completed.
128
+ */
129
+ onPaymentAuthorize(): void;
130
+ }
131
+
132
+ declare interface BraintreeError extends Error {
133
+ type: 'CUSTOMER' | 'MERCHANT' | 'NETWORK' | 'INTERNAL' | 'UNKNOWN';
134
+ code: string;
135
+ details?: unknown;
136
+ }
137
+
138
+ declare interface BraintreePaypalButtonInitializeOptions {
139
+ /**
140
+ * The ID of a container which the messaging should be inserted.
141
+ */
142
+ messagingContainerId?: string;
143
+ /**
144
+ * A set of styling options for the checkout button.
145
+ */
146
+ style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
147
+ /**
148
+ * Address to be used for shipping.
149
+ * If not provided, it will use the first saved address from the active customer.
150
+ */
151
+ shippingAddress?: Address | null;
152
+ /**
153
+ * A callback that gets called if unable to authorize and tokenize payment.
154
+ *
155
+ * @param error - The error object describing the failure.
156
+ */
157
+ onAuthorizeError?(error: BraintreeError | StandardError): void;
158
+ /**
159
+ * A callback that gets called if unable to submit payment.
160
+ *
161
+ * @param error - The error object describing the failure.
162
+ */
163
+ onPaymentError?(error: BraintreeError | StandardError): void;
164
+ /**
165
+ * A callback that gets called on any error instead of submit payment or authorization errors.
166
+ *
167
+ * @param error - The error object describing the failure.
168
+ */
169
+ onError?(error: BraintreeError | StandardError): void;
170
+ }
171
+
172
+ declare interface BraintreePaypalCreditButtonInitializeOptions {
173
+ /**
174
+ * A set of styling options for the checkout button.
175
+ */
176
+ style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
177
+ /**
178
+ * Address to be used for shipping.
179
+ * If not provided, it will use the first saved address from the active customer.
180
+ */
181
+ shippingAddress?: Address | null;
182
+ /**
183
+ * A callback that gets called if unable to authorize and tokenize payment.
184
+ *
185
+ * @param error - The error object describing the failure.
186
+ */
187
+ onAuthorizeError?(error: BraintreeError | StandardError): void;
188
+ /**
189
+ * A callback that gets called if unable to submit payment.
190
+ *
191
+ * @param error - The error object describing the failure.
192
+ */
193
+ onPaymentError?(error: BraintreeError | StandardError): void;
194
+ /**
195
+ * A callback that gets called on any error instead of submit payment or authorization errors.
196
+ *
197
+ * @param error - The error object describing the failure.
198
+ */
199
+ onError?(error: BraintreeError | StandardError): void;
200
+ }
201
+
202
+ declare interface BraintreeVenmoButtonInitializeOptions {
203
+ /**
204
+ * A callback that gets called on any error.
205
+ *
206
+ * @param error - The error object describing the failure.
207
+ */
208
+ onError?(error: BraintreeError | StandardError): void;
209
+ }
210
+
211
+ declare enum ButtonColor {
212
+ Default = "default",
213
+ Black = "black",
214
+ White = "white"
215
+ }
216
+
217
+ declare enum ButtonType {
218
+ Long = "long",
219
+ Short = "short"
220
+ }
221
+
222
+ declare class CheckoutButtonErrorSelector {
223
+ private _checkoutButton;
224
+ getInitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
225
+ getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
226
+ }
227
+
228
+ declare interface CheckoutButtonInitializeOptions extends CheckoutButtonOptions {
229
+ /**
230
+ * The options that are required to initialize the ApplePay payment method.
231
+ * They can be omitted unless you need to support ApplePay in cart.
232
+ */
233
+ applepay?: ApplePayButtonInitializeOptions;
234
+ /**
235
+ * The options that are required to facilitate AmazonPayV2. They can be
236
+ * omitted unless you need to support AmazonPayV2.
237
+ */
238
+ amazonpay?: AmazonPayV2ButtonInitializeOptions;
239
+ /**
240
+ * The options that are required to facilitate Braintree PayPal. They can be
241
+ * omitted unless you need to support Braintree PayPal.
242
+ */
243
+ braintreepaypal?: BraintreePaypalButtonInitializeOptions;
244
+ /**
245
+ * The options that are required to facilitate Braintree Credit. They can be
246
+ * omitted unless you need to support Braintree Credit.
247
+ */
248
+ braintreepaypalcredit?: BraintreePaypalCreditButtonInitializeOptions;
249
+ /**
250
+ * The options that are required to facilitate Braintree Venmo. They can be
251
+ * omitted unless you need to support Braintree Venmo.
252
+ */
253
+ braintreevenmo?: BraintreeVenmoButtonInitializeOptions;
254
+ /**
255
+ * The ID of a container which the checkout button should be inserted.
256
+ */
257
+ containerId: string;
258
+ /**
259
+ * The options that are required to initialize the GooglePay payment method.
260
+ * They can be omitted unless you need to support adyenv2 GooglePay.
261
+ */
262
+ googlepayadyenv2?: GooglePayButtonInitializeOptions;
263
+ /**
264
+ * The options that are required to initialize the GooglePay payment method.
265
+ * They can be omitted unless you need to support adyenv2 GooglePay.
266
+ */
267
+ googlepayadyenv3?: GooglePayButtonInitializeOptions;
268
+ /**
269
+ * The options that are required to facilitate Braintree GooglePay. They can be
270
+ * omitted unless you need to support Braintree GooglePay.
271
+ */
272
+ googlepaybraintree?: GooglePayButtonInitializeOptions;
273
+ /**
274
+ * The options that are required to facilitate Checkout.com GooglePay. They can be
275
+ * omitted unless you need to support Checkout.com GooglePay.
276
+ */
277
+ googlepaycheckoutcom?: GooglePayButtonInitializeOptions;
278
+ /**
279
+ * The options that are required to facilitate CybersourceV2 GooglePay. They can be
280
+ * omitted unless you need to support CybersourceV2 GooglePay.
281
+ */
282
+ googlepaycybersourcev2?: GooglePayButtonInitializeOptions;
283
+ /**
284
+ * The options that are required to facilitate Orbital GooglePay. They can be
285
+ * omitted unless you need to support Orbital GooglePay.
286
+ */
287
+ googlepayorbital?: GooglePayButtonInitializeOptions;
288
+ /**
289
+ * The options that are required to facilitate Stripe GooglePay. They can be
290
+ * omitted unless you need to support Stripe GooglePay.
291
+ */
292
+ googlepaystripe?: GooglePayButtonInitializeOptions;
293
+ /**
294
+ * The options that are required to facilitate Stripe GooglePay. They can be
295
+ * omitted unless you need to support Stripe GooglePay.
296
+ */
297
+ googlepaystripeupe?: GooglePayButtonInitializeOptions;
298
+ /**
299
+ * The options that are required to facilitate Authorize.Net GooglePay.
300
+ * They can be omitted unless you need to support Authorize.Net GooglePay.
301
+ */
302
+ googlepayauthorizenet?: GooglePayButtonInitializeOptions;
303
+ /**
304
+ * The options that are required to facilitate PayPal. They can be omitted
305
+ * unless you need to support Paypal.
306
+ */
307
+ paypal?: PaypalButtonInitializeOptions;
308
+ /**
309
+ * The options that are required to facilitate PayPal Commerce. They can be omitted
310
+ * unless you need to support Paypal.
311
+ */
312
+ paypalCommerce?: PaypalCommerceButtonInitializeOptions;
313
+ /**
314
+ * The options that are required to facilitate PayPal Commerce. They can be omitted
315
+ * unless you need to support PayPal Commerce Alternative Payment Methods.
316
+ */
317
+ paypalcommercealternativemethods?: PaypalCommerceAlternativeMethodsButtonOptions;
318
+ /**
319
+ * The options that are required to facilitate PayPal Commerce Venmo. They can be omitted
320
+ * unless you need to support PayPal Commerce Venmo.
321
+ */
322
+ paypalcommercevenmo?: PaypalCommerceVenmoButtonInitializeOptions;
323
+ }
324
+
325
+ declare class CheckoutButtonInitializer {
326
+ private _store;
327
+ private _buttonStrategyActionCreator;
328
+ private _state;
329
+ /**
330
+ * Returns a snapshot of the current state.
331
+ *
332
+ * The method returns a new instance every time there is a change in the
333
+ * state. You can query the state by calling any of its getter methods.
334
+ *
335
+ * ```js
336
+ * const state = service.getState();
337
+ *
338
+ * console.log(state.errors.getInitializeButtonError());
339
+ * console.log(state.statuses.isInitializingButton());
340
+ * ```
341
+ *
342
+ * @returns The current customer's checkout state
343
+ */
344
+ getState(): CheckoutButtonSelectors;
345
+ /**
346
+ * Subscribes to any changes to the current state.
347
+ *
348
+ * The method registers a callback function and executes it every time there
349
+ * is a change in the current state.
350
+ *
351
+ * ```js
352
+ * service.subscribe(state => {
353
+ * console.log(state.statuses.isInitializingButton());
354
+ * });
355
+ * ```
356
+ *
357
+ * The method can be configured to notify subscribers only regarding
358
+ * relevant changes, by providing a filter function.
359
+ *
360
+ * ```js
361
+ * const filter = state => state.errors.getInitializeButtonError();
362
+ *
363
+ * // Only trigger the subscriber when the cart changes.
364
+ * service.subscribe(state => {
365
+ * console.log(state.errors.getInitializeButtonError())
366
+ * }, filter);
367
+ * ```
368
+ *
369
+ * @param subscriber - The function to subscribe to state changes.
370
+ * @param filters - One or more functions to filter out irrelevant state
371
+ * changes. If more than one function is provided, the subscriber will only
372
+ * be triggered if all conditions are met.
373
+ * @returns A function, if called, will unsubscribe the subscriber.
374
+ */
375
+ subscribe(subscriber: (state: CheckoutButtonSelectors) => void, ...filters: Array<(state: CheckoutButtonSelectors) => any>): () => void;
376
+ /**
377
+ * Initializes the checkout button of a payment method.
378
+ *
379
+ * When the checkout button is initialized, it will be inserted into the DOM,
380
+ * ready to be interacted with by the customer.
381
+ *
382
+ * ```js
383
+ * initializer.initializeButton({
384
+ * methodId: 'braintreepaypal',
385
+ * containerId: 'checkoutButton',
386
+ * braintreepaypal: {
387
+ * },
388
+ * });
389
+ * ```
390
+ *
391
+ * @param options - Options for initializing the checkout button.
392
+ * @returns A promise that resolves to the current state.
393
+ */
394
+ initializeButton(options: CheckoutButtonInitializeOptions): Promise<CheckoutButtonSelectors>;
395
+ /**
396
+ * De-initializes the checkout button by performing any necessary clean-ups.
397
+ *
398
+ * ```js
399
+ * await service.deinitializeButton({
400
+ * methodId: 'braintreepaypal',
401
+ * });
402
+ * ```
403
+ *
404
+ * @param options - Options for deinitializing the checkout button.
405
+ * @returns A promise that resolves to the current state.
406
+ */
407
+ deinitializeButton(options: CheckoutButtonOptions): Promise<CheckoutButtonSelectors>;
408
+ }
409
+
410
+ declare interface CheckoutButtonInitializerOptions {
411
+ host?: string;
412
+ locale?: string;
413
+ }
414
+
415
+ declare enum CheckoutButtonMethodType {
416
+ APPLEPAY = "applepay",
417
+ AMAZON_PAY_V2 = "amazonpay",
418
+ BRAINTREE_PAYPAL = "braintreepaypal",
419
+ BRAINTREE_VENMO = "braintreevenmo",
420
+ BRAINTREE_PAYPAL_CREDIT = "braintreepaypalcredit",
421
+ GOOGLEPAY_ADYENV2 = "googlepayadyenv2",
422
+ GOOGLEPAY_ADYENV3 = "googlepayadyenv3",
423
+ GOOGLEPAY_AUTHORIZENET = "googlepayauthorizenet",
424
+ GOOGLEPAY_BRAINTREE = "googlepaybraintree",
425
+ GOOGLEPAY_CHECKOUTCOM = "googlepaycheckoutcom",
426
+ GOOGLEPAY_CYBERSOURCEV2 = "googlepaycybersourcev2",
427
+ GOOGLEPAY_ORBITAL = "googlepayorbital",
428
+ GOOGLEPAY_STRIPE = "googlepaystripe",
429
+ GOOGLEPAY_STRIPEUPE = "googlepaystripeupe",
430
+ MASTERPASS = "masterpass",
431
+ PAYPALEXPRESS = "paypalexpress",
432
+ PAYPALCOMMERCE = "paypalcommerce",
433
+ PAYPALCOMMERCE_APMS = "paypalcommercealternativemethods",
434
+ PAYPALCOMMERCE_VENMO = "paypalcommercevenmo"
435
+ }
436
+
437
+ /**
438
+ * The set of options for configuring the checkout button.
439
+ */
440
+ declare interface CheckoutButtonOptions extends RequestOptions {
441
+ /**
442
+ * The identifier of the payment method.
443
+ */
444
+ methodId: CheckoutButtonMethodType;
445
+ }
446
+
447
+ declare interface CheckoutButtonSelectors {
448
+ errors: CheckoutButtonErrorSelector;
449
+ statuses: CheckoutButtonStatusSelector;
450
+ }
451
+
452
+ declare class CheckoutButtonStatusSelector {
453
+ private _checkoutButton;
454
+ isInitializingButton(methodId?: CheckoutButtonMethodType): boolean;
455
+ isDeinitializingButton(methodId?: CheckoutButtonMethodType): boolean;
456
+ }
457
+
458
+ /* Excluded from this release type: createCheckoutButtonInitializer */
459
+ export { createTimeout }
460
+
461
+ declare interface CustomError extends Error {
462
+ message: string;
463
+ type: string;
464
+ subtype?: string;
465
+ }
466
+
467
+ declare interface GooglePayButtonInitializeOptions {
468
+ /**
469
+ * The color of the GooglePay button that will be inserted.
470
+ * black (default): a black button suitable for use on white or light backgrounds.
471
+ * white: a white button suitable for use on colorful backgrounds.
472
+ */
473
+ buttonColor?: ButtonColor;
474
+ /**
475
+ * The size of the GooglePay button that will be inserted.
476
+ * long: "Buy with Google Pay" button (default). A translated button label may appear
477
+ * if a language specified in the viewer's browser matches an available language.
478
+ * short: Google Pay payment button without the "Buy with" text.
479
+ */
480
+ buttonType?: ButtonType;
481
+ }
482
+
483
+ declare interface PaypalButtonInitializeOptions {
484
+ /**
485
+ * The Client ID of the Paypal App
486
+ */
487
+ clientId: string;
488
+ /**
489
+ * Whether or not to show a credit button.
490
+ */
491
+ allowCredit?: boolean;
492
+ /**
493
+ * A set of styling options for the checkout button.
494
+ */
495
+ style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons'>;
496
+ /**
497
+ * A callback that gets called if unable to authorize and tokenize payment.
498
+ *
499
+ * @param error - The error object describing the failure.
500
+ */
501
+ onAuthorizeError?(error: StandardError): void;
502
+ /**
503
+ * A callback that gets called if unable to submit payment.
504
+ *
505
+ * @param error - The error object describing the failure.
506
+ */
507
+ onPaymentError?(error: StandardError): void;
508
+ }
509
+
510
+ declare enum PaypalButtonStyleColorOption {
511
+ GOLD = "gold",
512
+ BLUE = "blue",
513
+ SIlVER = "silver",
514
+ BLACK = "black"
515
+ }
516
+
517
+ declare enum PaypalButtonStyleLabelOption {
518
+ CHECKOUT = "checkout",
519
+ PAY = "pay",
520
+ BUYNOW = "buynow",
521
+ PAYPAL = "paypal",
522
+ CREDIT = "credit"
523
+ }
524
+
525
+ declare enum PaypalButtonStyleLayoutOption {
526
+ HORIZONTAL = "horizontal",
527
+ VERTICAL = "vertical"
528
+ }
529
+
530
+ declare interface PaypalButtonStyleOptions {
531
+ layout?: PaypalButtonStyleLayoutOption;
532
+ size?: PaypalButtonStyleSizeOption;
533
+ color?: PaypalButtonStyleColorOption;
534
+ label?: PaypalButtonStyleLabelOption;
535
+ shape?: PaypalButtonStyleShapeOption;
536
+ tagline?: boolean;
537
+ fundingicons?: boolean;
538
+ height?: number;
539
+ }
540
+
541
+ declare interface PaypalButtonStyleOptions_2 {
542
+ layout?: StyleButtonLayout;
543
+ color?: StyleButtonColor;
544
+ shape?: StyleButtonShape;
545
+ height?: number;
546
+ label?: StyleButtonLabel;
547
+ tagline?: boolean;
548
+ }
549
+
550
+ declare enum PaypalButtonStyleShapeOption {
551
+ PILL = "pill",
552
+ RECT = "rect"
553
+ }
554
+
555
+ declare enum PaypalButtonStyleSizeOption {
556
+ SMALL = "small",
557
+ MEDIUM = "medium",
558
+ LARGE = "large",
559
+ RESPONSIVE = "responsive"
560
+ }
561
+
562
+ declare interface PaypalCommerceAlternativeMethodsButtonOptions {
563
+ /**
564
+ * Alternative payment method id what used for initialization PayPal button as funding source.
565
+ */
566
+ apm: string;
567
+ /**
568
+ * Flag which helps to detect that the strategy initializes on Checkout page.
569
+ */
570
+ initializesOnCheckoutPage?: boolean;
571
+ /**
572
+ * A set of styling options for the checkout button.
573
+ */
574
+ style?: PaypalButtonStyleOptions_2;
575
+ }
576
+
577
+ declare interface PaypalCommerceButtonInitializeOptions {
578
+ /**
579
+ * A set of styling options for the checkout button.
580
+ */
581
+ style?: PaypalButtonStyleOptions_2;
582
+ /**
583
+ * Container id for messaging banner container
584
+ */
585
+ messagingContainer?: string;
586
+ }
587
+
588
+ declare interface PaypalCommerceVenmoButtonInitializeOptions {
589
+ /**
590
+ * A set of styling options for the checkout button.
591
+ */
592
+ style?: PaypalButtonStyleOptions_2;
593
+ /**
594
+ * Flag which helps to detect that the strategy initializes on Checkout page
595
+ */
596
+ initializesOnCheckoutPage?: boolean;
597
+ }
598
+
599
+ /**
600
+ * A set of options for configuring an asynchronous request.
601
+ */
602
+ declare interface RequestOptions<TParams = {}> {
603
+ /**
604
+ * Provide this option if you want to cancel or time out the request. If the
605
+ * timeout object completes before the request, the request will be
606
+ * cancelled.
607
+ */
608
+ timeout?: Timeout;
609
+ /**
610
+ * The parameters of the request, if required.
611
+ */
612
+ params?: TParams;
613
+ }
614
+
615
+ /**
616
+ * This error type should not be constructed directly. It is a base class for
617
+ * all custom errors thrown in this library.
618
+ */
619
+ declare abstract class StandardError extends Error implements CustomError {
620
+ name: string;
621
+ type: string;
622
+ constructor(message?: string);
623
+ }
624
+
625
+ declare enum StyleButtonColor {
626
+ gold = "gold",
627
+ blue = "blue",
628
+ silver = "silver",
629
+ black = "black",
630
+ white = "white"
631
+ }
632
+
633
+ declare enum StyleButtonLabel {
634
+ paypal = "paypal",
635
+ checkout = "checkout",
636
+ buynow = "buynow",
637
+ pay = "pay",
638
+ installment = "installment"
639
+ }
640
+
641
+ declare enum StyleButtonLayout {
642
+ vertical = "vertical",
643
+ horizontal = "horizontal"
644
+ }
645
+
646
+ declare enum StyleButtonShape {
647
+ pill = "pill",
648
+ rect = "rect"
649
+ }
650
+
651
+ export { }