Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Nov 9, 2024
1 parent 76e2cd9 commit 4d8466f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion app/Actions/Payment/UpdateCustomerAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export default new Action({
name: 'UpdateCustomerAction',
description: 'Update customer detauls',
method: 'POST',
async handle(request: RequestInstance) {
async handle() {
// async handle(request: RequestInstance) {
const user = await User.find(1)

const customer = await user?.syncStripeCustomerDetails({ address: {
Expand Down
2 changes: 0 additions & 2 deletions app/Models/User.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Model } from '@stacksjs/types'
import type { UserModel } from '../../storage/framework/orm/src/models/User'
// soon, these will be auto-imported
import { faker } from '@stacksjs/faker'
import { capitalize } from '@stacksjs/strings'
import { schema } from '@stacksjs/validation'

export default {
Expand Down
2 changes: 2 additions & 0 deletions resources/plugins/preloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
*/

// allows for importing .env files
// eslint-disable-next-line antfu/no-top-level-await
await import('bun-plugin-env')

// allows for importing .yaml files
// eslint-disable-next-line antfu/no-top-level-await
await import('bun-plugin-yml')
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const renderedCode = computed(() => {
}
if (currentAction.value === 'header') {
dialogContent = `
dialogContent = `
<template #header>
<h1 class="text-lg font-semibold">
Greetings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ async function loadElements() {
elements = stripe.elements({ clientSecret: clientSecret.value, appearance })
// Create and mount the address element
const addressElement = elements.create('address', options)
addressElement.mount('#address-element')
// const addressElement = elements.create('address', options)
// addressElement.mount('#address-element')
// Create and mount the payment element
const paymentElement = elements.create('payment')
Expand All @@ -69,7 +69,8 @@ async function loadElements() {
async function handleSubmit() {
if (stripe && elements) {
const { error } = await stripe.confirmPayment({
// const { error } = await stripe.confirmPayment({
await stripe.confirmPayment({
elements,
confirmParams: {
return_url: props.redirectUrl, // Redirect URL after payment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ async function createPaymentIntent() {
async function loadElements() {
if (stripe) {
const appearance = { /* appearance options */ }
const options = { mode: 'billing' }
// const options = { mode: 'billing' }
// Create the elements instance once
elements = stripe.elements({ clientSecret: clientSecret.value, appearance })
// Create and mount the address element
const addressElement = elements.create('address', options)
addressElement.mount('#address-element')
// const addressElement = elements.create('address', options)
// addressElement.mount('#address-element')
// Create and mount the payment element
const paymentElement = elements.create('payment')
Expand All @@ -69,7 +69,8 @@ async function loadElements() {
async function handleSubmit() {
if (stripe && elements) {
const { error } = await stripe.confirmPayment({ elements, redirect: 'if_required' })
// const { error } = await stripe.confirmPayment({ elements, redirect: 'if_required' })
await stripe.confirmPayment({ elements, redirect: 'if_required' })
}
}
</script>
Expand Down Expand Up @@ -139,7 +140,7 @@ async function handleSubmit() {
Items in your cart
</h3>
<ul role="list" class="divide-y divide-gray-200">
<li v-for="product in products" class="flex px-4 py-6 sm:px-6">
<li v-for="(product, index) in products" :key="index" class="flex px-4 py-6 sm:px-6">
<div class="flex-shrink-0">
<img :src="product?.images" alt="Front of men&#039;s Basic Tee in black." class="w-50 rounded-md">
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const stepperRef = ref(null)
<div class="flex-center mt-10 w-full">
<Stepper id="stepper-example" ref="stepperRef" v-model="step" :steps="steps" persist />
</div>
<div class="flex-center my-5 font-semibold text-lg">
<div class="flex-center my-5 text-lg font-semibold">
<div v-if="step === 1">
<p>Welcome to Step 1: Initialization</p>
<p>Here you will set up the initial parameters for your process.</p>
Expand Down
1 change: 1 addition & 0 deletions storage/framework/core/payments/src/drivers/stripe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Stripe from 'stripe'
import process from 'process'

const apiKey = process.env.STRIPE_SECRET_KEY || ''

Expand Down
5 changes: 1 addition & 4 deletions storage/framework/core/storage/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ const result = await Bun.build({
format: 'esm',
target: 'bun',
plugins: [
dts({
root: './src',
outdir: './dist',
}),
dts(),
],
})

Expand Down

0 comments on commit 4d8466f

Please sign in to comment.