gpt4 book ai didi

php - Paypal 立即购买按钮传递一些变量但不是全部

转载 作者:太空宇宙 更新时间:2023-11-03 16:11:21 25 4
gpt4 key购买 nike

我在为客户网站创建 Paypal 立即购买按钮时遇到问题。名字、姓氏、电子邮件地址和商品名称都在进行中,但帐单地址和价格都在进行中。很奇怪应该是一个简单的过程。这是我的代码:

$invoicenumber = $row['InvoiceNumber'];
$totalquantity = $row['TotalQuantity'];
$totalprice = $row['TotalPrice'];
$costofshipping = $row['CostOfShipping'];
$firstname = $row['FirstName'];
$lastname = $row['LastName'];
$billingstreetaddress = $row['BillingStreetAddress'];
$billingapartmentnumber = $row['BillingApartmentNumber'];
$billingcity = $row['BillingCity'];
$billingstate = $row['BillingState'];
$billingzipcode = $row['BillingZipCode'];
$emailaddress = $row['EmailAddress'];
echo "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
<input type='hidden' name='cmd' value='_s-xclick'>
<INPUT TYPE='hidden' NAME='business' VALUE='payments@companyname.com'>
<INPUT TYPE='hidden' NAME='invoice' VALUE='$invoicenumber'>
<INPUT TYPE='hidden' NAME='undefined_quantity' VALUE='$totalquantity'>
<INPUT TYPE='hidden' NAME='item_name' VALUE='CompanyNamePurchase'>
<INPUT TYPE='hidden' NAME='amount' VALUE='$totalprice'>
<INPUT TYPE='hidden' NAME='shipping' VALUE='$costofshipping'>
<INPUT TYPE='hidden' NAME='currency_code' VALUE='USD'>
<INPUT TYPE='hidden' NAME='first_name' VALUE='$firstname'>
<INPUT TYPE='hidden' NAME='last_name' VALUE='$lastname'>
<INPUT TYPE='hidden' NAME='address1' VALUE='$billingstreetaddress'>
<INPUT TYPE='hidden' NAME='address2' VALUE='$billingapartmentnumber'>
<INPUT TYPE='hidden' NAME='city' VALUE='$billingcity'>
<INPUT TYPE='hidden' NAME='state' VALUE='$billingstate'>
<INPUT TYPE='hidden' NAME='zip' VALUE='$billingzipcode'>
<INPUT TYPE='hidden' NAME='lc' VALUE='US'>
<INPUT TYPE='hidden' NAME='email' VALUE='$emailaddress'>
input type='hidden' name='hosted_button_id' value='paypalclientnumber'>
<input type='image' id='paypalsubmitbutton' style='top:750px;left:65%;position:absolute;' src='https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'>
<img alt='' border='0' src='https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width='1' height='1'>
</form>";

/* 这是源代码 - 如您所见,没有发票号码通过,价格和数量为零,地址在那里,但没有通过 paypal。运费也在那里。 */

<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
<input type='hidden' name='cmd' value='_s-xclick'>
<INPUT TYPE='hidden' NAME='business' VALUE='payments@companyname.com'>
<INPUT TYPE='hidden' NAME='invoice' VALUE=''>
<INPUT TYPE='hidden' NAME='undefined_quantity' VALUE='0'>
<INPUT TYPE='hidden' NAME='item_name' VALUE='CompanyNamePurchase'>
<INPUT TYPE='hidden' NAME='amount' VALUE='0.00'>
<INPUT TYPE='hidden' NAME='shipping' VALUE='7.00'>
<INPUT TYPE='hidden' NAME='currency_code' VALUE='USD'>
<INPUT TYPE='hidden' NAME='first_name' VALUE='Multigrain'>
<INPUT TYPE='hidden' NAME='last_name' VALUE='Cheerios'>
<INPUT TYPE='hidden' NAME='address1' VALUE='2 Spoonful Way'>
<INPUT TYPE='hidden' NAME='address2' VALUE='myemailaddress@email.com'>
<INPUT TYPE='hidden' NAME='city' VALUE='Brooklyn'>
<INPUT TYPE='hidden' NAME='state' VALUE='New York'>
<INPUT TYPE='hidden' NAME='zip' VALUE='11203'>
<INPUT TYPE='hidden' NAME='lc' VALUE='US'>
<INPUT TYPE='hidden' NAME='email' VALUE=''>
<input type='hidden' name='hosted_button_id' value='paypalidjumbledletters&#s'>
<input type='image' id='paypalsubmitbutton' style='top:750px;left:65%;position:absolute;' src='https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'>
<img alt='' border='0' src='https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width='1' height='1'>
</form>

最佳答案

除了确保按钮是非托管按钮外,如果您在传递地址变量时遇到问题,请确保州是缩写的,即 MA 而不是马萨诸塞州。这就是我的解决方案。

关于php - Paypal 立即购买按钮传递一些变量但不是全部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14250384/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com