choco-one-click-payment 1.1.21 → 1.1.22

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/index.d.ts CHANGED
@@ -121,6 +121,18 @@ export interface ChocoOneClickConfig {
121
121
  */
122
122
  onAppliedBonus?: (useBonuses: boolean) => void;
123
123
 
124
+ /**
125
+ * Async callback вызываемый перед отправкой платежа (внутри session.onpaymentauthorized для Apple Pay).
126
+ * Позволяет создать заказ в момент подтверждения оплаты и вернуть обновлённые поля конфига (например, preorderId).
127
+ * Возвращаемый объект мержится в конфиг виджета перед вызовом createCheckoutApplePay.
128
+ * @example
129
+ * onBeforeCheckout: async () => {
130
+ * const order = await OrdersService.create(payload, idempotencyKey);
131
+ * return { preorderId: order.id };
132
+ * }
133
+ */
134
+ onBeforeCheckout?: () => Promise<Partial<ChocoOneClickConfig> | void> | Partial<ChocoOneClickConfig> | void;
135
+
124
136
  /**
125
137
  * Акцентный цвет (фон кнопки оплаты и включенного тумблера баланса)
126
138
  * @default "#2F2F2F"