@paynext/sdk 0.0.94 → 0.0.96

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
@@ -112,6 +112,7 @@ interface PayNextConfig {
112
112
  variant?: 'default' | 'compact'
113
113
  locale?: Locale
114
114
  translate?: CheckoutTranslate
115
+ errorMessageText?: string
115
116
  styles?: StylesConfig
116
117
  onCheckoutLoaded?: (result: LoadedResult) => void
117
118
  onCheckoutAttempt?: (result: AttemptResult) => void
@@ -125,6 +126,45 @@ interface LoadedResult {
125
126
  }
126
127
  ```
127
128
 
129
+ ### Add a Submit Button Icon
130
+
131
+ Provide inline SVG markup via `styles.SubmitButton.iconSvg` to render an icon to the left of the "Pay with card" button label. The SDK hides the icon and shows a spinner while a payment request is in flight, then restores the icon once processing finishes. A 24x24px viewBox keeps the layout balanced.
132
+
133
+ ```ts
134
+ const checkout = new PayNextCheckout(container)
135
+
136
+ await checkout.mount({
137
+ ...config,
138
+ styles: {
139
+ SubmitButton: {
140
+ iconSvg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
141
+ <path d="M6 12L10 16L18 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
142
+ </svg>`
143
+ }
144
+ }
145
+ })
146
+ ```
147
+
148
+ ### Customize the Back Button
149
+
150
+ Pass `styles.BackButton` to adjust the container that wraps the default arrow icon. Both `className` and `styles` map directly onto that wrapper `<div>`, letting you add global CSS hooks or inline overrides without replacing the built-in markup.
151
+
152
+ ```ts
153
+ const checkout = new PayNextCheckout(container)
154
+
155
+ await checkout.mount({
156
+ ...config,
157
+ styles: {
158
+ BackButton: {
159
+ className: 'my-back-button',
160
+ styles: {
161
+ color: '#111827'
162
+ }
163
+ }
164
+ }
165
+ })
166
+ ```
167
+
128
168
  ## Supported Payment Methods
129
169
 
130
170
  - **Cards**: Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, Maestro
package/dist/index.d.ts CHANGED
@@ -310,6 +310,10 @@ declare interface IPayPalButtonStyles {
310
310
  styles?: PayPalButtonStyle;
311
311
  }
312
312
 
313
+ declare interface ISubmitButtonStyles extends HTMLStyles {
314
+ iconSvg?: string;
315
+ }
316
+
313
317
  declare type Listener<TData> = (data: TData) => void;
314
318
 
315
319
  declare interface LoadedResult {
@@ -508,6 +512,7 @@ export declare interface PayNextConfig {
508
512
  styles?: StylesConfig;
509
513
  translate?: CheckoutTranslateOverrides;
510
514
  locale?: Locale;
515
+ errorMessageText?: string;
511
516
  onCheckoutLoaded?: (result: LoadedResult) => void;
512
517
  onCheckoutAttempt?: (result: AttemptResult) => void;
513
518
  onCheckoutComplete?: (result: PaymentResult) => void;
@@ -534,12 +539,13 @@ declare abstract class State<TState> {
534
539
 
535
540
  export declare interface StylesConfig {
536
541
  Input?: InputStyles;
537
- SubmitButton?: HTMLStyles;
542
+ SubmitButton?: ISubmitButtonStyles;
538
543
  ApplePayButton?: IApplePayButtonStyles;
539
544
  PayPalButton?: IPayPalButtonStyles;
540
545
  GooglePayButton?: IGooglePayButtonStyles;
541
546
  WalletButton?: HTMLStyles;
542
547
  BraintreeButton?: HTMLStyles;
548
+ BackButton?: HTMLStyles;
543
549
  }
544
550
 
545
551
  declare class StylesState extends State<StylesConfig> {