Hi @pitfallindimate3746.
It’s not currently possible to achieve that in current plugin version, but could be implemented in the upcoming version if you can describe your usage case a bit more.
I guess there is no reason to hardcode email value in shortcode parameter (unless your code dynamically generates shortcodes?). If you’re familiar with hooks (e.g. do_action()), I can add email parameter to the data for the hook that is fired before the button is displayed and you can use it to set your user’s email in the runtime.
My usage case is such:
A shop owner has a cockpit page where they use a form to type an email address of a client and a price.
Then an email is sent to the client with a link to a payment page.
When the client enters the payment page, there should be a Pay Now button with embedded their email address and the price (all that was previously set up by the shop owner).
Understood. Then, a shortcode parameter for the button (something like customer_email=”johnlocke@example.com” should do it.
This option will be added in the upcoming version 1.7.9 (which is coming shortly, within 1-2 days).
Great, can you just suggest to me where to find a manual for dynamic changing of shortcode parameters, in other words to put my own data dynamically to parameters instead of static hard-coded ones.
If you’re familiar with WP hooks and filters, there is a hook fired that contains almost all the data used to display payment button:
$data = apply_filters( ‘asp-button-output-data-ready’, $data, $atts );
If you hook to this filter, $data contains almost everything you need. Just var_dump($data) in your filter handler function to see what’s available.
Currently, it doesn’t have customer_email parameter in it, it will be added in the upcoming version.
Or, like I said earlier, the upcoming version will have customer_email shortcode parameter and you can dynamically generate your payment button something like that:
echo do_shortcode('[accept_stripe_payment name="Payment for your order" button_text="Pay Now" amount="'.$amount.'" customer_email="'.$customer_email.'"]');
It works (just “price” instead of “amount”).
Waiting for the upgrade, thanks a lot.
The new version has been released. I’m marking this topic as “resolved”. If you have any issues related to implemented functionality, please do post them here.