Example: Stripe Payment Processing

#Example #Stripe #Payment #Router #WebModules #ServerSide #backend #3rdPartyServices #fetch #suppressAuth #Permissions #Repeater #DynamicPages #SharingBeers


Demonstrates

In order to run this example, you will need a Stripe account to supply your own Stripe API keys .

Links for this example

About this example

This app demonstrates different levels of user access:

  • All visitors to the site have access to the FREE page.

  • Visitors who have signed up, and have logged in, also have access to the FREEMIUM page.

  • Paid visitors (payment made from the PAYMENT page) have access to the PREMIUM page and to premium items on the RECIPES page.
    To allow repeated testing of different access levels, the user can log out and clear pay on the HOME page.
    Note : The wix-users API is only partially functional when previewing a site and causes page navigation issues when running a site in Preview mode. View a published version of your site for complete functionality.

The PAYMENT page is used to test the interface with the Stripe payment processing system. Click on the Fill test data button to automatically fill the fields with valid Stripe test values. Click on the Pay button, and the form first encodes the credit card details and calls the Stripe public API to create a Stripe payments token. Using the token, the form calls the backend stripeProxy module to complete the Stripe transaction. After the payment request is submitted, if the transaction is successful, the Charge ID response from Stripe is displayed. (This would not normally be displayed on a live system.) If an error occurred, the returned error type is displayed. Transactions can be viewed under Payments in your Stripe account dashboard. Once you are satisfied that the Stripe interface works correctly in your site, you can replace the test keys with live keys.

Since all access to the Members database collection is in backend code, we are able to set the collection Permissions to Private Data to provide a high level of security.


Backend code is able to override the strict permissions and gain access to the collection by using the suppressAuth option.

The ABOUT page has a button for opening a sitemap of the example in a separate tab/window.

13 Likes

WOW! AWESOME! This is so great!!!

So bad ass amazing!!

QUESTION & CHALLENGE
Follow the instruction below USING WIX PLATFORM. Starting from the SUBMIT button – How would you create this process – USE DETAIL IN EXPLANATION :slight_smile: GOOD LUCK ------ CONTACT ME Ready – Set – GOOOOOOOO
CONTACT ME on FB MESSENGE
or – wjamesrapp@hotmail.com

@James

This example should give you a good start.

You may also want to check out the WixArena - it’s a hub where you can look for Wix Code (and other) experts for hire.

YISRAEL – Thank you for your effort but apparently either I have no idea what You are talking about or YOU never read my example and have no idea what I am talking about.

MY SITE IS – NOT – a subscription site – my website is not a PAID PREMIUM NOR FREEMIUM site

THANK YOU for your effort. Apparently I did a terrible job trying to explain my needs.

When I win the lottery I will apparently find a professional to create my site, but if I have to pay people it wont be WIX – If I have to pay for it I will have it professionally done.

Thank you

I see that you have posted the same thing six times with no replies except for mine. If you are interested in a payment processor example, then here it is.

You should be able to use this example to enable saving data, just as it enables viewing the data.

If you need something else, then you might want to consider checking out the WixArena - it’s a hub where you can look for Wix Code (and other) experts for hire.

James, what you are trying to do very simple and only requires a couple of google searches to find the piece you’re missing. Yisrael has explained what you’re asking for in detail right above your post. The rest (beginning) of your “challenge” is some of the most basic Wix Code features you can possibly add to your site. It’s all easily searched by the the terms below. It is simple data entry, which should be set up with a Data Entry Text Field Box, a Data Collection to collect the visitor’s entered data, a Data Set on the page to link to where the data goes, with a Submit button to save data and take you to whatever page you assign the Submit button to. Then integrate the process Yisrael laid out for us above to finish the last part of the payment integration. Of course, none of these features are available if you don’t have developer tools activated within your editor. There’s a couple steps in betwen all that to make your form work. Google ‘data entry wix code.’ Wix Code isn’t for everyone. It requires learning, researching and not sounding like an ass whe you ask for help from the team that is constantly working around the clock to keep up our requests. Good luck.

Nelson

Thank you both but I really do not believe you understand what I am asking for because I keep seeing the same posts of what I DONT WANT in my website.

It is GREAT TO KNOW that it might be simple but that is coming from two people that cant grasp what I need done.

I came to wix because I HAVE NO MONEY – I would be VERY interested in paying the right person to do the job if I could would out a payment plan but so far no one I have talked to wants to work out a payment plan AND so far no one has shown they even know what I am talking about.

I have the database already DONE – I basically have the website already DONE
I DO NOT have the payment method set up BECAUSE of the issue I diagrammed out above.

TRUE – I AM NO GENIUS in coding AT ALL. So perhaps I dont understand what you are saying

BUT MY SITE WILL NOT BE :
Will not be A subscription site
Will not have a LOG IN ( except for maybe 1 page )

ACCESS is FREE to the SITE
ACCESS is FREE to each and every page
Filling out the database forms is FREE on every page
SUBMISSION TO THE DATA BASE – COSTS for 2 pages – But the pages are not member log in pages

SUBMISSION of DATA on the pay forms COSTS EACH AND EVERY TIME THEY SUBMIT DATA ( meaning You come to my site see that page you want to submit data into and when you press SUBMIT – YOUR DATA IS **NOT SUBMITTED YET ** you are directed to a payment page – After the payment is ACCEPTED the DATA is entered into the database. — ANYONE CAN THEN ACCESS THAT DATA on the SEARCH PAGE for FREE

On some of the pages - DATA – DIFFERENT DATA – is submitted totally for FREE

ON ONE PAGE when a customer COULD BE DONE by LOG IN and data entry – HOWEVER – They and only they and our company can access that data and THAT DATA is NOT free access to anyone NEITHER can anyone else access that data>

ALSO on that log in page If they want to ADD MORE DATA to the database THAT TOO WILL ALSO COST – it is not a SUBSCRIPTION with unlimited access to add data but only unlimited access for THEM to view the data they once entered.

DOES ANY OF THAT MAKE SENSE ???

IF YOU CAN DO SUCH A THING – HOW MUCH DO YOU CHARGE since you dont help people out for free ???

wjamesrapp@hotmail.com

So I guess I tried to charge you for my FREE answer??? YOU apparently do NOT read so you don’t understand. ALL THE ANSWERS ARE HERE YOU FOOL. I dont work for wix and I didnt even need to make a FREE explanation here. If you have no money, how do you plan to have a payment option on your site without upgrading??? You cannot accept payments without upgrading. You can assign any page to be readable/viewable/accessible by any non-member, same as payment. You have full control on all permissions on every aspect. So you can throw in a log in or not. Doesnt change what you want to do. As far as not finding anyone to work with you,I dont think that your lack of money is the issue. Its your lack of interpersonal skills and respect. I wouldn’t even let you pay me to work with you. But i still enjoy shedding some light and helping for FREE. You need to find out how Wix words the functions you want to happen so then you can search them easier. Waaaay too much to write here and I dont want to invest that much time into you. Good luck. Have a good day and F**K off already.

Same to ya champ – you cant do it so you simply want to argue and tell people off – I WOULDNT WANT YOUR HELP EITHER

Same to ya champ –
I AM VERY POOR – sorry I have a poor attitude towards arrogant people. I may just have enough money to UPGRADE does not automatically mean I am full of money to throw around to people who apparently cant do or cant explain that they can help solve my issue.

Apparently you cant do it so you simply want to argue and tell people off – I WOULDN’T WANT YOUR HELP EITHER

A few GOOGLE SEARCHES – works only if you know what your looking for – Like I said – I DON’T HAVE ANY IDEA ABOUT CODE so I could be looking right at it and not know it. Besides listen to yourself – ALL I DID was ask a question over and over – I get people talking a bunch about how smart they are and how simple everything is for them but I dont hear anything about what I asked – so as far as I am concerned YOU are the rude insolent one that thinks YOUR opinion is so great we have to hear you droan on about stuff that I was not even asking about.

James,

Please understand that Wix is unable to provide full code solutions. However, we do provide many resources (including the example in this post) to help users learn how to get the most out of Wix Code.

The reason I originally suggested checking out the WixArena , is because I realized that for whatever reason, you might not want to do your own coding, or perhaps you’re not a coder and unable to. You have nothing to lose by checking out the WixArena. You might be able to find someone there who knows how to do what you need, and is willing to work out a flexible payment schedule.

Good luck with your project. Most importantly - we’re a community, so let’s be nice to each other. Maybe someday, @James and @Nelson, we can share some beers. :beers:

Yisrael

James, check out CODE QUEEN on YouTube. I’m not a coder/developer. I can only give info to shed light and I know how frustrating it can be when you’re stuck. I learned everything from endless google searches, even endless searching just to find out how Wix terms the functions to then be able to search again on that function. It takes time and patience to learn something new, especially something this complex and especially if you’re trying to do it where you don’t have to spend any money or the minimal. I am building an EXTREMELY complex site, along with 2 other sites for my 2 other businesses and I’ve been able to find almost everything I need through Code Queen, Wix Code Forum, and some other Wix Code users that have YouTube channels like Code Queen. Fiverr is also a great place to get cheap code/design work and flexible payment options and even free help at times. Wix Arena is not Wix employees. Its just independent Wix Code users that know their way around.

It’s hard to find the exact custom process one needs for their site all written out in detail in one spot, as everyone has a customized vision of how their site works and it is never the same, which is why Wix Code came into play. Sometimes you’ll get lucky on some things if its a common problem and get complete answers. But being so demanding and entitled sounding (maybe I’m just interpreting your intentions/tone wrong through text), but you sounded a bit harsh. I only reciprocated your tone. I didn’t say I had all the answers. I was simply trying to HELP with what I already knew.

Dissect all the pieces of functions you need, learn to do them and to integrate them together in the sequence you need, once its built and it still has bugs, ask the specific bug question here. You pretty much have it all set up. I don’t think Yisrael’s example requires a log in. Simply replicate the last page of the payment part. Stripe Payment on your payment page. Have your Submit button lead to the payment page, make sure you HIDE the payment page from you navigation menu and disable search engines being able to find that page in your Page Manager so that it doesn’t need to be a members only page. I haven’t implemented this process yet so I don’t know the exact details of it until I try. Then figure out how to make the data that was entered only be entered upon a successful payment. I don’t that part yet cause I haven’t put this together in the way you need.

I’m also seeing a problem you may run into after even successfully setting up what you need…Data collections data being displayed where you have it available will not display data in real time. Meaning, if a visitor fills in data and makes payment successfully, it still won’t display it immediately unless you manually update/publish the site or add a bit of code for this to happen automatically. I just had this question answered a couple of days ago…Mainly the bottom portion of adding real-time updating to your data display will apply to your set up…

Hi Nelson,
The product you describe requires a ‘real-time’ update, which is not yet available on Wix Code (so this means that notifications cannot be ‘pushed’, only ‘pulled’).
First of all, you need to model your data correctly.
I assume you already have a collection of events, so that part is done, now you need to model a collection that saves relations between users.
I suggest going with a simple solution of a collection that has two main columns: FOLLOWER, FOLLOWEE.
You’ll need to add a ‘FOLLOW’ button and write some code to update this database using wixData API .
And finally you’ll need to use wixData again for querying collections and decide what notification to show when a user logs in.

"Now, since we don’t have real-time yet, you can use polling (use setInterval with 1 second). This way when a user is already logged in, the database will be checked for changes every second."
Good luck :slight_smile:
Liran"

Hope this helps.

Nelson

Hmmmmmm, Sounds like I have a hell of a lot more studying and I have tried to figure this out the past year – It also sounds like on WIX – I still can not get done what I need done – although I have no idea what the processes are or how they work. Ill wait until I get a better job so I can simply PAY a professional to CREATE what I need.

EVEN IF I WON THE LOTTERY TODAY – I would STILL work on getting this site up and running. It shows to make more money that the lottery would give out.

BUT living on a BUDGET means I only have enough money right now to do certain things right now and throwing money around in search for someone to tell me they cant do it or do not understand what I am saying is not what I can afford.

I WILL TAKE YOUR ADVICE and continue to read and research however I have found that going to the internet with 1 question will cause you to only find 100 more questions and still no answer.

Thank you for everyone’s input – for me its still very foggy but I appreciate your INTELLECT AND EFFORT.

ROCK ON.

What you need is not that complicated. I know from your perspective it seems difficult, but you have it almost set up man. Don’t give up. Sometimes I get stuck for a week or two but all the answers are there. Not everyone words their issue how we would at times so it gets lost through searches. I bookmark all the pages I find with my answers. If you already have the data collection/display part down, you’re not too far from having it work. Keep grindin. It’s all worth it at the end. F**k the lottery! lol

Hey James and Nelson, I’m in transit right now, but as soon as I’m near a refrigerator full of beer, I’ll have one (err, maybe two) for each of you. Hang in there James. And Nelson, thanks for the great “philosophical” posts - absolutely spot on. :beers::beers:

niceeeeeee
how can i make that if the payment is ok it will take the custemer to a thank you page ???

@Avrumi, In the PayNow() function, use wix-location.to() to redirect to a thank you page after the Charge ID is received.