Skip to content

Commit

Permalink
format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrudul Vajpayee authored and Mrudul Vajpayee committed Aug 22, 2024
1 parent b799169 commit c4e71c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/modules/api-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const PaymentCreateRequestSchema = z.object({
returnUrl: z.string().nullable().optional(),
manualRetryAllowed: z.boolean().nullable().optional(),
gatewayReferenceId: z.string().nullable().optional(),
allowedPaymentMethods: z.union([
z.record(z.any()).nullable(),
z.array(z.string()).nullable()
]).nullable().optional()
allowedPaymentMethods: z
.union([z.record(z.any()).nullable(), z.array(z.string()).nullable()])
.nullable()
.optional(),
});

// Type definition for PaymentCreateRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const TransactionInitializeSessionHyperswitchWebhookHandler = async (
description: normalizeValue(requestData?.description),
billing: buildAddressDetails(event.sourceObject.billingAddress, userEmail),
shipping: buildAddressDetails(event.sourceObject.shippingAddress, requestData?.shippingEmail),
allowed_payment_method_types : normalizeValue(requestData?.allowedPaymentMethods),
allowed_payment_method_types: normalizeValue(requestData?.allowedPaymentMethods),
metadata: {
transaction_id: event.transaction.id,
saleor_api_url: saleorApiUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const TransactionInitializeSessionJuspayWebhookHandler = async (
shipping_address_postal_code: normalizeValue(shippingAddress?.address?.zip),
"metadata.JUSPAY:gateway_reference_id": requestData?.gatewayReferenceId,
"metadata.txns.auto_capture": normalizeValue(captureMethod),
payment_filter: normalizeValue(requestData?.allowedPaymentMethods)
payment_filter: normalizeValue(requestData?.allowedPaymentMethods),
};
const createOrderResponse = await createJuspayPayment(createOrderPayload);

Expand Down

0 comments on commit c4e71c0

Please sign in to comment.