@miden-npm/react 2.1.6 → 2.1.9

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.js CHANGED
@@ -3582,6 +3582,7 @@ function PayByCard({
3582
3582
  {
3583
3583
  label: "Card Pin",
3584
3584
  required: true,
3585
+ type: "password",
3585
3586
  rules: ["numeric"],
3586
3587
  value: payForm.cardPin,
3587
3588
  mask: "0000",
@@ -3636,7 +3637,7 @@ function PayByCard({
3636
3637
  }
3637
3638
  ),
3638
3639
  /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between gap-4 mt-6", children: [
3639
- formIndex > 0 && /* @__PURE__ */ jsx36(
3640
+ formIndex < 2 && /* @__PURE__ */ jsx36(
3640
3641
  BaseButton,
3641
3642
  {
3642
3643
  label: "Previous",
@@ -3658,12 +3659,13 @@ function PayByCard({
3658
3659
  disabled: isMakingPayment
3659
3660
  }
3660
3661
  ),
3661
- formIndex === 2 && /* @__PURE__ */ jsx36("div", { className: "w-1/2", children: /* @__PURE__ */ jsx36(
3662
+ formIndex === 2 && /* @__PURE__ */ jsx36("div", { className: "w-full", children: /* @__PURE__ */ jsx36(
3662
3663
  BaseButton,
3663
3664
  {
3664
3665
  label: "Validate OTP",
3665
3666
  type: "primary",
3666
3667
  caller,
3668
+ customClass: "w-full",
3667
3669
  loading: isValidatingOtp,
3668
3670
  onClick: proceedHandler
3669
3671
  }
@@ -4138,9 +4140,10 @@ var PayByStableCoin = ({
4138
4140
  environment,
4139
4141
  caller
4140
4142
  );
4143
+ const newResponse = caller === "buzapay" ? response.data : response.stableCoins;
4141
4144
  if (response?.isSuccessful) {
4142
4145
  setStableCoins(
4143
- response.data?.map((c) => ({
4146
+ newResponse?.map((c) => ({
4144
4147
  label: c.name,
4145
4148
  value: c.name
4146
4149
  })) ?? []
@@ -4189,23 +4192,25 @@ var PayByStableCoin = ({
4189
4192
  caller
4190
4193
  );
4191
4194
  if (response?.isSuccessful) {
4192
- setPaymentReferenceDetails(response.data);
4193
- const needsConfirm = response.data?.finalTransactionStatus == null || response.data?.paymentStatus == null;
4195
+ setPaymentReferenceDetails(
4196
+ caller === "buzapay" ? response.data : response
4197
+ );
4198
+ const needsConfirm = paymentReferenceDetails?.finalTransactionStatus == null || paymentReferenceDetails?.paymentStatus == null;
4194
4199
  if (needsConfirm) {
4195
4200
  setMessage("Transaction not confirmed !!");
4196
4201
  setPaymentReferenceStatus("pending");
4197
4202
  onPaymentAuthorized?.({
4198
4203
  paymentId: transactionReference,
4199
- paymentDate: response?.data?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
4204
+ paymentDate: paymentReferenceDetails?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
4200
4205
  paymentStatus: "pending",
4201
4206
  message
4202
4207
  });
4203
- } else if (response.data?.finalTransactionStatus === "Success" || response.data?.paymentStatus === "Payment Received") {
4208
+ } else if (paymentReferenceDetails?.finalTransactionStatus === "Success" || paymentReferenceDetails?.paymentStatus === "Payment Received") {
4204
4209
  setMessage("Transaction confirmed !!");
4205
4210
  setPaymentReferenceStatus("confirmed");
4206
4211
  onPaymentAuthorized?.({
4207
4212
  paymentId: transactionReference,
4208
- paymentDate: response?.data?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
4213
+ paymentDate: paymentReferenceDetails?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
4209
4214
  paymentStatus: "confirmed",
4210
4215
  message
4211
4216
  });
@@ -4215,7 +4220,7 @@ var PayByStableCoin = ({
4215
4220
  setMessage(response.responseMessage || "");
4216
4221
  onPaymentAuthorized?.({
4217
4222
  paymentId: transactionReference,
4218
- paymentDate: null,
4223
+ paymentDate: (/* @__PURE__ */ new Date()).toISOString(),
4219
4224
  paymentStatus: "used",
4220
4225
  message
4221
4226
  });