Home › Forums › Stripe Payments Plugin › Payment Popup Window Related
Tagged: hooks
- This topic has 3 replies, 2 voices, and was last updated 3 weeks, 3 days ago by
Admin.
-
AuthorPosts
-
September 4, 2025 at 6:41 pm #5622
Robert
ParticipantIs there a hook to add post data? I have a pricing calculator, and I want the button to add the total amount in the popup amount field automatically. Is that possible?
September 5, 2025 at 2:53 am #5623Admin
KeymasterThe price of a standard product can’t be modified dynamically in that way, as it will cause the security and verification process to fail.
It’s not an advertised feature of the plugin so code customization will be required for this.
The best options I can suggest for achieving a customized solution are:
Option 1:
Use a “Donation” type product (which allows any amount). In the payment popup window, you can add your own JavaScript code—using the available action and filter hooks—to perform calculations and update the amount field. The following hooks will let you add output (HTML, JavaScript, CSS) to the payment window:If needed, additional hooks can be added.
Option 2:
Use the plugin’s feature for creating a payment button dynamically. With this method, you pre-calculate the amount and then embed or create a payment button with that calculated value. The plugin will generate a dynamic product, ensuring the price verification process does not fail.Creating a Payment Button by Dynamically Adding Item Details in the Shortcode
September 8, 2025 at 8:21 pm #5626Robert
ParticipantYes, I am using it on a subscription and checked the amount variable.
The total amount is calculated using the calculator, and I would like to pass this amount to the field.
example: (popup window)
<input class=”pure-input-1″ id=”amount” name=”amount” inputmode=”decimal” value=”” required=””>Is it possible to add a data here?
/asp-payment-box/?product_id=xxx&ckey=xxxproduct_id: xxx
ckey: xxx
amount: -via hooks-
others: —-September 9, 2025 at 1:22 am #5627Admin
KeymasterWe have a repository with some examples that may include something useful (I’m not entirely sure, but one of them seems close to what you’re asking for).
In particular, this example shows how to add a hidden input element to the payment form. That reference is then sent to Stripe and included in the transaction as metadata.
https://github.com/Arsenal21/stripe-payments-enhancements/tree/master/asp-custom-reference-data-collector -
AuthorPosts
- You must be logged in to reply to this topic.