将 2 个变量传递给 Paypal

Pass 2 variables to Paypal

我正在尝试将联系表中的 2 个变量传递给 Paypal。我有其中一个工作但不是两个。我可以在控制台中看到正在收集 2 个变量,但出了点问题。我正在使用 contact form 7 插件并将我的 javascript 放在那里。因此 on_sent_ok

on_sent_ok: " my_name = jQuery('#fullname').val();"
on_sent_ok: " my_price = jQuery('#price').val();"
on_sent_ok: " console.log(my_name);"
on_sent_ok: " console.log(my_price);"
on_sent_ok: "location = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=patrick%40thefitnessacademy%2eie&lc=IE&amount='+my_price%2e00&currency_code=EUR&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted&item_name=Personal Training Course for ' +my_name;"

您似乎在 ...%2eie&lc=IE&amount='+my_price 之后缺少右单引号 (') 和连接运算符 (+),试试:

location = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=patrick%40thefitnessacademy%2eie&lc=IE&amount='+my_price+'%2e00&currency_code=EUR&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted&item_name=Personal Training Course for ' +my_name;