Format code.

This commit is contained in:
Bryan Mauger 2023-11-01 10:03:23 -04:00
parent 595e97ea9f
commit 2006fbbe9b

View file

@ -12,179 +12,179 @@
<div class="col-md-6 col-xl-4 p-0"> <div class="col-md-6 col-xl-4 p-0">
<div id="card-container"> <div id="card-container">
<iframe <iframe
v-resize v-resize
ref="paymentFrame" ref="paymentFrame"
class="hop-iframe payment-iframe" class="hop-iframe payment-iframe"
name="card-frame" name="card-frame"
id="card-frame" id="card-frame"
seamless seamless
scrolling="no"> scrolling="no">
</iframe> </iframe>
</div>
<div>{{ switchPaymentText }}</div>
<div>
<button
v-if="paymentType !== 'cc'"
ref="switchToCCButton"
type="button"
@mousedown="switchPIAMethod('cc')"
aria-label="Switch to Credit Card">
Switch to Credit Card
</button>
</div>
<div v-if="paymentType !== 'cc'">or</div>
<div>
<button
v-if="paymentType !== 'pp'"
ref="switchToPPButton"
type="button"
@mousedown="switchPIAMethod('pp')"
aria-label="Switch to PayPal">
Switch to PayPal
</button>
</div>
<div v-if="paymentType === 'cc'">or</div>
<div>
<button
v-if="paymentType !== 'ap'"
ref="switchToAPButton"
type="button"
@mousedown="switchPIAMethod('ap')"
aria-label="Switch to Afterpay">
Switch to Afterpay
</button>
</div>
<navbar
cmsWidgetName="FunnelFooterWidget"
isForwardActionDisabled="true"
:isBackButtonHidden="shouldHideBackButton"
isSubmitHidden="true"
@back-clicked="backButtonAction" />
</div> </div>
<div>{{ switchPaymentText }}</div>
<div>
<button
v-if="paymentType !== 'cc'"
ref="switchToCCButton"
type="button"
@mousedown="switchPIAMethod('cc')"
aria-label="Switch to Credit Card">
Switch to Credit Card
</button>
</div> </div>
<div v-if="paymentType !== 'cc'">or</div>
<div>
<button
v-if="paymentType !== 'pp'"
ref="switchToPPButton"
type="button"
@mousedown="switchPIAMethod('pp')"
aria-label="Switch to PayPal">
Switch to PayPal
</button>
</div> </div>
<div v-if="paymentType === 'cc'">or</div> </Form>
<div>
<button
v-if="paymentType !== 'ap'"
ref="switchToAPButton"
type="button"
@mousedown="switchPIAMethod('ap')"
aria-label="Switch to Afterpay">
Switch to Afterpay
</button>
</div>
<navbar
cmsWidgetName="FunnelFooterWidget"
isForwardActionDisabled="true"
:isBackButtonHidden="shouldHideBackButton"
isSubmitHidden="true"
@back-clicked="backButtonAction" />
</div>
</div>
</div>
</Form>
<form <form
ref="hopForm" ref="hopForm"
id="card-data" id="card-data"
:target="paypalPayment ? '_top' : 'card-frame'" :target="paypalPayment ? '_top' : 'card-frame'"
method="POST" method="POST"
:action="checkoutUrl"> :action="checkoutUrl">
<input type="hidden" name="paymentType" :value="paymentType" /> <input type="hidden" name="paymentType" :value="paymentType" />
<input type="hidden" name="sgSessionId" :value="authToken" /> <input type="hidden" name="sgSessionId" :value="authToken" />
<input type="hidden" name="sgAuthToken" :value="authToken" /> <input type="hidden" name="sgAuthToken" :value="authToken" />
<input type="hidden" name="sgSignaturePublic" :value="authSignature" /> <input type="hidden" name="sgSignaturePublic" :value="authSignature" />
<input type="hidden" name="sgSignatureStartDate" :value="authSignatureStart" /> <input type="hidden" name="sgSignatureStartDate" :value="authSignatureStart" />
<input type="hidden" name="referralSeqNum" :value="referralSequenceNumber" /> <input type="hidden" name="referralSeqNum" :value="referralSequenceNumber" />
<input type="hidden" name="sge_commerce_indicator_isinternet" value="true" /> <input type="hidden" name="sge_commerce_indicator_isinternet" value="true" />
<input type="hidden" name="sghopsource" value="Safelite.com" /> <input type="hidden" name="sghopsource" value="Safelite.com" />
<input type="hidden" name="sgHtmlStyle" value="ResourceSafeliteHtml" /> <input type="hidden" name="sgHtmlStyle" value="ResourceSafeliteHtml" />
<input type="hidden" name="sgErrorMessagesEmbedded" value="true" /> <input type="hidden" name="sgErrorMessagesEmbedded" value="true" />
<input type="hidden" name="sgNoKeystrokeProcessing" value="false" /> <input type="hidden" name="sgNoKeystrokeProcessing" value="false" />
<input type="hidden" name="maskCharacter" value="*" /> <input type="hidden" name="maskCharacter" value="*" />
<input type="hidden" name="styleSheetCode" :value="dynamicCSSUrl" /> <input type="hidden" name="styleSheetCode" :value="dynamicCSSUrl" />
<input type="hidden" name="styleSheetCode2" :value="dynamicHopCSSUrl" /> <input type="hidden" name="styleSheetCode2" :value="dynamicHopCSSUrl" />
<input type="hidden" name="sgReceiptResponseURL" :value="piaResponseUrl" /> <input type="hidden" name="sgReceiptResponseURL" :value="piaResponseUrl" />
<input type="hidden" name="sgDeclineResponseURL" :value="piaResponseUrl" /> <input type="hidden" name="sgDeclineResponseURL" :value="piaResponseUrl" />
<input type="hidden" name="sgErrorResponseURL" :value="piaResponseUrl" /> <input type="hidden" name="sgErrorResponseURL" :value="piaResponseUrl" />
<input type="hidden" name="sgheaderline1" :value="getHeaderLine1" /> <input type="hidden" name="sgheaderline1" :value="getHeaderLine1" />
<input type="hidden" name="sgHeader1subtitle" value="" /> <input type="hidden" name="sgHeader1subtitle" value="" />
<input type="hidden" name="sgheaderline2" :value="getHeaderLine2" /> <input type="hidden" name="sgheaderline2" :value="getHeaderLine2" />
<input type="hidden" name="sgheaderline3" value="" /> <input type="hidden" name="sgheaderline3" value="" />
<input type="hidden" name="sgheaderline4" value="" /> <input type="hidden" name="sgheaderline4" value="" />
<input type="hidden" name="sgheaderline5" value="*Required information" /> <input type="hidden" name="sgheaderline5" value="*Required information" />
<input type="hidden" name="billTo_firstName" :value="firstName" /> <input type="hidden" name="billTo_firstName" :value="firstName" />
<input type="hidden" name="billTo_firstNameShow" value="true" /> <input type="hidden" name="billTo_firstNameShow" value="true" />
<input type="hidden" name="sghopmiddleInitialShow" value="false" /> <input type="hidden" name="sghopmiddleInitialShow" value="false" />
<input type="hidden" name="billTo_lastName" :value="lastName" /> <input type="hidden" name="billTo_lastName" :value="lastName" />
<input type="hidden" name="billTo_lastNameShow" value="true" /> <input type="hidden" name="billTo_lastNameShow" value="true" />
<input type="hidden" name="billTo_street1" value="" /> <input type="hidden" name="billTo_street1" value="" />
<input type="hidden" name="billTo_street2" value="" /> <input type="hidden" name="billTo_street2" value="" />
<input type="hidden" name="billTo_city" value="" /> <input type="hidden" name="billTo_city" value="" />
<input type="hidden" name="billTo_state" value="" /> <input type="hidden" name="billTo_state" value="" />
<input type="hidden" name="billTo_postalCode" value="" /> <input type="hidden" name="billTo_postalCode" value="" />
<input type="hidden" name="billTo_postalCodeShow" value="true" /> <input type="hidden" name="billTo_postalCodeShow" value="true" />
<input type="hidden" name="billTo_postalCodeEnable" value="true" /> <input type="hidden" name="billTo_postalCodeEnable" value="true" />
<input type="hidden" name="sgLabelPostalCode" value="Billing ZIP" /> <input type="hidden" name="sgLabelPostalCode" value="Billing ZIP" />
<input type="hidden" name="sgtotalamount" :value="displayAmount" /> <input type="hidden" name="sgtotalamount" :value="displayAmount" />
<input type="hidden" name="totalAmountDecimal" :value="totalAmount" /> <input type="hidden" name="totalAmountDecimal" :value="totalAmount" />
<input type="hidden" name="lineItems" :value="piaLineItems" /> <input type="hidden" name="lineItems" :value="piaLineItems" />
<input type="hidden" name="sgdiscountstrikethruamount" value="" /> <input type="hidden" name="sgdiscountstrikethruamount" value="" />
<input type="hidden" name="callerDisplayText" value="" /> <input type="hidden" name="callerDisplayText" value="" />
<input <input
type="hidden" type="hidden"
name="sgtermsofusedisplaytext" name="sgtermsofusedisplaytext"
value="By selecting submit, I agree to Safelite's" /> value="By selecting submit, I agree to Safelite's" />
<input type="hidden" name="sgtermsofuseurl" value="http://www.safelite.com/terms-of-use/" /> <input type="hidden" name="sgtermsofuseurl" value="http://www.safelite.com/terms-of-use/" />
<input type="hidden" name="sgtermsofuselinkdisplaytext" value="terms of use" /> <input type="hidden" name="sgtermsofuselinkdisplaytext" value="terms of use" />
<input type="hidden" name="sgtermsofcancelrefunddisplaytext" value="and" /> <input type="hidden" name="sgtermsofcancelrefunddisplaytext" value="and" />
<input <input
type="hidden" type="hidden"
name="sgtermsofcancelrefundlinkdisplaytext" name="sgtermsofcancelrefundlinkdisplaytext"
value="cancellation and refund policy" /> value="cancellation and refund policy" />
<input <input
type="hidden" type="hidden"
name="sgtermsofcancelrefundurl" name="sgtermsofcancelrefundurl"
value="http://www.safelite.com/cancellation-refund-policy" /> value="http://www.safelite.com/cancellation-refund-policy" />
<input <input
type="hidden" type="hidden"
name="sgErrorMessageCardVerification" name="sgErrorMessageCardVerification"
value="Credit card could not be processed" /> value="Credit card could not be processed" />
<input <input
type="hidden" type="hidden"
name="sgErrorMessageTimeOut" name="sgErrorMessageTimeOut"
value="For your security, this transaction has been timed out." /> value="For your security, this transaction has been timed out." />
<input type="hidden" name="sgLabelCardNumber" value="" /> <input type="hidden" name="sgLabelCardNumber" value="" />
<input type="hidden" name="sgLabelAddressLine1" :value="address1" /> <input type="hidden" name="sgLabelAddressLine1" :value="address1" />
<input type="hidden" name="sgLabelAddressLine2" :value="address2" /> <input type="hidden" name="sgLabelAddressLine2" :value="address2" />
<input type="hidden" name="sgLabelCity" :value="city" /> <input type="hidden" name="sgLabelCity" :value="city" />
<input type="hidden" name="sgLabelState" :value="state" /> <input type="hidden" name="sgLabelState" :value="state" />
<input type="hidden" name="sgCtu" :value="ctu" /> <input type="hidden" name="sgCtu" :value="ctu" />
<input type="hidden" name="sgWorkOrder" :value="workOrderNumber" /> <input type="hidden" name="sgWorkOrder" :value="workOrderNumber" />
<input type="hidden" name="sgEmailAddress" :value="emailAddress" /> <input type="hidden" name="sgEmailAddress" :value="emailAddress" />
<input type="hidden" name="paypalInvoiceNumber" :value="invoiceNumber" /> <input type="hidden" name="paypalInvoiceNumber" :value="invoiceNumber" />
<input type="hidden" name="paypalSuccessUrl" :value="piaResponseUrl" /> <input type="hidden" name="paypalSuccessUrl" :value="piaResponseUrl" />
<input type="hidden" name="paypalCancelUrl" :value="piaCancelUrl" /> <input type="hidden" name="paypalCancelUrl" :value="piaCancelUrl" />
<input type="hidden" name="sgCCDeclineURL" :value="piaCancelUrl" /> <input type="hidden" name="sgCCDeclineURL" :value="piaCancelUrl" />
<input type="hidden" name="sgCCTimeoutURL" :value="piaCancelUrl" /> <input type="hidden" name="sgCCTimeoutURL" :value="piaCancelUrl" />
<input type="hidden" name="sgTransactionType" value="authorization" /> <input type="hidden" name="sgTransactionType" value="authorization" />
<input type="hidden" name="amount" :value="totalAmount" /> <input type="hidden" name="amount" :value="totalAmount" />
<input type="hidden" name="ctu" :value="ctu" /> <input type="hidden" name="ctu" :value="ctu" />
<input type="hidden" name="orderNumber" :value="workOrderNumber" /> <input type="hidden" name="orderNumber" :value="workOrderNumber" />
<input type="hidden" name="billTo_email" :value="emailAddress" /> <input type="hidden" name="billTo_email" :value="emailAddress" />
<input type="hidden" name="useDecisionManager" value="True" /> <input type="hidden" name="useDecisionManager" value="True" />
<input type="hidden" name="correlationId" :value="referralCorrelationId" /> <input type="hidden" name="correlationId" :value="referralCorrelationId" />
<input type="hidden" name="sgErrorMessageCard_CVN" value="Please enter a valid CVV" /> <input type="hidden" name="sgErrorMessageCard_CVN" value="Please enter a valid CVV" />
<input type="hidden" name="ship_to_address_line1" :value="address1" /> <input type="hidden" name="ship_to_address_line1" :value="address1" />
<input type="hidden" name="ship_to_address_line2" :value="address2" /> <input type="hidden" name="ship_to_address_line2" :value="address2" />
<input type="hidden" name="ship_to_address_city" :value="city" /> <input type="hidden" name="ship_to_address_city" :value="city" />
<input type="hidden" name="ship_to_address_state" :value="state" /> <input type="hidden" name="ship_to_address_state" :value="state" />
<input type="hidden" name="ship_to_address_country" value="US" /> <input type="hidden" name="ship_to_address_country" value="US" />
<input type="hidden" name="ship_to_address_postal_code" :value="zipCode" /> <input type="hidden" name="ship_to_address_postal_code" :value="zipCode" />
<input type="hidden" name="ship_to_phone" :value="phoneNumber" /> <input type="hidden" name="ship_to_phone" :value="phoneNumber" />
<input type="hidden" name="calling_application" value="NextGen" /> <input type="hidden" name="calling_application" value="NextGen" />
</form> </form>
</template> </template>
<script> <script>
@ -237,16 +237,16 @@ export default {
}; };
}, },
directives: { directives: {
resize:{ resize: {
mounted: function(el) { mounted: function (el) {
el.addEventListener('load', () => { el.addEventListener("load", () => {
iframeResize({ checkOrigin: false }, el); iframeResize({ checkOrigin: false }, el);
}); });
}, },
unmounted: function (el) { unmounted: function (el) {
el.iFrameResizer.removeListeners(); el.iFrameResizer.removeListeners();
} },
} },
}, },
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
// Call APIs // Call APIs
@ -329,7 +329,7 @@ export default {
const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE; const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
const serviceLocationReqs = const serviceLocationReqs =
(isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs); (isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs);
// Insurance // Insurance
const isInsuranceSet = store.getters.order.payment.isInsurance !== null; const isInsuranceSet = store.getters.order.payment.isInsurance !== null;
@ -354,8 +354,8 @@ export default {
); );
const paymentMethodReqs = const paymentMethodReqs =
store.getters.order.payment.isPia !== null && store.getters.order.payment.isPia !== null &&
(store.getters.order.payment.isPia || !!store.getters.order.payment.piaType); (store.getters.order.payment.isPia || !!store.getters.order.payment.piaType);
return ( return (
packageReqs && packageReqs &&
@ -383,39 +383,39 @@ export default {
}, },
getAddress1() { getAddress1() {
return store.getters.order.serviceLocation.address return store.getters.order.serviceLocation.address
? store.getters.order.serviceLocation.address ? store.getters.order.serviceLocation.address
: store.getters.order.serviceLocation.provider.address.streetAddress; : store.getters.order.serviceLocation.provider.address.streetAddress;
}, },
getAddress2() { getAddress2() {
return store.getters.order.serviceLocation.address2 return store.getters.order.serviceLocation.address2
? store.getters.order.serviceLocation.address2 ? store.getters.order.serviceLocation.address2
: null; : null;
}, },
getCity() { getCity() {
return store.getters.order.serviceLocation.city return store.getters.order.serviceLocation.city
? store.getters.order.serviceLocation.city ? store.getters.order.serviceLocation.city
: store.getters.order.serviceLocation.provider.address.city; : store.getters.order.serviceLocation.provider.address.city;
}, },
getState() { getState() {
return store.getters.order.serviceLocation.state return store.getters.order.serviceLocation.state
? store.getters.order.serviceLocation.state ? store.getters.order.serviceLocation.state
: store.getters.order.serviceLocation.provider.address.state; : store.getters.order.serviceLocation.provider.address.state;
}, },
getZipCode() { getZipCode() {
return store.getters.order.serviceLocation.zipCode return store.getters.order.serviceLocation.zipCode
? store.getters.order.serviceLocation.zipCode ? store.getters.order.serviceLocation.zipCode
: store.getters.order.serviceLocation.provider.address.zipCode; : store.getters.order.serviceLocation.provider.address.zipCode;
}, },
getPaymentType() { getPaymentType() {
switch (store.getters.order.payment.piaType) { switch (store.getters.order.payment.piaType) {
case paymentMethods.AFTERPAY: case paymentMethods.AFTERPAY:
return "ap"; return "ap";
case paymentMethods.CREDIT_CARD: case paymentMethods.CREDIT_CARD:
return "cc"; return "cc";
case paymentMethods.PAYPAL: case paymentMethods.PAYPAL:
return "pp"; return "pp";
default: default:
return store.getters.payment.piaType; return store.getters.payment.piaType;
} }
}, },
getPiaLineItems() { getPiaLineItems() {