Custom gift voucher feature
Posted: 18 Jan 2018, 10:14
Hello, I am currently trying to implement a gift voucher feature where every user will have a virtual wallet attached to their account.
I am trying to get an idea if there is a better way or a built in way to do this.
Note : We are using React.js on the frontend and using aimeos as a backend via the REST API.
My way of thinking is to create for example 4 products with a custom type "Voucher"
- 100 £ Voucher
- 50 £ Voucher
- 25 £ Voucher
- 10 £ Voucher
At first when the user purchases the gift voucher let's say for example a "100 £" voucher, during the purchase process, the user will not get asked to enter a shipping address and will not have the ability to pay for the voucher with their account balance.
For this I was thinking of implementing a separate process to pay for vouchers and not use the default cart behaviour process, so that the user can choose the voucher and directly pay for it.
After the payment process is complete, the user will get an email that contains the voucher code, he can then either apply the voucher to their account or send it to a friend.
For this I was thinking of creating a separate table in the database to store a randomly generated voucher code that we are going to generate on the backend and the voucher value and a boolean so that the code can only be used one time only.
After the voucher code is applied on an account, the account balance will change accordingly to the voucher value.
To hold the account balance I was thinking of creating another table in the database that is linked to the user id.
When the user tries to purchase products from the site, and if the account balance is greater or equal to the cart total, the user can use their account balance as a payment method and pay for their cart.
For this I was thinking of creating a custom payment service named for Example "Account Balance" so that when we create an order we set the payment method to that service.
I am trying to get an idea if there is a better way or a built in way to do this.
Note : We are using React.js on the frontend and using aimeos as a backend via the REST API.
My way of thinking is to create for example 4 products with a custom type "Voucher"
- 100 £ Voucher
- 50 £ Voucher
- 25 £ Voucher
- 10 £ Voucher
At first when the user purchases the gift voucher let's say for example a "100 £" voucher, during the purchase process, the user will not get asked to enter a shipping address and will not have the ability to pay for the voucher with their account balance.
For this I was thinking of implementing a separate process to pay for vouchers and not use the default cart behaviour process, so that the user can choose the voucher and directly pay for it.
After the payment process is complete, the user will get an email that contains the voucher code, he can then either apply the voucher to their account or send it to a friend.
For this I was thinking of creating a separate table in the database to store a randomly generated voucher code that we are going to generate on the backend and the voucher value and a boolean so that the code can only be used one time only.
After the voucher code is applied on an account, the account balance will change accordingly to the voucher value.
To hold the account balance I was thinking of creating another table in the database that is linked to the user id.
When the user tries to purchase products from the site, and if the account balance is greater or equal to the cart total, the user can use their account balance as a payment method and pay for their cart.
For this I was thinking of creating a custom payment service named for Example "Account Balance" so that when we create an order we set the payment method to that service.