Skip to content

Commit b66b4f2

Browse files
chore: wip
1 parent 104bfe4 commit b66b4f2

File tree

14 files changed

+396
-307
lines changed

14 files changed

+396
-307
lines changed

app/Actions/Payment/CreateSubscriptionAction.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ export default new Action({
77
method: 'POST',
88
async handle() {
99
const subscription = await stripe.subscription.create({
10-
customer: 'cus_R5DJaEyyeKKlAN',
11-
items: [
10+
customer: 'cus_R5DJaEyyeKKlAN',
11+
items: [
1212
{
13-
price: 'price_1QCjMXBv6MhUdo23Pvb5dwUd',
13+
price: 'price_1QCjMXBv6MhUdo23Pvb5dwUd',
1414
},
15-
],
16-
payment_behavior: 'default_incomplete',
17-
expand: ['latest_invoice.payment_intent'],
15+
],
16+
payment_behavior: 'default_incomplete',
17+
expand: ['latest_invoice.payment_intent'],
1818
})
19-
19+
2020
// Step 3: Get the PaymentIntent for the first invoice from the subscription
2121
const latestInvoice = subscription.latest_invoice
2222
const paymentIntent = typeof latestInvoice === 'object' ? latestInvoice?.payment_intent : undefined
23-
23+
2424
// Step 4: Pass the client_secret to the front end for Stripe Elements
2525
return paymentIntent
2626
},

app/Models/User.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export default {
3737

3838
observe: true,
3939

40+
billable: true,
41+
4042
// useUuid: true, // defaults to false
4143
},
4244

storage/framework/core/components/stepper/src/components/Example.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import { Modal } from '@stacksjs/modal'
3-
import Stepper from './Stepper.vue'
43
import { ref } from 'vue'
4+
import Stepper from './Stepper.vue'
55
66
const props = defineProps<{
77
visible: boolean

storage/framework/core/components/stepper/src/components/Step.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function handleChange() {
9090
<slot v-bind="scope" />
9191
</span>
9292
<span v-if="withDivider && !isLastStep" class="ml-2 w-full shadow-md">
93-
<span class="bg-gray h-1 block" />
93+
<span class="block h-1 bg-gray" />
9494
</span>
9595
</label>
9696
</div>

storage/framework/core/components/stepper/src/components/Stepper.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,15 @@ defineExpose({
196196
</script>
197197

198198
<template>
199-
<div style="
199+
<div
200+
style="
200201
box-sizing: border-box;
201202
width: 100%;
202203
display: flex;
203204
justify-content: space-between;
204205
user-select: none;
205-
">
206+
"
207+
>
206208
<Step
207209
v-for="(step, $index) in stepsArr"
208210
:key="$index"

storage/framework/core/components/stripe/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<script lang="ts" setup>
2-
import { ref } from 'vue'
2+
import { ref } from 'vue'
33
44
const products = ref([{
55
name: 'iPhone Pro Max',
66
price: 99900, // Price in cents ($999.00)
77
images: 'https://store.storeimages.cdn-apple.com/1/as-images.apple.com/is/iphone-16-pro-model-unselect-gallery-2-202409?wid=5120&hei=2880&fmt=webp&qlt=70&.v=aWs5czA5aDFXU0FlMGFGRlpYRXk2UWFRQXQ2R0JQTk5udUZxTkR3ZVlpTDUwMGlYMEhQSTVNdkRDMFExUU1KbTBoUVhuTWlrY2hIK090ZGZZbk9HeE1xUVVnSHY5eU9CcGxDMkFhalkvT0FmZ0ROUGFSR25aOE5EM2xONlRwa09mbW94YnYxc1YvNXZ4emJGL0IxNFp3&traceId=1',
88
}])
9-
10-
119
</script>
1210

1311
<template>
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
<script setup lang="ts">
22
interface Products {
33
name: string
4-
price: number,
4+
price: number
55
images: string
66
}
77
88
interface Props {
99
products: Products[]
10-
redirectUrl: string,
10+
redirectUrl: string
1111
mode: 'one-time' | 'subscription'
1212
applePay?: boolean
1313
googlePay?: boolean
1414
}
1515
16-
const props = defineProps<Props>();
16+
const props = defineProps<Props>()
1717
1818
const products = props.products
19-
20-
</script>
19+
</script>
2120

2221
<template>
23-
<OneTimePayment :products="products" :redirect-url="props.redirectUrl" v-if="mode === 'one-time'"/>
24-
<Subscription :products="products" :redirect-url="props.redirectUrl" v-if="mode === 'subscription'"/>
25-
</template>
22+
<OneTimePayment v-if="mode === 'one-time'" :products="products" :redirect-url="props.redirectUrl" />
23+
<Subscription v-if="mode === 'subscription'" :products="products" :redirect-url="props.redirectUrl" />
24+
</template>

0 commit comments

Comments
 (0)