@paynext/sdk 0.0.84 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ npm install @paynext/sdk
11
11
  ## Quick Start
12
12
 
13
13
  ```typescript
14
- import { PayNextCheckout, type PaymentResult, type AttemptResult } from '@paynext/sdk'
14
+ import { PayNextCheckout, type PaymentResult, type AttemptResult, type CheckoutError } from '@paynext/sdk'
15
15
 
16
16
  import '@paynext/sdk/styles'
17
17
 
@@ -29,7 +29,7 @@ await checkout.mount({
29
29
  // Handle successful payment
30
30
  console.info('Payment successful!', result)
31
31
  },
32
- onCheckoutFail: (error: IErrorInterface) => {
32
+ onCheckoutFail: (error: CheckoutError) => {
33
33
  // Handle payment failure
34
34
  console.error('Payment failed:', error)
35
35
  }
@@ -40,7 +40,7 @@ await checkout.mount({
40
40
 
41
41
  ```tsx
42
42
  import { useEffect, useRef } from 'react'
43
- import { PayNextCheckout, type PaymentResult, type AttemptResult } from '@paynext/sdk'
43
+ import { PayNextCheckout, type PaymentResult, type AttemptResult, type CheckoutError } from '@paynext/sdk'
44
44
 
45
45
  import '@paynext/sdk/styles'
46
46
 
@@ -70,7 +70,7 @@ export const CheckoutComponent: FC<Readonly<IProps> = (props) => {
70
70
  // Handle successful payment
71
71
  console.info('Payment completed:', result)
72
72
  },
73
- onCheckoutFail: (error: IErrorInterface) => {
73
+ onCheckoutFail: (error: CheckoutError) => {
74
74
  // Handle payment failure
75
75
  console.error('Payment failed:', error)
76
76
  }
@@ -99,7 +99,7 @@ interface PayNextConfig {
99
99
  styles?: StylesConfig
100
100
  onCheckoutAttempt?: (result: AttemptResult) => void
101
101
  onCheckoutComplete?: (result: PaymentResult) => void
102
- onCheckoutFail?: (error: IErrorInterface) => void
102
+ onCheckoutFail?: (error: CheckoutError) => void
103
103
  }
104
104
  ```
105
105
 
@@ -1 +1 @@
1
- ._spinner_k40uq_1{height:100%;width:100%}@keyframes _spin_k40uq_1{to{transform:rotate(360deg)}}._spinner_k40uq_1{animation:_spin_k40uq_1 1s linear infinite;fill:#9ca3af;--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}._spinner_k40uq_1:is(._dark_k40uq_1 *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}._spinnerContainer_k40uq_5{height:40px;width:40px}._success_k40uq_9{position:absolute;top:50%;left:50%;width:1.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:#16a34a}._successContainer_k40uq_13{position:relative;display:grid;height:2.25rem;width:2.25rem;flex:none;place-items:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(232 250 240 / var(--tw-bg-opacity, 1))}._successContainer_k40uq_13:is(._dark_k40uq_1 *){--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._container_k40uq_17{width:30px;height:20px;display:flex;margin:0 1px;align-items:center;justify-content:center}._card_k40uq_26{width:28px;height:19px;display:flex;margin:0 1px;align-items:center;justify-content:center}._warning_k40uq_35{width:16px;height:16px;display:flex;align-items:center;justify-content:center}._svg_k40uq_43{width:100%;height:100%}._srOnly_k40uq_48{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}._backButton_k40uq_52{width:30px;height:30px;display:flex;margin:0 1px;align-items:center;justify-content:center;background-color:#f4f4f5;border-radius:8px}._loader_nwq3e_1{position:absolute;height:100%;top:0;left:0;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:1000;display:flex;width:100%;align-items:center;justify-content:center;border-radius:10px}._checkout_tjzsu_1{padding:0 2px;overflow:hidden;z-index:0;position:relative;height:auto;min-height:40px;width:100%;max-width:640px}._hidden_tjzsu_8{display:none!important}._formInitial_tjzsu_12{opacity:0;transform:translateY(100px)}._btnsInitial_tjzsu_17{opacity:0;transform:translateY(-100px)}._buttons_1i8cu_1{display:grid;gap:.5rem}._hidden_1i8cu_5{display:none!important}._applePay_f1ztr_1{display:flex;flex-direction:column;gap:8px}@media (hover: hover){._applePay_f1ztr_1:hover{filter:contrast(.575) brightness(1.2)}}._hidden_f1ztr_28{display:none!important}._googlePay_gmreq_1{display:flex;flex-direction:column;gap:8px}._hidden_gmreq_20{display:none!important}._paypal_90mm5_1{display:flex;flex-direction:column;gap:8px}._hidden_90mm5_12{display:none}._button_1bl11_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(13 118 110 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:1.5rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1bl11_1{transition-property:none}}._button_1bl11_1 span{margin-left:.25rem}@media (hover: hover){._button_1bl11_1:hover{opacity:.7}}._button_1bl11_1:active{transform:scale(.95)}._container_10ziz_2{display:flex;flex-direction:column;gap:.5rem}._venmo_10ziz_8{display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:12px;height:40px;background-color:#0088f7;width:100%;color:#fff;font-size:16px;text-align:center;cursor:pointer;transition:background-color .3s ease;svg{height:40%}@media (hover: hover){&:hover{background-color:#5683c1}}}._hidden_10ziz_35{display:none}._button_125my_1{cursor:pointer}._button_439a3_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(13 118 110 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_439a3_1{transition-property:none}}._button_439a3_1 span{margin-left:.25rem}._disabled_439a3_17{opacity:.7}@media (hover: hover){._button_439a3_1:hover{opacity:.7}}._press_439a3_27:active{transform:scale(.95)}._hidden_439a3_31{display:none!important}._spinner_439a3_35{width:24px;height:24px}._cardForm_6gjbg_1{position:relative;display:grid;min-height:292px;gap:.75rem;padding-top:0}._hidden_6gjbg_5{display:none!important}._topOffset_6gjbg_9{margin-top:.5rem}._wrapper_1gvzd_1{position:relative}._inputContainer_1gvzd_5{background-color:transparent;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;padding-left:.75rem;padding-right:.75rem}._inputContainer_1gvzd_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1gvzd_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1gvzd_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_1gvzd_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1gvzd_13{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}@media (hover: hover){._inputContainer_1gvzd_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}}._inputContainer_1gvzd_5:focus-within:not(._errorInput_1gvzd_23):not(._disabled_1gvzd_23){box-shadow:0 0 0 2px color-mix(in srgb,var(--input-focus-shadow-color, #5A67D8) 30%,transparent)}._input_1gvzd_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1gvzd_32{display:flex}._errorInput_1gvzd_23{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1gvzd_23:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1gvzd_23:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._label_1gvzd_40{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1gvzd_44{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1gvzd_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1gvzd_52{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1gvzd_59{display:none!important}._wrapper_1dxfo_1{position:relative}._inputContainer_1dxfo_5{background-color:transparent;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;padding-left:.75rem;padding-right:.75rem}._inputContainer_1dxfo_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1dxfo_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1dxfo_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_1dxfo_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1dxfo_13{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}@media (hover: hover){._inputContainer_1dxfo_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}}._inputContainer_1dxfo_5:focus-within:not(._errorInput_1dxfo_23):not(._disabled_1dxfo_23){box-shadow:0 0 0 2px color-mix(in srgb,var(--input-focus-shadow-color, #5A67D8) 30%,transparent)}._input_1dxfo_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1dxfo_32{display:flex}._errorInput_1dxfo_23{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1dxfo_23:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1dxfo_23:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_1dxfo_23{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1dxfo_44{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1dxfo_48{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1dxfo_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1dxfo_56{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1dxfo_63{display:none!important}._wrapper_27yo3_1{position:relative}._inputContainer_27yo3_5{background-color:transparent;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;padding-left:.75rem;padding-right:.75rem}._inputContainer_27yo3_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_27yo3_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_27yo3_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_27yo3_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_27yo3_13{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}@media (hover: hover){._inputContainer_27yo3_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}}._inputContainer_27yo3_5:focus-within:not(._errorInput_27yo3_23):not(._disabled_27yo3_23){box-shadow:0 0 0 2px color-mix(in srgb,var(--input-focus-shadow-color, #5A67D8) 30%,transparent)}._input_27yo3_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_27yo3_32{display:flex;align-items:center;justify-content:center}._errorInput_27yo3_23{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_27yo3_23:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_27yo3_23:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_27yo3_23{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_27yo3_44{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_27yo3_48{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_27yo3_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_27yo3_56{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_27yo3_63{display:none!important}._securityContent_27yo3_67{display:grid;grid-column-gap:5px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,auto))}._container_79xkl_1{display:flex;min-height:292px;width:100%;flex-direction:column;align-items:center;justify-content:center}._title_79xkl_5{margin-top:.5rem;font-weight:300}._container_1cz9d_1{margin-top:.5rem;display:flex;width:100%;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-start;-moz-column-gap:.25rem;column-gap:.25rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(254 231 239 / var(--tw-bg-opacity, 1));padding:.75rem 1rem}._container_1cz9d_1:is(._dark_1cz9d_1 *){background-color:#fee7ef80;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}._container_1cz9d_1 svg{width:16px;height:16px}._title_1cz9d_10{padding:0;padding-left:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:300;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._title_1cz9d_10:is(._dark_1cz9d_1 *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}
1
+ ._spinner_ni6jx_1{height:100%;width:100%}@keyframes _spin_ni6jx_1{to{transform:rotate(360deg)}}._spinner_ni6jx_1{animation:_spin_ni6jx_1 1s linear infinite;fill:#9ca3af;--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}._spinner_ni6jx_1:is(._dark_ni6jx_1 *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}._spinnerContainer_ni6jx_5{height:40px;width:40px}._success_ni6jx_9{position:absolute;top:50%;left:50%;height:3.5rem;width:3.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:#0d776e}._successContainer_ni6jx_13{position:relative;display:grid;height:5rem;width:5rem;flex:none;place-items:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(232 250 240 / var(--tw-bg-opacity, 1))}._successContainer_ni6jx_13:is(._dark_ni6jx_1 *){--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._successContainer_ni6jx_13{animation:_containerPulse_ni6jx_1 3s ease-in-out infinite}._successContainer_ni6jx_13:before,._successContainer_ni6jx_13:after{content:"";position:absolute;inset:0;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._successContainer_ni6jx_13:is(._dark_ni6jx_1 *):before,._successContainer_ni6jx_13:is(._dark_ni6jx_1 *):after{--tw-bg-opacity: 1;background-color:rgb(167 233 193 / var(--tw-bg-opacity, 1))}._successContainer_ni6jx_13:before,._successContainer_ni6jx_13:after{animation:_ripplePulse_ni6jx_1 3s cubic-bezier(.4,0,.6,1) infinite;opacity:0}._successContainer_ni6jx_13:after{animation-delay:.5s}@keyframes _containerPulse_ni6jx_1{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@keyframes _ripplePulse_ni6jx_1{0%{transform:scale(1);opacity:.6}to{transform:scale(1.3);opacity:0}}._container_ni6jx_50{width:30px;height:20px;display:flex;margin:0 1px;align-items:center;justify-content:center}._card_ni6jx_59{width:28px;height:19px;display:flex;margin:0 1px;align-items:center;justify-content:center}._warning_ni6jx_68{width:16px;height:16px;display:flex;align-items:center;justify-content:center}._svg_ni6jx_76{width:100%;height:100%}._srOnly_ni6jx_81{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}._backButton_ni6jx_85{width:30px;height:30px;display:flex;margin:0 1px;align-items:center;justify-content:center;background-color:#f4f4f5;border-radius:8px}._loader_nwq3e_1{position:absolute;height:100%;top:0;left:0;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:1000;display:flex;width:100%;align-items:center;justify-content:center;border-radius:10px}._checkout_lsspc_1{padding:0 2px;overflow:hidden;z-index:0;position:relative;height:auto;min-height:60px;width:100%;max-width:640px}._hidden_lsspc_8{display:none!important}._formInitial_lsspc_12{opacity:0;transform:translateY(100px)}._btnsInitial_lsspc_17{opacity:0;transform:translateY(-100px)}._buttons_1i8cu_1{display:grid;gap:.5rem}._hidden_1i8cu_5{display:none!important}._applePay_f1ztr_1{display:flex;flex-direction:column;gap:8px}@media (hover: hover){._applePay_f1ztr_1:hover{filter:contrast(.575) brightness(1.2)}}._hidden_f1ztr_28{display:none!important}._googlePay_gmreq_1{display:flex;flex-direction:column;gap:8px}._hidden_gmreq_20{display:none!important}._paypal_1p7d0_1{display:flex;flex-direction:column;gap:8px;height:40px;border-radius:12px;background-color:#ffc439}._hidden_1p7d0_10{display:none}._button_1bl11_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(13 118 110 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:1.5rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1bl11_1{transition-property:none}}._button_1bl11_1 span{margin-left:.25rem}@media (hover: hover){._button_1bl11_1:hover{opacity:.7}}._button_1bl11_1:active{transform:scale(.95)}._container_10ziz_2{display:flex;flex-direction:column;gap:.5rem}._venmo_10ziz_8{display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:12px;height:40px;background-color:#0088f7;width:100%;color:#fff;font-size:16px;text-align:center;cursor:pointer;transition:background-color .3s ease;svg{height:40%}@media (hover: hover){&:hover{background-color:#5683c1}}}._hidden_10ziz_35{display:none}._button_125my_1{cursor:pointer}._button_1lwej_1{margin-top:8px;transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(13 118 110 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1lwej_1{transition-property:none}}._button_1lwej_1 span{margin-left:.25rem}._disabled_1lwej_18{opacity:.7}@media (hover: hover){._button_1lwej_1:hover{opacity:.7}}._press_1lwej_28:active{transform:scale(.95)}._hidden_1lwej_32{display:none!important}._spinner_1lwej_36{width:24px;height:24px}._cardForm_ydw03_1{position:relative;display:grid;min-height:250px;gap:.75rem;padding-top:0}._hidden_ydw03_5{display:none!important}._topOffset_ydw03_9{margin-top:.5rem}._wrapper_1gvzd_1{position:relative}._inputContainer_1gvzd_5{background-color:transparent;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;padding-left:.75rem;padding-right:.75rem}._inputContainer_1gvzd_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1gvzd_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1gvzd_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_1gvzd_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1gvzd_13{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}@media (hover: hover){._inputContainer_1gvzd_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}}._inputContainer_1gvzd_5:focus-within:not(._errorInput_1gvzd_23):not(._disabled_1gvzd_23){box-shadow:0 0 0 2px color-mix(in srgb,var(--input-focus-shadow-color, #5A67D8) 30%,transparent)}._input_1gvzd_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1gvzd_32{display:flex}._errorInput_1gvzd_23{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1gvzd_23:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1gvzd_23:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._label_1gvzd_40{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1gvzd_44{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1gvzd_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1gvzd_52{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1gvzd_59{display:none!important}._wrapper_1dxfo_1{position:relative}._inputContainer_1dxfo_5{background-color:transparent;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;padding-left:.75rem;padding-right:.75rem}._inputContainer_1dxfo_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1dxfo_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1dxfo_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_1dxfo_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1dxfo_13{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}@media (hover: hover){._inputContainer_1dxfo_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}}._inputContainer_1dxfo_5:focus-within:not(._errorInput_1dxfo_23):not(._disabled_1dxfo_23){box-shadow:0 0 0 2px color-mix(in srgb,var(--input-focus-shadow-color, #5A67D8) 30%,transparent)}._input_1dxfo_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1dxfo_32{display:flex}._errorInput_1dxfo_23{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1dxfo_23:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1dxfo_23:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_1dxfo_23{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1dxfo_44{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1dxfo_48{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1dxfo_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1dxfo_56{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1dxfo_63{display:none!important}._wrapper_27yo3_1{position:relative}._inputContainer_27yo3_5{background-color:transparent;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;box-sizing:border-box;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;border-style:solid;padding-left:.75rem;padding-right:.75rem}._inputContainer_27yo3_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_27yo3_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_27yo3_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_27yo3_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_27yo3_13{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}@media (hover: hover){._inputContainer_27yo3_5:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}}._inputContainer_27yo3_5:focus-within:not(._errorInput_27yo3_23):not(._disabled_27yo3_23){box-shadow:0 0 0 2px color-mix(in srgb,var(--input-focus-shadow-color, #5A67D8) 30%,transparent)}._input_27yo3_5{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_27yo3_32{display:flex;align-items:center;justify-content:center}._errorInput_27yo3_23{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_27yo3_23:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_27yo3_23:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_27yo3_23{margin-top:.25rem;margin-bottom:0;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_27yo3_44{margin-bottom:2px;display:flex;align-items:flex-end;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_27yo3_48{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_27yo3_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_27yo3_56{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_27yo3_63{display:none!important}._securityContent_27yo3_67{display:grid;grid-column-gap:5px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,auto))}._container_79xkl_1{display:flex;min-height:292px;width:100%;flex-direction:column;align-items:center;justify-content:center}._title_79xkl_5{margin-top:.5rem;font-weight:300}._container_1cz9d_1{margin-top:.5rem;display:flex;width:100%;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-start;-moz-column-gap:.25rem;column-gap:.25rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(254 231 239 / var(--tw-bg-opacity, 1));padding:.75rem 1rem}._container_1cz9d_1:is(._dark_1cz9d_1 *){background-color:#fee7ef80;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}._container_1cz9d_1 svg{width:16px;height:16px}._title_1cz9d_10{padding:0;padding-left:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:300;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._title_1cz9d_10:is(._dark_1cz9d_1 *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}
package/dist/index.d.ts CHANGED
@@ -83,6 +83,15 @@ declare interface CheckoutConfig_2 {
83
83
  state: ICheckoutState;
84
84
  }
85
85
 
86
+ declare interface CheckoutError {
87
+ status: 'declined' | 'failed';
88
+ status_reason: {
89
+ advice_code: 'try_again_later' | 'do_not_try_again';
90
+ decline_code: DeclineCode;
91
+ message: string;
92
+ };
93
+ }
94
+
86
95
  declare class CheckoutModule {
87
96
  private readonly config;
88
97
  private component;
@@ -121,15 +130,11 @@ export declare interface CheckoutTranslate {
121
130
  placeholder: string;
122
131
  error: {
123
132
  incomplete: string;
124
- invalid: string;
125
133
  };
126
134
  };
127
135
  name: {
128
136
  label: string;
129
137
  placeholder: string;
130
- error: {
131
- invalid: string;
132
- };
133
138
  };
134
139
  pay: {
135
140
  button: string;
@@ -139,7 +144,6 @@ export declare interface CheckoutTranslate {
139
144
  };
140
145
  };
141
146
  status: {
142
- success: string;
143
147
  error: string;
144
148
  invalidSession: string;
145
149
  };
@@ -158,8 +162,28 @@ export declare interface CheckoutTranslate {
158
162
  };
159
163
  }
160
164
 
165
+ declare interface CheckoutTranslateOverrides {
166
+ status?: {
167
+ error?: string;
168
+ invalidSession?: string;
169
+ };
170
+ errors?: {
171
+ doNotHonor?: string;
172
+ insufficientFunds?: string;
173
+ limitExceeded?: string;
174
+ expiredCard?: string;
175
+ invalidCreditCardNumber?: string;
176
+ processorDeclinedFraudSuspected?: string;
177
+ cardholderAuthenticationRequired?: string;
178
+ offlineIssuerDeclined?: string;
179
+ cardReportedAsLostOrStolen?: string;
180
+ invalidSecurePaymentData?: string;
181
+ declined?: string;
182
+ };
183
+ }
184
+
161
185
  declare interface CheckoutTranslateState {
162
- overrides?: DeepPartial<CheckoutTranslate>;
186
+ overrides?: CheckoutTranslateOverrides;
163
187
  messages: CheckoutTranslate;
164
188
  locale: Locale;
165
189
  }
@@ -266,15 +290,6 @@ declare interface ICheckoutState {
266
290
  styles: StylesState;
267
291
  }
268
292
 
269
- declare interface IErrorInterface {
270
- status: 'declined' | 'failed';
271
- status_reason: {
272
- advice_code: 'try_again_later' | 'do_not_try_again';
273
- decline_code: DeclineCode;
274
- message: string;
275
- };
276
- }
277
-
278
293
  declare interface IGooglePayButtonStyles {
279
294
  styles?: Partial<Pick<GooglePayOptions, 'type' | 'color' | 'borderRadius' | 'size'>>;
280
295
  }
@@ -297,7 +312,7 @@ declare interface IPayPalButtonStyles {
297
312
 
298
313
  declare type Listener<TData> = (data: TData) => void;
299
314
 
300
- export declare type Locale = 'ar' | 'en' | 'bg' | 'cs' | 'da' | 'de' | 'el' | 'es' | 'et' | 'fi' | 'fil' | 'fr' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lt' | 'lv' | 'ms' | 'ru' | 'mt' | 'nb' | 'no' | 'nl' | 'pl' | 'pt' | 'ro' | 'ua' | 'sk' | 'sl' | 'sv' | 'th' | 'tr' | 'vi' | 'zh';
315
+ export declare type Locale = 'ar' | 'en' | 'bg' | 'cs' | 'da' | 'de' | 'el' | 'es' | 'et' | 'fi' | 'fil' | 'fr' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lt' | 'lv' | 'ms' | 'ru' | 'mt' | 'no' | 'nl' | 'pl' | 'pt' | 'ro' | 'uk' | 'sk' | 'sl' | 'sv' | 'th' | 'tr' | 'vi' | 'zh';
301
316
 
302
317
  export declare enum PaymentMethod {
303
318
  PAYPAL = "PAYPAL",
@@ -412,7 +427,7 @@ export declare interface PaymentResult {
412
427
  type: string;
413
428
  };
414
429
  refunded_amount: number;
415
- status_reason: IErrorInterface;
430
+ status_reason: CheckoutError;
416
431
  subscription?: {
417
432
  id: string;
418
433
  created_at: string;
@@ -486,11 +501,11 @@ export declare interface PayNextConfig {
486
501
  apiVersion: string;
487
502
  variant?: 'default' | 'compact';
488
503
  styles?: StylesConfig;
489
- translate?: DeepPartial<CheckoutTranslate>;
504
+ translate?: CheckoutTranslateOverrides;
490
505
  locale?: Locale;
491
506
  onCheckoutAttempt?: (result: AttemptResult) => void;
492
507
  onCheckoutComplete?: (result: PaymentResult) => void;
493
- onCheckoutFail?: (error: IErrorInterface) => void;
508
+ onCheckoutFail?: (error: CheckoutError) => void;
494
509
  }
495
510
 
496
511
  declare class PayPalService {
@@ -567,9 +582,9 @@ declare class TransactionState extends State<TransactionConfig | null> {
567
582
 
568
583
  declare class TranslateState extends State<CheckoutTranslateState> {
569
584
  constructor();
570
- setMessages(overrides: DeepPartial<CheckoutTranslate>): void;
585
+ setMessages(overrides: CheckoutTranslateOverrides): void;
571
586
  setLocale(locale: Locale): void;
572
- overrides(): DeepPartial<CheckoutTranslate> | undefined;
587
+ overrides(): CheckoutTranslateOverrides | undefined;
573
588
  messages(): CheckoutTranslate;
574
589
  locale(): Locale;
575
590
  dir(): 'rtl' | 'ltr';