Custom EOT with PayPal Buttons (Dynamic EOT Not Passed to Shortcode)

I used this excellent article by RaamDev to create the PHP function for my dynamic EOT.

I am trying to set a PayPal Button so that the user is charged $30 today and then $80 on December 5, 2017.

The PHP function appears to be working correctly as it is returning to me 39 days (today is October 11 2017), however, this value is then not being passed to the “tp” variable in the PayPal Button shortcode. When I click on the button that is created, it takes me immediately to a $80 checkout page with PayPal.

This worked for me last year (this is a seasonal business), but this year it is not working. I would really appreciate any insight into what may have changed.

Below is my shortcode: Thank you very much!

[s2Member-PayPal-Button level=“1” ccaps="" desc=“1 one-way seat confirmed on bus” ps=“paypal” lc="" cc=“USD” dg=“0” ns=“1” custom=“” ta=“30.00” tp="<?php echo $trial_days; ?>" tt=“D” ra=“80.00” rp=“1” rt=“D” rr=“BN” rrt="" rra=“1” image=“default” output=“button” /]

I am having a similar issue, were you ever able to get the value passed to the shortcode?

Could you show us the shortcode and PHP you’re using?