Receive payments on a Vue App
This article guides us through the process of initializing Asyncpay checkout and receiving payments on a Vue Application.
Introduction
Before you begin
Set up the Vue Project
npm create vue@latestCreate a form to collect payments
<script setup>
import { reactive } from 'vue'
const state = reactive({
firstName: '',
lastName: '',
email: '',
amount: 10
})
const handleCheckout = () => {
}
</script>
<template>
<section>
<h1>A Simple Asyncpay Checkout</h1>
<hr />
<form @submit.prevent="handleCheckout">
<div>
<label for="firstName">First Name</label>
<input name="firstName" type="text" v-model="state.firstName" />
</div>
<div>
<label for="lastName">Last Name</label>
<input name="lastName" type="text" v-model="state.lastName" />
</div>
<div>
<label for="email">Email</label>
<input name="email" type="email" v-model="state.email" />
</div>
<div>
<label for="amount">Amount</label>
<input type="number" v-model="state.amount" />
</div>
<div>
<button>Pay NGN {{ state.amount }}</button>
</div>
</form>
</section>
</template>
<style scoped>
label {
display: block;
}
section {
padding: 30px;
}
form {
display: flex;
flex-direction: column;
gap: 8px;
}
</style>Install Asyncpay CheckoutJS
Last updated