Starting a new post as requested and answering included question.
As mentioned we are a small nonprofit that charges for therapy. Our payment structure is a sliding scale so for a given service the price varies significantly. The recommendation of using a ‘Donate’ button won’t work because we are a nonprofit and we accept donations and that is in place and we need to differentiate a donation from a payment for services.
So what I need is the ability for a customer to enter the amount of the payment and then be able to enter the info to pay with a credit card. The standard ‘Pay Now’ button handles the credit card necessary info but you have to set it to a fixed amount and I need to allow a variable amount to be entered.
@duaneahoward There is an API for this. Have a look at wix-pay and wix-pay-backend . There are a number of examples in the documentation and quite a few posts on this forum regarding its use.
Thanks anthonyb. With some code of yours that I found in another thread and your referenced material, I managed to get this working. Could you provide another thought?
Our website is public with no login required. When I was reading some of the referenced material it recommended to look at security implications. Since all I am doing is getting an inputted amount and putting it where it needs to go and calling the Wix start payment which manages the input of sensitive information I don’t sense that I have a security exposure. Am I correct in my thinking?
If you haven’t seen this page, it would be worthwhile to spend some time with it:
https://support.wix.com/en/article/corvid-security-considerations#code-visibility
First thanks for being so quick and full of information on reply. The page you reference is were I was reading and I reread it again. On the client side I am reading an amount entered and passing that to the server side. The sever side sets up the appropriate objects to call the Wix start payment process. The start payment is secure and where sensitive info is entered. I suppose a nefarious character could change the code on the client side and have a person charge more than entered. I can add some wording to check that. Please, if I am missing something, let me know what you think the exposure is. Thanks again.
@anthonyb
I found another article and in this article it said to keep sensitive info like prices in the backend to keep people from changing a price. I also found in an article a method to input a variable amount. The input was done on the client side and passed to the backend to setup the payment and then returned to the client side to execute the Wix startPayment. This is basically what I am doing. Being a complete nubie at this, if you see an exposure and can advise how to implement better it would be much appreciated. Thanks.