Merge pull request #1704 from Safelite/feature/CSR-1921
CSR-1921 correct pay later after ccd payment failure
This commit is contained in:
commit
ab62270d53
3 changed files with 35 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ const applicationConfig = {
|
||||||
"//" +
|
"//" +
|
||||||
location.host +
|
location.host +
|
||||||
"/fmg/?fmgPage=payment-method&src=concept-funnel",
|
"/fmg/?fmgPage=payment-method&src=concept-funnel",
|
||||||
|
CONFIRMATION_URL: location.protocol + "//" + location.host + "/fmg/?fmgPage=confirmation",
|
||||||
GOOGLE_CALENDAR: "https://www.google.com/calendar/render?action=TEMPLATE",
|
GOOGLE_CALENDAR: "https://www.google.com/calendar/render?action=TEMPLATE",
|
||||||
YAHOO_CALENDAR: "https://calendar.yahoo.com/?v=60",
|
YAHOO_CALENDAR: "https://calendar.yahoo.com/?v=60",
|
||||||
OUTLOOK_CALENDAR:
|
OUTLOOK_CALENDAR:
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
v-if="shouldDisplayPiaCCAlert"
|
v-if="shouldDisplayPiaCCAlert"
|
||||||
cmsWidgetName="PIACCErrorAlertWidget"
|
cmsWidgetName="PIACCErrorAlertWidget"
|
||||||
alertClass="alert-danger"
|
alertClass="alert-danger"
|
||||||
|
@textLinkClicked="paymentFailedPayLater"
|
||||||
v-bind:isDismissible="false" />
|
v-bind:isDismissible="false" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -27,6 +28,7 @@
|
||||||
v-if="shouldDisplayPiaAPAlert"
|
v-if="shouldDisplayPiaAPAlert"
|
||||||
cmsWidgetName="PIAAPErrorAlertWidget"
|
cmsWidgetName="PIAAPErrorAlertWidget"
|
||||||
alertClass="alert-danger"
|
alertClass="alert-danger"
|
||||||
|
@textLinkClicked="paymentFailedPayLater"
|
||||||
v-bind:isDismissible="false" />
|
v-bind:isDismissible="false" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -216,6 +218,7 @@ import {
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
|
import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
import iframeResize from "../../../node_modules/iframe-resizer/js/iframeResizer.js";
|
||||||
import { routerParams } from "@/router/router-constants/router-params";
|
import { routerParams } from "@/router/router-constants/router-params";
|
||||||
|
|
@ -573,6 +576,36 @@ export default {
|
||||||
getDisplayAmountDue() {
|
getDisplayAmountDue() {
|
||||||
return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
|
||||||
},
|
},
|
||||||
|
async paymentFailedPayLater() {
|
||||||
|
this.$refs.loadingModal.isModalVisible = true;
|
||||||
|
|
||||||
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_PAYMENT_METHOD_CHOICE,
|
||||||
|
paymentMethods.LATER,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
await this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||||
|
try {
|
||||||
|
await submitWorkOrder({
|
||||||
|
pageNameToLog: "payment",
|
||||||
|
submitAfterSave: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER);
|
||||||
|
window.location = applicationConfig.CONFIRMATION_URL;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("error: response from submit work order(payment pg):" + error.message);
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.PIA_ERROR,
|
||||||
|
this.$route,
|
||||||
|
{},
|
||||||
|
{ [routerParams.DISPLAY_PIA_ALERT]: true }
|
||||||
|
);
|
||||||
|
this.$refs.loadingModal.isModalVisible = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
// The only way I could figure out how to get navigation to work on a page with the iframe.
|
// The only way I could figure out how to get navigation to work on a page with the iframe.
|
||||||
// This is also how a cancel from Paypal would work. Just a redirect to the payment-method page.
|
// This is also how a cancel from Paypal would work. Just a redirect to the payment-method page.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<textLink
|
<textLink
|
||||||
linkType="text"
|
linkType="text"
|
||||||
:text="getRouterLinkDisplayTextFromCopy(copy)"
|
:text="getRouterLinkDisplayTextFromCopy(copy)"
|
||||||
href="#!"
|
href="javascript:void(0)"
|
||||||
@click-event="
|
@click-event="
|
||||||
$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))
|
$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue