Attempts to resolve PayPal

This commit is contained in:
Chloe Herd 2025-12-12 14:12:20 -05:00
parent 3b1b000a13
commit 75417c4a34

View file

@ -79,6 +79,10 @@ export default {
methods: {
async backButtonAction() {
// Stub, for navigating back via nav-bar.
this.$router.navigateWithoutSaving(
this.navigationScenarios.CLICKED_BACK,
this.pageName
);
},
async forwardButtonAction() {
@ -130,14 +134,15 @@ export default {
value: this.adyenPriceTotal,
currency: "USD",
},
locale: "en-US",
locale: "en_US",
countryCode: "US",
showPayButton: true,
translations: {
"en-US": {
"en_US": {
"creditCard.securityCode.label": "CVV/CVC",
},
},
onPaymentCompleted: (result, component) => {
console.log(`Payment completed from Adyen.`);
this.handleCompletedPayment(result);
@ -160,23 +165,27 @@ export default {
window.checkout = checkOut;
// eslint-disable-next-line
const dropin = new AdyenWeb.Dropin(checkOut, {
// paymentMethodsConfiguration: {
// card: {
// showBrandIcon: true, // when false not showing the brand logo
// hasHolderName: true, // show holder name
// holderNameRequired: true, // make holder name mandatory
// billingAddressRequired: true,
// billingAddressAllowedCountries: ["US"],
// // configure placeholders
// placeholders: {
// cardNumber: "1234 5678 9012 3456",
// expiryDate: "MM/YY",
// securityCodeThreeDigits: "123",
// securityCodeFourDigits: "1234",
// holderName: "J. Smith",
// },
// },
// },
paymentMethodsConfiguration: {
ideal: {
showImage: true,
},
paypal: {
amount: {
value: this.adyenPriceTotal,
currency: "USD",
},
environment: "test", // Change this to "live" when you're ready to accept live PayPal payments
countryCode: "US", // Only needed for test. This will be automatically retrieved when you are in production.
blockPayPalVenmoButton: false,
//blockPayPalPayLaterButton: true
},
card: {
hasHolderName: true,
holderNameRequired: true,
billingAddressRequired: true,
name: "Credit or debit card",
},
},
}).mount("#adyen-container");
},
@ -235,7 +244,10 @@ export default {
await this.saveAndSubmitWorkOrder();
},
handleFailedPayment(result) {},
async handleFailedPayment(result) {
console.log(`Result =`);
console.log(result);
},
handleError(error) {},
async saveAndSubmitWorkOrder() {
@ -273,12 +285,12 @@ export default {
street: this.splitStreetAddress.street,
zipCode: this.locationInfo.zipCode,
stateOrProvince: this.locationInfo.state,
returnUrl: "localhost:8080/fmg/confirmation",
returnUrl: "http://localhost:8080/fmg/confirmation",
email: this.$store.getters.order.customer.emailAddress,
IP: "127.0.0.1", // TODO
firstName: this.$store.getters.order.customer.firstName,
lastName: this.$store.getters.order.customer.lastName,
idempotencyKey: `${this.$store.getters.order.referralCorrelationId}-${this.sourceSystem}`,
idempotencyKey: crypto.randomUUID(), // `${this.$store.getters.order.referralCorrelationId}-${this.sourceSystem}`,
};
},