@delopay/sdk 0.174.0 → 0.176.0

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/dist/index.d.cts CHANGED
@@ -220,6 +220,8 @@ interface PaymentCreateRequest {
220
220
  description?: string | null;
221
221
  /** URL to redirect the customer to after payment (required for redirect-based methods). */
222
222
  return_url?: string | null;
223
+ /** URL to leave an unpaid hosted checkout; never falls back to `return_url`. */
224
+ cancel_url?: string | null;
223
225
  /**
224
226
  * How long the client secret / hosted checkout link stays usable, in
225
227
  * seconds from creation. Omit to inherit the shop's default
@@ -324,6 +326,8 @@ interface PaymentUpdateRequest {
324
326
  customer_id?: string | null;
325
327
  description?: string | null;
326
328
  return_url?: string | null;
329
+ /** See {@link PaymentCreateRequest.cancel_url}. */
330
+ cancel_url?: string | null;
327
331
  statement_descriptor_name?: string | null;
328
332
  statement_descriptor_suffix?: string | null;
329
333
  metadata?: Record<string, unknown> | null;
@@ -347,6 +351,8 @@ interface PaymentConfirmRequest {
347
351
  payment_method_data?: Record<string, unknown> | null;
348
352
  payment_token?: string | null;
349
353
  return_url?: string | null;
354
+ /** See {@link PaymentCreateRequest.cancel_url}. */
355
+ cancel_url?: string | null;
350
356
  billing?: Address | null;
351
357
  shipping?: Address | null;
352
358
  mandate_id?: string | null;
@@ -444,6 +450,8 @@ interface PaymentResponse {
444
450
  description?: string | null;
445
451
  /** Redirect URL used after payment completion. */
446
452
  return_url?: string | null;
453
+ /** URL the buyer may use to leave before paying. */
454
+ cancel_url?: string | null;
447
455
  /** Billing address. */
448
456
  billing?: Address | null;
449
457
  /** Shipping address. */
@@ -3254,6 +3262,7 @@ interface PaymentLinkDetails {
3254
3262
  payment_id: string;
3255
3263
  session_expiry: string;
3256
3264
  merchant_logo: string;
3265
+ cancel_url?: string | null;
3257
3266
  merchant_name: string;
3258
3267
  max_items_visible_after_collapse: number;
3259
3268
  theme: string;
@@ -3277,6 +3286,7 @@ interface PaymentLinkStatusDetails {
3277
3286
  currency: Currency;
3278
3287
  payment_id: string;
3279
3288
  merchant_logo: string;
3289
+ cancel_url?: string | null;
3280
3290
  merchant_name: string;
3281
3291
  created: string;
3282
3292
  status: IntentStatus | 'active' | 'expired';
@@ -5290,6 +5300,8 @@ interface ConnectorListResponse {
5290
5300
  interface ProfileCreateRequest {
5291
5301
  profile_name?: string | null;
5292
5302
  return_url?: string | null;
5303
+ /** Optional default unpaid-checkout exit URL for this shop. */
5304
+ cancel_url?: string | null;
5293
5305
  enable_payment_response_hash?: boolean | null;
5294
5306
  payment_response_hash_key?: string | null;
5295
5307
  redirect_to_merchant_with_http_post?: boolean | null;
@@ -5348,6 +5360,8 @@ interface ProfileCreateRequest {
5348
5360
  interface ProfileUpdateRequest {
5349
5361
  profile_name?: string | null;
5350
5362
  return_url?: string | null;
5363
+ /** Absent leaves unchanged; explicit null clears the shop's Cancel URL. */
5364
+ cancel_url?: string | null;
5351
5365
  enable_payment_response_hash?: boolean | null;
5352
5366
  payment_response_hash_key?: string | null;
5353
5367
  redirect_to_merchant_with_http_post?: boolean | null;
@@ -5423,6 +5437,8 @@ interface ProfileResponse {
5423
5437
  force_3ds_challenge: boolean;
5424
5438
  is_pre_network_tokenization_enabled: boolean;
5425
5439
  return_url?: string | null;
5440
+ /** The shop's optional default unpaid-checkout exit URL. */
5441
+ cancel_url?: string | null;
5426
5442
  payment_response_hash_key?: string | null;
5427
5443
  webhook_details?: WebhookDetails | null;
5428
5444
  metadata?: Record<string, unknown> | null;
@@ -6938,7 +6954,7 @@ type AnalyticsGranularity = 'day' | 'hour' | '30m' | '15m' | '5m';
6938
6954
  /** The dashboards' four outcomes; `open` is processing + awaiting action. */
6939
6955
  type AnalyticsOutcome = 'success' | 'open' | 'failed' | 'void';
6940
6956
  /** Checkout channel token, as the device dashboard's channel series names them. */
6941
- type AnalyticsChannel = 'hosted' | 'embedded' | 'api' | 'dashboard' | 'sdk' | 'unknown';
6957
+ type AnalyticsChannel = 'hosted' | 'embedded' | 'auto_redirect' | 'api' | 'dashboard' | 'sdk' | 'unknown';
6942
6958
  /** Sort keys of the payments drill (`GET /analytics/scope/transactions`). */
6943
6959
  type ScopeDrillSortKey = 'created_at' | 'payment_created_at' | 'amount' | 'status' | 'connector' | 'method';
6944
6960
  /** Sort keys of the geo and device drills: the payments keys plus `time_to_pay`. */
@@ -7361,6 +7377,9 @@ interface DeviceChannelBucket {
7361
7377
  hosted: number;
7362
7378
  /** Hosted checkout embedded in the merchant's page. */
7363
7379
  embedded: number;
7380
+ /** Hosted checkout opened through a merchant-authored auto-redirect link.
7381
+ * Absent on routers predating DeloPay-net/delopay-backend#1768. */
7382
+ auto_redirect?: number;
7364
7383
  /** API / server-initiated. */
7365
7384
  api: number;
7366
7385
  dashboard: number;
@@ -9997,7 +10016,7 @@ interface EpayoutsPaypalCaptureResponse {
9997
10016
  matches_order?: boolean;
9998
10017
  }
9999
10018
  /** The closed set of buyer-side checkout events. */
10000
- type CheckoutEventKind$1 = 'native_pane_selected' | 'native_pane_tab_opened' | 'native_pane_tab_blocked' | 'native_pane_abandoned' | 'native_pane_returned';
10019
+ type CheckoutEventKind$1 = 'native_pane_selected' | 'native_pane_tab_opened' | 'native_pane_tab_blocked' | 'native_pane_abandoned' | 'native_pane_returned' | 'checkout_cancelled';
10001
10020
  interface RecordCheckoutEventRequest {
10002
10021
  event: CheckoutEventKind$1;
10003
10022
  /** Native-pane catalog key the event is about (`apple_pay`, `klarna`, …). */
@@ -10140,7 +10159,8 @@ interface StripeHostedConfirmRequest {
10140
10159
  confirmation_token?: string | null;
10141
10160
  /**
10142
10161
  * The acquisition channel the checkout reports on the Stripe return URL
10143
- * (`hosted_checkout` or `hosted_checkout_iframe`).
10162
+ * (`hosted_checkout`, `hosted_checkout_iframe`, or
10163
+ * `hosted_checkout_auto_redirect`).
10144
10164
  */
10145
10165
  pcs?: string | null;
10146
10166
  }
@@ -16805,6 +16825,9 @@ interface CheckoutBranding {
16805
16825
  totalLabel: string;
16806
16826
  showCurrencyCode: boolean;
16807
16827
  showOrderItems: boolean;
16828
+ cancelLinkEnabled: boolean;
16829
+ cancelLinkPosition: 'top' | 'bottom';
16830
+ cancelLinkStyle: 'link' | 'button';
16808
16831
  showSurcharge: boolean;
16809
16832
  surchargePosition: SurchargePosition;
16810
16833
  nativeElementPosition: NativeElementPosition;
@@ -17974,7 +17997,7 @@ declare function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string;
17974
17997
  * The `native_pane_` prefix is the router's enum on the wire and does not move
17975
17998
  * with the rename — see the module header.
17976
17999
  */
17977
- declare const CHECKOUT_EVENT_KINDS: readonly ["native_pane_selected", "native_pane_tab_opened", "native_pane_tab_blocked", "native_pane_abandoned", "native_pane_returned"];
18000
+ declare const CHECKOUT_EVENT_KINDS: readonly ["native_pane_selected", "native_pane_tab_opened", "native_pane_tab_blocked", "native_pane_abandoned", "native_pane_returned", "checkout_cancelled"];
17978
18001
  type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];
17979
18002
  /** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */
17980
18003
  type StripeNativePane = Pane;
package/dist/index.d.ts CHANGED
@@ -220,6 +220,8 @@ interface PaymentCreateRequest {
220
220
  description?: string | null;
221
221
  /** URL to redirect the customer to after payment (required for redirect-based methods). */
222
222
  return_url?: string | null;
223
+ /** URL to leave an unpaid hosted checkout; never falls back to `return_url`. */
224
+ cancel_url?: string | null;
223
225
  /**
224
226
  * How long the client secret / hosted checkout link stays usable, in
225
227
  * seconds from creation. Omit to inherit the shop's default
@@ -324,6 +326,8 @@ interface PaymentUpdateRequest {
324
326
  customer_id?: string | null;
325
327
  description?: string | null;
326
328
  return_url?: string | null;
329
+ /** See {@link PaymentCreateRequest.cancel_url}. */
330
+ cancel_url?: string | null;
327
331
  statement_descriptor_name?: string | null;
328
332
  statement_descriptor_suffix?: string | null;
329
333
  metadata?: Record<string, unknown> | null;
@@ -347,6 +351,8 @@ interface PaymentConfirmRequest {
347
351
  payment_method_data?: Record<string, unknown> | null;
348
352
  payment_token?: string | null;
349
353
  return_url?: string | null;
354
+ /** See {@link PaymentCreateRequest.cancel_url}. */
355
+ cancel_url?: string | null;
350
356
  billing?: Address | null;
351
357
  shipping?: Address | null;
352
358
  mandate_id?: string | null;
@@ -444,6 +450,8 @@ interface PaymentResponse {
444
450
  description?: string | null;
445
451
  /** Redirect URL used after payment completion. */
446
452
  return_url?: string | null;
453
+ /** URL the buyer may use to leave before paying. */
454
+ cancel_url?: string | null;
447
455
  /** Billing address. */
448
456
  billing?: Address | null;
449
457
  /** Shipping address. */
@@ -3254,6 +3262,7 @@ interface PaymentLinkDetails {
3254
3262
  payment_id: string;
3255
3263
  session_expiry: string;
3256
3264
  merchant_logo: string;
3265
+ cancel_url?: string | null;
3257
3266
  merchant_name: string;
3258
3267
  max_items_visible_after_collapse: number;
3259
3268
  theme: string;
@@ -3277,6 +3286,7 @@ interface PaymentLinkStatusDetails {
3277
3286
  currency: Currency;
3278
3287
  payment_id: string;
3279
3288
  merchant_logo: string;
3289
+ cancel_url?: string | null;
3280
3290
  merchant_name: string;
3281
3291
  created: string;
3282
3292
  status: IntentStatus | 'active' | 'expired';
@@ -5290,6 +5300,8 @@ interface ConnectorListResponse {
5290
5300
  interface ProfileCreateRequest {
5291
5301
  profile_name?: string | null;
5292
5302
  return_url?: string | null;
5303
+ /** Optional default unpaid-checkout exit URL for this shop. */
5304
+ cancel_url?: string | null;
5293
5305
  enable_payment_response_hash?: boolean | null;
5294
5306
  payment_response_hash_key?: string | null;
5295
5307
  redirect_to_merchant_with_http_post?: boolean | null;
@@ -5348,6 +5360,8 @@ interface ProfileCreateRequest {
5348
5360
  interface ProfileUpdateRequest {
5349
5361
  profile_name?: string | null;
5350
5362
  return_url?: string | null;
5363
+ /** Absent leaves unchanged; explicit null clears the shop's Cancel URL. */
5364
+ cancel_url?: string | null;
5351
5365
  enable_payment_response_hash?: boolean | null;
5352
5366
  payment_response_hash_key?: string | null;
5353
5367
  redirect_to_merchant_with_http_post?: boolean | null;
@@ -5423,6 +5437,8 @@ interface ProfileResponse {
5423
5437
  force_3ds_challenge: boolean;
5424
5438
  is_pre_network_tokenization_enabled: boolean;
5425
5439
  return_url?: string | null;
5440
+ /** The shop's optional default unpaid-checkout exit URL. */
5441
+ cancel_url?: string | null;
5426
5442
  payment_response_hash_key?: string | null;
5427
5443
  webhook_details?: WebhookDetails | null;
5428
5444
  metadata?: Record<string, unknown> | null;
@@ -6938,7 +6954,7 @@ type AnalyticsGranularity = 'day' | 'hour' | '30m' | '15m' | '5m';
6938
6954
  /** The dashboards' four outcomes; `open` is processing + awaiting action. */
6939
6955
  type AnalyticsOutcome = 'success' | 'open' | 'failed' | 'void';
6940
6956
  /** Checkout channel token, as the device dashboard's channel series names them. */
6941
- type AnalyticsChannel = 'hosted' | 'embedded' | 'api' | 'dashboard' | 'sdk' | 'unknown';
6957
+ type AnalyticsChannel = 'hosted' | 'embedded' | 'auto_redirect' | 'api' | 'dashboard' | 'sdk' | 'unknown';
6942
6958
  /** Sort keys of the payments drill (`GET /analytics/scope/transactions`). */
6943
6959
  type ScopeDrillSortKey = 'created_at' | 'payment_created_at' | 'amount' | 'status' | 'connector' | 'method';
6944
6960
  /** Sort keys of the geo and device drills: the payments keys plus `time_to_pay`. */
@@ -7361,6 +7377,9 @@ interface DeviceChannelBucket {
7361
7377
  hosted: number;
7362
7378
  /** Hosted checkout embedded in the merchant's page. */
7363
7379
  embedded: number;
7380
+ /** Hosted checkout opened through a merchant-authored auto-redirect link.
7381
+ * Absent on routers predating DeloPay-net/delopay-backend#1768. */
7382
+ auto_redirect?: number;
7364
7383
  /** API / server-initiated. */
7365
7384
  api: number;
7366
7385
  dashboard: number;
@@ -9997,7 +10016,7 @@ interface EpayoutsPaypalCaptureResponse {
9997
10016
  matches_order?: boolean;
9998
10017
  }
9999
10018
  /** The closed set of buyer-side checkout events. */
10000
- type CheckoutEventKind$1 = 'native_pane_selected' | 'native_pane_tab_opened' | 'native_pane_tab_blocked' | 'native_pane_abandoned' | 'native_pane_returned';
10019
+ type CheckoutEventKind$1 = 'native_pane_selected' | 'native_pane_tab_opened' | 'native_pane_tab_blocked' | 'native_pane_abandoned' | 'native_pane_returned' | 'checkout_cancelled';
10001
10020
  interface RecordCheckoutEventRequest {
10002
10021
  event: CheckoutEventKind$1;
10003
10022
  /** Native-pane catalog key the event is about (`apple_pay`, `klarna`, …). */
@@ -10140,7 +10159,8 @@ interface StripeHostedConfirmRequest {
10140
10159
  confirmation_token?: string | null;
10141
10160
  /**
10142
10161
  * The acquisition channel the checkout reports on the Stripe return URL
10143
- * (`hosted_checkout` or `hosted_checkout_iframe`).
10162
+ * (`hosted_checkout`, `hosted_checkout_iframe`, or
10163
+ * `hosted_checkout_auto_redirect`).
10144
10164
  */
10145
10165
  pcs?: string | null;
10146
10166
  }
@@ -16805,6 +16825,9 @@ interface CheckoutBranding {
16805
16825
  totalLabel: string;
16806
16826
  showCurrencyCode: boolean;
16807
16827
  showOrderItems: boolean;
16828
+ cancelLinkEnabled: boolean;
16829
+ cancelLinkPosition: 'top' | 'bottom';
16830
+ cancelLinkStyle: 'link' | 'button';
16808
16831
  showSurcharge: boolean;
16809
16832
  surchargePosition: SurchargePosition;
16810
16833
  nativeElementPosition: NativeElementPosition;
@@ -17974,7 +17997,7 @@ declare function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string;
17974
17997
  * The `native_pane_` prefix is the router's enum on the wire and does not move
17975
17998
  * with the rename — see the module header.
17976
17999
  */
17977
- declare const CHECKOUT_EVENT_KINDS: readonly ["native_pane_selected", "native_pane_tab_opened", "native_pane_tab_blocked", "native_pane_abandoned", "native_pane_returned"];
18000
+ declare const CHECKOUT_EVENT_KINDS: readonly ["native_pane_selected", "native_pane_tab_opened", "native_pane_tab_blocked", "native_pane_abandoned", "native_pane_returned", "checkout_cancelled"];
17978
18001
  type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];
17979
18002
  /** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */
17980
18003
  type StripeNativePane = Pane;
package/dist/index.js CHANGED
@@ -215,7 +215,7 @@ import {
215
215
  validatePanes,
216
216
  verticalGapValue,
217
217
  visibleCustomFields
218
- } from "./chunk-7KHTBFO6.js";
218
+ } from "./chunk-OBEPMMEL.js";
219
219
  export {
220
220
  AIRWALLEX_AUTOFILL_TREATMENTS,
221
221
  AIRWALLEX_CARD_LAYOUTS,
package/dist/internal.cjs CHANGED
@@ -7800,6 +7800,9 @@ var DEFAULT_BRANDING_BASE = {
7800
7800
  totalLabel: "Total",
7801
7801
  showCurrencyCode: false,
7802
7802
  showOrderItems: true,
7803
+ cancelLinkEnabled: true,
7804
+ cancelLinkPosition: "top",
7805
+ cancelLinkStyle: "link",
7803
7806
  // Each flat field keeps its meaning: what the merchant wrote, used in every
7804
7807
  // locale that carries no override. Empty maps therefore change nothing for a
7805
7808
  // profile saved before translations existed.
@@ -8618,6 +8621,17 @@ function decodeBranding(source) {
8618
8621
  totalLabel: s(extras["totalLabel"]) || DEFAULT_BRANDING.totalLabel,
8619
8622
  showCurrencyCode: parseBool(extras["showCurrencyCode"], DEFAULT_BRANDING.showCurrencyCode),
8620
8623
  showOrderItems: parseBool(extras["showOrderItems"], DEFAULT_BRANDING.showOrderItems),
8624
+ cancelLinkEnabled: parseBool(extras["cancelLinkEnabled"], DEFAULT_BRANDING.cancelLinkEnabled),
8625
+ cancelLinkPosition: pickEnum(
8626
+ extras["cancelLinkPosition"],
8627
+ ["top", "bottom"],
8628
+ DEFAULT_BRANDING.cancelLinkPosition
8629
+ ),
8630
+ cancelLinkStyle: pickEnum(
8631
+ extras["cancelLinkStyle"],
8632
+ ["link", "button"],
8633
+ DEFAULT_BRANDING.cancelLinkStyle
8634
+ ),
8621
8635
  trustBadges: trustRow.trustBadges,
8622
8636
  notices: trustRow.notices,
8623
8637
  customFields: decodedCustomFields ?? [],
@@ -8857,6 +8871,9 @@ function encodeBranding(branding, base) {
8857
8871
  totalLabel: branding.totalLabel,
8858
8872
  showCurrencyCode: String(branding.showCurrencyCode),
8859
8873
  showOrderItems: String(branding.showOrderItems),
8874
+ cancelLinkEnabled: String(branding.cancelLinkEnabled),
8875
+ cancelLinkPosition: branding.cancelLinkPosition,
8876
+ cancelLinkStyle: branding.cancelLinkStyle,
8860
8877
  showLogo: String(branding.showLogo),
8861
8878
  logoShape: branding.logoShape,
8862
8879
  logoSize: branding.logoSize,
@@ -9124,6 +9141,17 @@ function parseImportedBranding(raw) {
9124
9141
  trustBadges,
9125
9142
  notices,
9126
9143
  customFields,
9144
+ cancelLinkEnabled: parseBool(root["cancelLinkEnabled"], dflt.cancelLinkEnabled),
9145
+ cancelLinkPosition: pickEnum(
9146
+ root["cancelLinkPosition"],
9147
+ ["top", "bottom"],
9148
+ dflt.cancelLinkPosition
9149
+ ),
9150
+ cancelLinkStyle: pickEnum(
9151
+ root["cancelLinkStyle"],
9152
+ ["link", "button"],
9153
+ dflt.cancelLinkStyle
9154
+ ),
9127
9155
  // An export writes the decoded maps; a hand-written file may carry the
9128
9156
  // JSON strings the bag uses. Both are accepted, and neither is required.
9129
9157
  methodSectionOrder: parseSectionOrderLoose(root[METHOD_SECTION_ORDER_KEY]),
@@ -10253,7 +10281,8 @@ var CHECKOUT_EVENT_KINDS = [
10253
10281
  "native_pane_tab_opened",
10254
10282
  "native_pane_tab_blocked",
10255
10283
  "native_pane_abandoned",
10256
- "native_pane_returned"
10284
+ "native_pane_returned",
10285
+ "checkout_cancelled"
10257
10286
  ];
10258
10287
  var STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;
10259
10288
  var NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;