@reevit/react 0.5.3 → 0.5.4

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.mts CHANGED
@@ -179,6 +179,8 @@ interface PaymentIntent {
179
179
  availableMethods: PaymentMethod[];
180
180
  /** Reference provided or generated */
181
181
  reference?: string;
182
+ /** Organization ID (from Reevit backend, required for webhook routing) */
183
+ orgId?: string;
182
184
  /** Connection ID (from Reevit backend) */
183
185
  connectionId?: string;
184
186
  /** Provider name (from backend) */
@@ -612,6 +614,7 @@ declare function useMPesaStatusPolling(statusEndpoint: string, checkoutRequestId
612
614
 
613
615
  interface PaymentIntentResponse {
614
616
  id: string;
617
+ org_id?: string;
615
618
  connection_id: string;
616
619
  provider: string;
617
620
  status: string;
package/dist/index.d.ts CHANGED
@@ -179,6 +179,8 @@ interface PaymentIntent {
179
179
  availableMethods: PaymentMethod[];
180
180
  /** Reference provided or generated */
181
181
  reference?: string;
182
+ /** Organization ID (from Reevit backend, required for webhook routing) */
183
+ orgId?: string;
182
184
  /** Connection ID (from Reevit backend) */
183
185
  connectionId?: string;
184
186
  /** Provider name (from backend) */
@@ -612,6 +614,7 @@ declare function useMPesaStatusPolling(statusEndpoint: string, checkoutRequestId
612
614
 
613
615
  interface PaymentIntentResponse {
614
616
  id: string;
617
+ org_id?: string;
615
618
  connection_id: string;
616
619
  provider: string;
617
620
  status: string;
package/dist/index.js CHANGED
@@ -338,7 +338,7 @@ function reevitReducer(state, action) {
338
338
  case "INIT_ERROR":
339
339
  return { ...state, status: "failed", error: action.payload };
340
340
  case "SELECT_METHOD":
341
- return { ...state, status: "method_selected", selectedMethod: action.payload, error: null };
341
+ return { ...state, status: "method_selected", selectedMethod: action.payload };
342
342
  case "PROCESS_START":
343
343
  return { ...state, status: "processing", error: null };
344
344
  case "PROCESS_SUCCESS":
@@ -429,6 +429,7 @@ function mapToPaymentIntent(response, config) {
429
429
  availableMethods: config.paymentMethods || ["card", "mobile_money"],
430
430
  reference: response.reference || response.id,
431
431
  // Use backend reference or fallback to ID
432
+ orgId: response.org_id,
432
433
  connectionId: response.connection_id,
433
434
  provider: response.provider,
434
435
  feeAmount: response.fee_amount,
@@ -1134,7 +1135,6 @@ function PaystackBridge({
1134
1135
  if (!window.PaystackPop) {
1135
1136
  throw new Error("Paystack script loaded but PaystackPop not available");
1136
1137
  }
1137
- const safeMetadata = accessCode ? void 0 : metadata;
1138
1138
  const setupConfig = {
1139
1139
  key: publicKey,
1140
1140
  email,
@@ -1143,7 +1143,7 @@ function PaystackBridge({
1143
1143
  currency,
1144
1144
  ref: reference,
1145
1145
  access_code: accessCode,
1146
- metadata: safeMetadata,
1146
+ metadata,
1147
1147
  channels,
1148
1148
  callback: (response) => {
1149
1149
  console.log("[PaystackBridge] Callback received", response);
@@ -2401,6 +2401,7 @@ function ReevitCheckout({
2401
2401
  const pspKey = paymentIntent?.pspPublicKey || publicKey || "";
2402
2402
  const bridgeMetadata = {
2403
2403
  ...metadata,
2404
+ org_id: paymentIntent?.orgId ?? metadata?.org_id,
2404
2405
  payment_id: paymentIntent?.id,
2405
2406
  connection_id: paymentIntent?.connectionId ?? metadata?.connection_id,
2406
2407
  customer_phone: momoData?.phone || phone