Skip to content

Commit

Permalink
Task #230243 fix confirm api call (#47)
Browse files Browse the repository at this point in the history
* Task #230243 fix code rabit issue

* Task #230243 fix height fix

* Task #230243 fix height, remove block not used change case

* Task #230243 fix try catch issue

* Task #230243 fix try catch issue

* Task #230243 fix try catch issue

* Task #230243 fix confirm api call
  • Loading branch information
namita-25 authored Nov 30, 2024
1 parent ad628cb commit a96d2e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/WebView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const WebViewFormSubmitWithRedirect: React.FC<

useEffect(() => {
const handleMessage = (event: MessageEvent) => {
window.postMessage({ type: "FORM_SUBMIT", data: formData }, "*");
if (event.origin !== import.meta.env.VITE_PROVIDER_URL) {
return;
}
Expand Down Expand Up @@ -131,16 +132,16 @@ const WebViewFormSubmitWithRedirect: React.FC<
const sendDataToIframe = async () => {
const prefillData = transformData(formData);

iframeRef.current.contentWindow.postMessage({ id, prefillData }, "*");
iframeRef.current.contentWindow.postMessage(prefillData, "*");
};

const submitConfirm = async (payload) => {
const confirmPayload = {
submission_id: payload?.submit.submission_id,
item_id: payload?.submit.application_id,
benefit_id: id,
context: context,
};

const result = await confirmApplication(confirmPayload);
setIsLoading(true);
const orderId = (
Expand Down
6 changes: 3 additions & 3 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"BENEFIT_DETAILS_PROCEED_TO_APPLY": "Proceed To Apply",
"SUBMIT_DIALOGUE_HEADING_TEXT": "Application Submitted",
"SUBMIT_DIALOGUE_SUBHEADING_TEXT": "Confirmation",
"SUBMIT_DIALOGUE_CONTENT_TEXT": "Your application to the",
"SUBMIT_DIALOGUE_CONTENT_TEXT": "Your application to the ",
"SUBMIT_DIALOGUE_SUBMITTED_TEXT": "Benefit has been submitted",
"SUBMIT_DIALOGUE_APPLICATION_ID_TEXT": " Application ID",
"SUBMIT_DIALOGUE_BUTTON": "Okay",
Expand All @@ -77,6 +77,6 @@
"USER_PROFILE_UPLOAD_MISSING_DOCUMENTS": "Upload Missing Documents",
"USER_PROFILE_ERROR_FETCHING_DATA": "Error fetching user data or documents",
"UPLOAD_DOCUMENT_EWALLET": "Upload Missing Document",
"DIALOGUE_T&C":"Terms and Conditions",
"DIALOGUE_CLICK_TO_READ_AND_PROCEED":"Click to read and proceed"
"DIALOGUE_T&C": "Terms and Conditions",
"DIALOGUE_CLICK_TO_READ_AND_PROCEED": "Click to read and proceed"
}
5 changes: 4 additions & 1 deletion src/services/benefit/benefits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export const applyApplication = async ({
interface ConfirmApplicationParams {
submission_id: string | undefined;
item_id: string | undefined;
benefit_id: string | undefined;

context: {
bpp_id?: string;
bap_uri?: string;
Expand All @@ -129,6 +131,7 @@ interface ConfirmApplicationParams {
export const confirmApplication = async ({
submission_id,
item_id,
benefit_id,
context,
}: ConfirmApplicationParams) => {
const data = {
Expand All @@ -152,7 +155,7 @@ export const confirmApplication = async ({
},
items: [
{
id: item_id,
id: benefit_id,
descriptor: {
name: "Pre-matric Scholarship-SCc",
long_desc:
Expand Down

0 comments on commit a96d2e2

Please sign in to comment.