Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Version 5 #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 50 commits into
base: main
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dd97c00
chore: create vite version
jofftiquez Nov 3, 2023
e5173b0
refactor: create new branch
jofftiquez Jan 18, 2024
3b38aa5
docs: add vitepress
jofftiquez Jan 19, 2024
ba04205
chore: run ci
jofftiquez Jan 19, 2024
a1dcc22
chore: remove vitepress
jofftiquez Jan 19, 2024
490013b
✨ feat(index.js): add LinkAuthentication component to export list
jofftiquez Jan 19, 2024
caf74ba
✨ feat(LinkAuthentication.vue): add LinkAuthentication component for …
jofftiquez Jan 19, 2024
27b63a6
🔧 fix(PaymentIntent.vue): rename stripeElementMountPoint ref to mount…
jofftiquez Jan 19, 2024
240d990
✨ feat(use-element.js): add useElement composable to handle element c…
jofftiquez Jan 19, 2024
4625dee
✨ feat(use-elements.js): add useElements composable to handle Stripe …
jofftiquez Jan 20, 2024
9ec0e68
🔧 chore(use-stripe.js): rename initStripe function to initializeStrip…
jofftiquez Jan 20, 2024
9b91898
🎉 feat(banner.png): add new banner image for the application
jofftiquez Jan 23, 2024
34d98cb
🎨 style(README.md): update README.md with new banner and headings
jofftiquez Jan 23, 2024
0ca888c
chore: move docs inside vue-stripe
jofftiquez Jan 24, 2024
73b01f3
🔀 refactor(use-elements.js): change parameter order in initializeElem…
jofftiquez Jan 24, 2024
cb277d7
🔧 chore(config.mjs): enable cleanUrls with subfolders for better URL …
jofftiquez Jan 24, 2024
97c6ce8
chore: re-run ci
jofftiquez Jan 24, 2024
4d8c549
chore: re-run ci
jofftiquez Jan 24, 2024
ee589c1
chore: re-run ci
jofftiquez Jan 24, 2024
d8ef63f
chore: update dependencies in package.json
jofftiquez Sep 7, 2024
258f079
refactor: Update useStripe function to use Vue 3 composition API
jofftiquez Sep 7, 2024
33d3564
docs: Update getting-started.md with examples and explanations for Vu…
jofftiquez Sep 7, 2024
752130d
refactor: Update PaymentIntentDemo component import to PaymentElement…
jofftiquez Sep 7, 2024
dc8ba33
refactor: Update navigation links in config.mjs
jofftiquez Sep 7, 2024
7e16932
refactor: Update navigation links in config.mjs
jofftiquez Sep 7, 2024
129ff9d
refactor: Remove unused dependencies in docs cache
jofftiquez Sep 7, 2024
42b0ee3
refactor: Update dependencies in docs cache
jofftiquez Sep 7, 2024
a795b47
refactor: Update dependencies in docs cache, navigation links, and Pa…
jofftiquez Sep 7, 2024
7e9fe19
refactor: Update component imports in index.js
jofftiquez Sep 7, 2024
3ab79fe
refactor: Update setup function in Elements.vue
jofftiquez Sep 7, 2024
43d8f63
refactor: Remove LinkAuthentication component
jofftiquez Sep 7, 2024
edef22f
refactor: Remove LinkAuthentication component
jofftiquez Sep 7, 2024
e196f52
```text
jofftiquez Sep 7, 2024
35662b4
refactor: Remove PaymentIntent component
jofftiquez Sep 7, 2024
fd025bb
refactor: Remove unused code in VueStripe component
jofftiquez Sep 7, 2024
aa9d69c
refactor: Remove unused code and unused file
jofftiquez Sep 7, 2024
3838957
refactor: Remove unused code and files, and add ExpressCheckoutElemen…
jofftiquez Sep 7, 2024
9884eec
refactor: Add AddressElement component and demos
jofftiquez Sep 7, 2024
a20a5af
refactor: Add IssuingElement component and demos
jofftiquez Sep 7, 2024
668702f
refactor: Update link text in Vue 2 Support section
jofftiquez Sep 7, 2024
c4cc796
refactor: Update link text in Vue 2 Support section and add Stripe pa…
jofftiquez Sep 7, 2024
c9f0b3f
feat: Add CODE_OF_CONDUCT.md file with Contributor Covenant Code of C…
jofftiquez Sep 7, 2024
ea74736
feat: Add CONTRIBUTING.md file with guidelines for contributing to th…
jofftiquez Sep 7, 2024
72bb5ca
feat: Add MIT License file
jofftiquez Sep 7, 2024
575f402
refactor: Update .firebaserc and firebase.json files
jofftiquez Sep 7, 2024
7c7faeb
Merge branch 'main' of github.com:vue-stripe/vue-stripe into refactor…
jofftiquez Sep 7, 2024
5ef1047
refactor: Remove unnecessary code from .firebaserc file
jofftiquez Sep 7, 2024
8b4185f
refactor: Update .firebaserc and firebase.json files
jofftiquez Sep 7, 2024
49bb6fc
refactor: Update usage and components in getting-started.md
jofftiquez Sep 7, 2024
f88f5c0
feat: Add AuBankAccountElement and IbanElement components
jofftiquez Oct 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Add IssuingElement component and demos
  • Loading branch information
jofftiquez committed Sep 7, 2024
commit a20a5aff41715f4c656aef2916ed1f6a1abfeba3
1 change: 1 addition & 0 deletions 1 docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default defineConfig(({ command, mode }) => {
{ text: 'Express Checkout Element', link: '/components/express-checkout-element' },
{ text: 'Link Authentication Element', link: '/components/link-authentication-element' },
{ text: 'Address Element', link: '/components/address-element' },
{ text: 'Issuing Elements', link: '/components/issuing-element' },
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 6 docs/components/address-element.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import AddressElementDemo from '../demo/AddressElementDemo.vue'
import AddressElementDemo from '../demo/AddressElementDemo.vue';
</script>

# The Address Element Component
Expand Down Expand Up @@ -37,8 +37,8 @@ const options = {
const addressElementRef = ref(null);

function getAddressValue () {
const addressElement = addressElementRef.value.getValue();
console.log(addressElement); // The address value
const addressValue = addressElementRef.value.getValue();
console.log(addressValue); // The address value
};
</script>

Expand Down
65 changes: 65 additions & 0 deletions 65 docs/components/issuing-element.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# The Issuing Element Component

Issuing Elements allows you to display the sensitive data of your Issuing cards in a PCI-compliant manner.

## Demo

Demo coming soon.

The issuing element uses a the Issuing API which can be seen [here](https://docs.stripe.com/js/issuing_elements/create?link_authentication_element_create-options=&type=issuingCardNumberDisplay). Take note that each type of Issuing Element has its own options.

## Usage

```vue
<script setup>
import { ref } from 'vue';
import { IssuingElement, useStripe } from '@vue-stripe/vue-stripe';

const pk = ref(import.meta.env.VITE_VUE_STRIPE_PUBLISHABLE_KEY);
const clientSecret = ref(import.meta.env.VITE_STRIPE_CLIENT_SECRET);

const { stripe, elements, initializeElements } = useStripe(pk.value);

initializeElements(clientSecret.value);

const options = {};

// Can be one of:
// issuingCardNumberDisplay
// issuingCardCvcDisplay
// issuingCardExpiryDisplay
// issuingCardPinDisplay
// issuingCardCopyButton
const elementType = 'issuingCardNumberDisplay';
</script>

<template>
<IssuingElement
:elements="elements"
:element-type="elementType"
:options="options"
/>
</template>
```

To get the value of the address you may use the `getValue` method of the Address Element component via a ref.

## Props

| Prop | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| `element-type` | `String` | `null` | `true` | The type of Issuing Element to create. Can be one of: `issuingCardNumberDisplay`, `issuingCardCvcDisplay`, `issuingCardExpiryDisplay`, `issuingCardPinDisplay`, `issuingCardCopyButton` |
| `elements` | `Elements` | `null` | `true` | The Elements instance |
| `options` | `Object` | `{}` | `false` | Options for creating the Issuing Element. Read more [here](https://docs.stripe.com/js/issuing_elements/create?link_authentication_element_create-options=&type=issuingCardNumberDisplay#issuing_elements_create-options). |

## Events

> No events are emitted by the Address Element component.

## Methods

> No methods are available for the Issuing Element component.

## Slots

> No slots are available for the Issuing Element component.
13 changes: 13 additions & 0 deletions 13 docs/demo/AddressElementDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,26 @@ initializeElements(clientSecret.value);
const options = {
mode: props.mode,
};

const addressElementRef = ref(null);
const address = ref(null);
async function onGetValue () {
address.value = await addressElementRef.value.getValue();
}
</script>

<template>
<div style="padding: 20px 0px 0px 0px;" class="flex flex-col w-full gap-8">
<AddressElement
ref="addressElementRef"
:elements="elements"
:options="options"
/>
<br>
<button class="btn" @click="onGetValue">Get Address</button>
<div v-if="address">
<pre>{{ address }}</pre>
<button class="btn" @click="address = null">Clear</button>
</div>
</div>
</template>
6 changes: 2 additions & 4 deletions 6 src/components/AddressElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

<script setup>
import { ADDRESS_ELEMENT_TYPE as ELEMENT_TYPE } from '../constants';
import { install, ref, toRef, watch, defineEmits, defineProps, defineExpose } from 'vue-demi';
import { install, ref, toRef, watch, defineProps, defineExpose } from 'vue-demi';

install();

const emit = defineEmits(['change', 'ready', 'focus', 'blur', 'escape']);

defineExpose({
getElement,
updateElement,
Expand Down Expand Up @@ -54,6 +52,6 @@ async function updateElement (options) {
};

async function getValue () {
return elements.value.getValue();
return element.value.getValue();
};
</script>
8 changes: 7 additions & 1 deletion 8 src/components/ExpressCheckoutElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import { install, ref, toRef, watch, defineEmits, defineProps, defineExpose } fr

install();

const emit = defineEmits(['change', 'ready', 'focus', 'blur', 'escape']);
const emit = defineEmits([
'click',
'confirm',
'cancel',
'shippingaddresschange',
'shippingratechange',
]);

defineExpose({
getElement,
Expand Down
41 changes: 41 additions & 0 deletions 41 src/components/IssuingElement.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<div ref="mountPoint"/>
</template>

<script setup>
import { install, ref, toRef, watch, defineProps } from 'vue-demi';

install();

const props = defineProps({
elements: {
type: Object,
},
options: {
type: Object,
default: () => ({}),
},
elementType: {
type: String,
required: true,
},
});

const elements = toRef(props, 'elements');
const options = toRef(props, 'options');
const elementType = toRef(props, 'elementType');

const mountPoint = ref(null);
const element = ref(null);

watch(props, () => {
init();
});

function init () {
if (!elements.value) return;

element.value = elements.value.create(elementType.value, options.value);
element.value.mount(mountPoint.value);
};
</script>
4 changes: 1 addition & 3 deletions 4 src/components/LinkAuthenticationElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

<script setup>
import { LINK_AUTHENTICATION_ELEMENT_TYPE as ELEMENT_TYPE } from '../constants';
import { install, ref, toRef, watch, defineEmits, defineProps, defineExpose } from 'vue-demi';
import { install, ref, toRef, watch, defineProps, defineExpose } from 'vue-demi';

install();

const emit = defineEmits(['change', 'ready', 'focus', 'blur', 'escape']);

defineExpose({
getElement,
});
Expand Down
8 changes: 7 additions & 1 deletion 8 src/components/PaymentElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import { install, ref, toRef, watch, defineEmits, defineProps, defineExpose } fr

install();

const emit = defineEmits(['change', 'ready', 'focus', 'blur', 'escape']);
const emit = defineEmits([
'change',
'ready',
'focus',
'blur',
'escape',
]);

defineExpose({
getElement,
Expand Down
6 changes: 6 additions & 0 deletions 6 src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@ export const PAYMENT_ELEMENT_TYPE = 'payment';
export const LINK_AUTHENTICATION_ELEMENT_TYPE = 'linkAuthentication';
export const EXPRESS_CHECKOUT_ELEMENT_TYPE = 'expressCheckout';
export const ADDRESS_ELEMENT_TYPE = 'address';

export const ISSUING_CARD_NUMBER_DISPLAY_ELEMENT_TYPE = 'issuingCardNumberDisplay';
export const ISSUING_CARD_CVC_DISPLAY_ELEMENT_TYPE = 'issuingCardCvcDisplay';
export const ISSUING_CARD_EXPIRY_DISPLAY_ELEMENT_TYPE = 'issuingCardExpiryDisplay';
export const ISSUING_CARD_PIN_DISPLAY_ELEMENT_TYPE = 'issuingCardPinDisplay';
export const ISSUING_CARD_COPY_BUTTON_ELEMENT_TYPE = 'issuingCardCopyButton';
2 changes: 2 additions & 0 deletions 2 src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import AddressElement from './components/AddressElement.vue';
import ExpressCheckoutElement from './components/ExpressCheckoutElement.vue';
import IssuingElement from './components/IssuingElement.vue';
import LinkAuthenticationElement from './components/LinkAuthenticationElement.vue';
import PaymentElement from './components/PaymentElement.vue';
import { useStripe } from './composables/use-stripe';

export {
AddressElement,
ExpressCheckoutElement,
IssuingElement,
LinkAuthenticationElement,
PaymentElement,
useStripe,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.