Skip to content

Commit

Permalink
Add store header to StartTransaction request (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclaudio authored Nov 7, 2023
1 parent cec4fbf commit ca518c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions resources/js/eventlisteners.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ document.addEventListener('turbo:load', () => {
}
window.app.checkout.doNotGoToTheNextStep = true

axios.post(config.magento_url + '/graphql', {
const query = {
query:
`mutation StartTransaction(
$order_id: String
Expand All @@ -22,7 +22,13 @@ document.addEventListener('turbo:load', () => {
order_id: data.order.id,
return_url: window.url('/paynl/finish')
}
}).then(response => {
}

const options = {
headers: { 'Store': window.config.store_code }
}

axios.post(config.magento_url + '/graphql', query, options).then(response => {
window.location.replace(response.data.data.paynlStartTransaction.redirectUrl)
})
});
Expand Down

0 comments on commit ca518c0

Please sign in to comment.