Dynamic amount for the payment button

Excuse me for my poor English.
My question is, how can I create a payment button and connect the amount of this button to a desired part of the database?

Hello Mahdi. Do you mean that you want to pull a price for something from the database to that the visitor can pay for that? And which payment gateway will you be using?

1 Like

Hello my friend
Thank you for your kindness
I have built a WordPress website for my client and on this website each user has a debt to this site, and the amount of this debt is manually entered into the database by the website manager (my client) and displayed in the personal profile of each user. There is also a button to pay this debt in the user profile. In order to do this, I had to develop a plugin for this site and I had a problem in only one step of this work. The problem is that connecting the payment button (which is in the user’s profile) to the payment gateway of my choice, which is located in my country, requires special coding that I don’t have the skills to do.
This payment gateway has a module to connect to the Gravity Forms plugin.
Is it possible to create a payment button in the Gravity Form plugin and connect the amount of this button to my desired part in the database?

Hello Mahdi. There is no such thing as a payment button in Gravity Forms, so I don’t think Gravity Forms is going to work for you in the way you describe.

If you have a list of debt amounts that is stored in a database, you can use dynamic population to populate a field in the form with the amount of the debt. You can use the gform_field_parameter filter to populate fields in a form:

That takes care of populating a field in the form with the debt amount. You will need to determine how the debt amount is associated with the user account and that the proper debt amount is only to that user.

With the field populated with the debt amount, you can do whatever you need to. Maybe that is to send the submission to a payment gateway. Some payment gateways require the visitor to be redirected to the URL you specified, and then the payment gateway is responsible for returning the visitor to your website after the transaction. A lot of this is dependent on how the debts are stored, how they are shown to your visitors, what you do after form submission, etc.

1 Like

Thank you my friend

You’re welcome. Let us know if you need any other assistance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.