adjust payment step
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
class="btn bg-[#7B73FF] text-white hover:bg-[#0A2540] text-lg w-full"
|
class="btn bg-[#7B73FF] text-white hover:bg-[#0A2540] text-lg w-full"
|
||||||
:class="{ disabled: isCreatingCheckout }"
|
:class="{ disabled: isCreatingCheckout }"
|
||||||
:disabled="isCreatingCheckout"
|
:disabled="isCreatingCheckout"
|
||||||
@click.prevent="startCheckout"
|
@click.prevent="postCheckout"
|
||||||
>
|
>
|
||||||
<IconInnerShadowTop
|
<IconInnerShadowTop
|
||||||
v-if="isCreatingCheckout"
|
v-if="isCreatingCheckout"
|
||||||
@@ -126,6 +126,10 @@ export default {
|
|||||||
if (this.sessionId) {
|
if (this.sessionId) {
|
||||||
this.$emit('submit')
|
this.$emit('submit')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.sessionId) {
|
||||||
|
this.postCheckout({ checkStatus: true })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async submit () {
|
async submit () {
|
||||||
@@ -158,7 +162,7 @@ export default {
|
|||||||
return Promise.resolve({})
|
return Promise.resolve({})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
startCheckout () {
|
postCheckout ({ checkStatus } = {}) {
|
||||||
this.isCreatingCheckout = true
|
this.isCreatingCheckout = true
|
||||||
|
|
||||||
fetch(this.baseUrl + '/api/stripe_payments', {
|
fetch(this.baseUrl + '/api/stripe_payments', {
|
||||||
@@ -166,6 +170,7 @@ export default {
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
submitter_slug: this.submitterSlug,
|
submitter_slug: this.submitterSlug,
|
||||||
field_uuid: this.field.uuid,
|
field_uuid: this.field.uuid,
|
||||||
|
check_status: checkStatus,
|
||||||
referer: document.location.href
|
referer: document.location.href
|
||||||
}),
|
}),
|
||||||
headers: { 'Content-Type': 'application/json' }
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
|||||||
Reference in New Issue
Block a user