Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @engima7,

    Could you be more precise with what you’re trying to achieve?

    This is not possible using the payment type shortcode in an editor field.

    Otherwise, you can use the shortcode in a template file to use a variable as the amount parameter.

    Best regards

    Thread Starter engima7

    (@engima7)

    Thank you for the response. The use case is something like this – A user picks products which may add up to a total amount. I do not know how we can pass the variable total amount in the Direct Stripe short code. What is the best way to pass the variable amount value in the short code?

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    In this case I recommend you use an ecommerce plugin(like Woocommerce) that will handle products and cart without further coding.

    Direct Stripe was designed to create more straight forward charges.

    Best regards

    Thread Starter engima7

    (@engima7)

    Thanks. Even if we have assume straight forward charges and let us say we have one final amount which is calculated and available, how are we going to use the direct stripe plugin for sending this final amount dynamically?

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    In a template file,you could echo the shortcode with variables like :

    
    $shortcode = sprintf(
        '[direct-stripe amount="%1$s" type="payment"]',
        $total_amount
    );
    echo do_shortcode( $shortcode );
    

    The variable total_amount being your available total amount to charge.

    Best regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add dynamic amount value?’ is closed to new replies.