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