-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose function from useMollie composable to load the Mollie sc…
…ript async
- Loading branch information
1 parent
18c8f88
commit 5e1a367
Showing
7 changed files
with
130 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,3 @@ | ||
<script setup> | ||
import { ref } from 'vue' | ||
const CreditCardError = ref() | ||
const CreditCardToken = ref() | ||
const IdealError = ref() | ||
</script> | ||
<template> | ||
<h1>Nuxt mollie payments components</h1> | ||
|
||
<h2>Credit Card</h2> | ||
|
||
<ShopwareFrontendsCreditCard | ||
submit-button-label="Save" | ||
locale="en_US" | ||
:submit-disabled="!!CreditCardToken" | ||
@submit=" | ||
(token) => { | ||
CreditCardToken = `${token} ✔️` | ||
CreditCardError = null | ||
} | ||
" | ||
@error=" | ||
(message) => { | ||
CreditCardError = `${message} ❌` | ||
} | ||
" | ||
/> | ||
|
||
<div class="demo-mollie-results"> | ||
<div> | ||
Test Credit Number: | ||
<pre>2223 0000 1047 9399</pre> | ||
</div> | ||
<hr /> | ||
<div v-if="CreditCardError">Error: {{ CreditCardError }}</div> | ||
<div v-if="CreditCardToken">Token: {{ CreditCardToken }}</div> | ||
</div> | ||
|
||
<h2>Ideal</h2> | ||
|
||
<ShopwareFrontendsIdeal | ||
locale="en_US" | ||
select-label="Please choose your bank:" | ||
select-disabled-option="Select your bank" | ||
@save-issuer-success=" | ||
() => { | ||
IdealError = null | ||
} | ||
" | ||
@save-issuer-error=" | ||
(message) => { | ||
IdealError = `${message} ❌` | ||
} | ||
" | ||
/> | ||
<NuxtPage /> | ||
</template> | ||
<style scoped> | ||
.demo-mollie-results { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 0.9em; | ||
padding: 5px; | ||
} | ||
pre { | ||
font-size: 1.2em; | ||
} | ||
</style> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script setup> | ||
import { ref } from 'vue' | ||
const CreditCardError = ref() | ||
const CreditCardToken = ref() | ||
const IdealError = ref() | ||
</script> | ||
<template> | ||
<h1>Nuxt mollie payments components</h1> | ||
|
||
<h2>Credit Card</h2> | ||
|
||
<ShopwareFrontendsCreditCard | ||
submit-button-label="Save" | ||
locale="en_US" | ||
:submit-disabled="!!CreditCardToken" | ||
@submit=" | ||
(token) => { | ||
CreditCardToken = `${token} ✔️` | ||
CreditCardError = null | ||
} | ||
" | ||
@error=" | ||
(message) => { | ||
CreditCardError = `${message} ❌` | ||
} | ||
" | ||
/> | ||
|
||
<div class="demo-mollie-results"> | ||
<div> | ||
Test Credit Number: | ||
<pre>2223 0000 1047 9399</pre> | ||
</div> | ||
<hr /> | ||
<div v-if="CreditCardError">Error: {{ CreditCardError }}</div> | ||
<div v-if="CreditCardToken">Token: {{ CreditCardToken }}</div> | ||
</div> | ||
|
||
<h2>Ideal</h2> | ||
|
||
<ShopwareFrontendsIdeal | ||
locale="en_US" | ||
select-label="Please choose your bank:" | ||
select-disabled-option="Select your bank" | ||
@save-issuer-success=" | ||
() => { | ||
IdealError = null | ||
} | ||
" | ||
@save-issuer-error=" | ||
(message) => { | ||
IdealError = `${message} ❌` | ||
} | ||
" | ||
/> | ||
</template> | ||
<style scoped> | ||
.demo-mollie-results { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 0.9em; | ||
padding: 5px; | ||
} | ||
pre { | ||
font-size: 1.2em; | ||
} | ||
</style> |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
const show = ref(false) | ||
const CreditCardError = ref() | ||
const CreditCardToken = ref() | ||
</script> | ||
|
||
<template> | ||
<h1>Load Mollie script lazily</h1> | ||
<div>On this page the scripts load lazily, if the button is clicked.</div> | ||
<div>To test this, the option <i>isIncludedGlobally: false</i> has to be set in nuxt config.</div> | ||
|
||
<p> | ||
<button @click="show = !show">{{show ? 'Hide' : 'Show'}} payment components</button> | ||
<p v-if="show"> | ||
<LazyShopwareFrontendsCreditCard | ||
submit-button-label="Save" | ||
locale="en_US" | ||
:submit-disabled="!!CreditCardToken" | ||
@submit=" | ||
(token) => { | ||
CreditCardToken = `${token} ✔️` | ||
CreditCardError = null | ||
} | ||
" | ||
@error=" | ||
(message) => { | ||
CreditCardError = `${message} ❌` | ||
} | ||
" | ||
/> | ||
</p> | ||
</p> | ||
</template> | ||
|
||
<style scoped></style> |
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
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