Hi @ all
I’m trying to build a little webshop. I have to payment providers: paypal and postfinance (it is very important in Switzerland to support postfinance).
The user should have to choose between the payment provider, enter it’s billing information and get forwarded to the payment website (paypal or postfinance). Both of them work with submitting data via a form. Until now it’s easy to set up. I’m already at this point and it is working.
But my questions is now, what would be the best way to store the user data including the note if the payment was successful? I did a version with submitting the form data to a google sheet. but in this case the controlling is missing. The data gets stored even the payment was canceled.
What would be your preferred way to address this issue?
Thanks for any hint.
I think it is hard to answer that question if you don’t provide further information.
Like whats your plan with that data? Why do you need it stored? Whats the purpose of storing it in a google sheet? The best way to store that data depends on those question being answered right?
Also you might want to consider if it is okay for your users if their data land in a 3rd party app (google).
@samnabi has built an amazing e-commerce solution for Kirby called Shopkit:
Shopkit is a product that works out-of-the-box. It comes with PayPal and Stripe and a lot of cool features ready to use. Making some tweaks might be a daunting task at first, but once you get a hold of it, creating your own templates, visuals and payment gateways is not that hard --and actually simple to replicate.
It naturally stores every order in its structure and it lets you download a PDF invoice with basic user and order data. Every gateway has a callback logic so you can use that to do almost anything; in this case store something somewhere else, like a Google Drive sheet.
The way I see it is like Kirby pumped up on salesman-steroids. I mean that in the best possible way, of course.
Thanks for your answers… and sorry for the lack of information.
The shop should be primarily for preorder stuff. So we need the addresses in some sort of a table to deliver if the items are ready for shipping.
I’m watching samnabi’s shopkit and thought because of my special “swiss” gateway it’s easier and more lightwight to build something by my own. But I will definitely have a look into his code.
How do you currently collect the order / customer informations ? In a session ?
The data gets stored even the payment was canceled
I have no clue for how postfinance works, you’d have to check their API but with paypal you get a
payment_status if I remember correctly that allows you to trigger your callback and store your data only if the payment succeeded.
what would be the best way to store the user data including the note if the payment was successful?
I set up something recently, once payment is completed it simply generates an ID for the order and creates a new page within kirby with the order informations, wouldn’t this be easier since you have all informations at hand and that wouldn’t require a third-party app, which as @Andi-Lo stated, can raise somme issues ?
I have a toggle field I set to
true / false on thoses pages, depending on if the order has been shipped to keep track of them.
Then the easiest way to display your orders in the panel could be two differents Subpagelist you
Or a completely custom panel page to have easier access to those informations at a glance.
Take a look at the Shopkit documentation for adding your own Payment gateway here: http://shopkit.samnabi.com/docs/creating-your-own-payment-gateway
Depending on how the postfinance API works, you would be able to collect your required information in
process.php and save it before processing the payment.
Feel free to send me a message if you want to talk more in depth about adding a postfinance gateway to Shopkit.