-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87c451a
commit e45d82e
Showing
11 changed files
with
25 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +0,0 @@ | ||
<script> | ||
import { mask as useMask } from 'Vendor/rapidez/core/resources/js/stores/useMask' | ||
import { token as useToken } from 'Vendor/rapidez/core/resources/js/stores/useUser' | ||
export default { | ||
props: { | ||
token: { | ||
type: String, | ||
default: useToken.value, | ||
}, | ||
mask: { | ||
type: String, | ||
default: useMask.value, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
completed: false, | ||
order: {}, | ||
} | ||
}, | ||
mounted() { | ||
this.order.customer_email = window.localStorage.email; | ||
this.checkStatus(); | ||
}, | ||
render() { | ||
return this.$scopedSlots.default({ | ||
completed: this.completed, | ||
order: this.order | ||
}) | ||
}, | ||
methods: { | ||
async checkStatus() { | ||
this.params = Object.fromEntries(new URLSearchParams(window.location.search).entries()); | ||
let token = this.params.secureToken ?? null; | ||
let orderId = this.params.orderId ?? null; | ||
if(!token || !orderId) { | ||
return; | ||
} | ||
window.magentoAPI('get', `multisafepay/orders/${orderId}/${token}`).then(response => { | ||
if(['processing', 'success', 'complete'].includes(response?.status)) { | ||
useToken.value = this.token; | ||
useMask.value = this.mask; | ||
this.completed = true; | ||
this.order = Object.assign({ | ||
sales_order_items: response.items, | ||
sales_order_payments: [response.payment], | ||
}, response) | ||
} else { | ||
window.setTimeout(this.checkStatus, 2000); | ||
} | ||
}) | ||
} | ||
}, | ||
} | ||
</script> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
document.addEventListener('vue:loaded', () => { | ||
window.app.$on('checkout-payment-saved', (data) => { | ||
if (!data.order.payment_method_code.includes('multisafepay_')) { | ||
return; | ||
} | ||
window.app.checkout.doNotGoToTheNextStep = true | ||
let cart = window.app.user?.id ? 'mine' : localStorage.mask; | ||
window.magentoAPI('get', `multisafepay/${cart}/payment-url/${data.order.id}`).then(response => { | ||
window.location.replace(response); | ||
}); | ||
}); | ||
}) | ||
import { addAfterPlaceOrderHandler } from 'Vendor/rapidez/core/resources/js/stores/usePaymentHandlers' | ||
|
||
addAfterPlaceOrderHandler(async function (response, mutationComponent) { | ||
mutationComponent.redirect = response?.data?.placeOrder?.orderV2?.multisafepay_payment_url || mutationComponent.redirect; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
import './components' | ||
import './eventlisteners' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters