为非运输项目禁用 Paypal 运费
Disabling Shipping Cost on Paypal for Non-Shipping Items
我目前正在使用 PayPal 表格从网站结帐。在可运送物品上,一切正常。我 运行 关注的问题是该网站还提供不可交付的服务(可下载内容、在线流媒体视频)。购买成功后,我正在从 PayPal 检索正确的回复,前提是他们支付了为不可运送服务计算的运费。这是我的代码的摘录:
<form id="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display: none;">
<?php foreach($checkout as $key => $value): ?>
<input name="item_name_<?php echo $key + 1; ?>" value="<?php echo $value['name']; ?>" type="hidden">
<input name="amount_<?php echo $key + 1; ?>" value="<?php echo $value['amount']; ?>" type="hidden">
<input name="quantity_<?php echo $key + 1; ?>" value="<?php echo $value['quantity']; ?>" type="hidden">
<input name="item_number_<?php echo $key + 1; ?>" value="<?php echo $value['number']; ?>" type="hidden">
<?php endforeach; ?>
<input name="no_shipping" value="2" type="hidden">
<input name="return" value="WEB_SITE/thank-you.html" type="hidden">
<input name="notify_url" value="WEB_SITE/process.html" type="hidden">
<input name="cancel_return" value="WEB_SITE/shopping-cart.html" type="hidden">
<input name="business" value="EMAIL" type="hidden">
<input name="currency_code" value="USD" type="hidden">
<input name="cmd" value="_cart" type="hidden">
<input name="upload" value="1" type="hidden">
<input name="rm" value="2" type="hidden">
<input name="charset" value="utf-8" type="hidden">
</form>
我在此论坛或 PayPal 上找不到对我正在寻找的任务的支持。我要求的可能吗?
好的,经过进一步研究和尝试新事物后,我发现了一种有效的方法。只需使用字段 "shipping_(n)" 并将值设置为“0”即可覆盖运费计算并将其标记为 $0.00。感谢大家的尝试。这是我更正的代码:
<form id="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display: none;">
<?php foreach($checkout as $key => $value): ?>
<input name="item_name_<?php echo $key + 1; ?>" value="<?php echo $value['name']; ?>" type="hidden">
<input name="amount_<?php echo $key + 1; ?>" value="<?php echo $value['amount']; ?>" type="hidden">
<input name="quantity_<?php echo $key + 1; ?>" value="<?php echo $value['quantity']; ?>" type="hidden">
<input name="item_number_<?php echo $key + 1; ?>" value="<?php echo $value['number']; ?>" type="hidden">
<?php if(strpos($value['number'], 'PROGRAMS') !== FALSE): ?>
<input name="shipping_<?php echo $key + 1; ?>" value="0" type="hidden">
<?php endif; ?>
<?php endforeach; ?>
<input name="no_shipping" value="2" type="hidden">
<input name="return" value="WEB_SITE/thank-you.html" type="hidden">
<input name="notify_url" value="WEB_SITE/process.html" type="hidden">
<input name="cancel_return" value="WEB_SITE/shopping-cart.html" type="hidden">
<input name="business" value="EMAIL" type="hidden">
<input name="currency_code" value="USD" type="hidden">
<input name="cmd" value="_cart" type="hidden">
<input name="upload" value="1" type="hidden">
<input name="rm" value="2" type="hidden">
<input name="charset" value="utf-8" type="hidden">
</form>
我目前正在使用 PayPal 表格从网站结帐。在可运送物品上,一切正常。我 运行 关注的问题是该网站还提供不可交付的服务(可下载内容、在线流媒体视频)。购买成功后,我正在从 PayPal 检索正确的回复,前提是他们支付了为不可运送服务计算的运费。这是我的代码的摘录:
<form id="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display: none;">
<?php foreach($checkout as $key => $value): ?>
<input name="item_name_<?php echo $key + 1; ?>" value="<?php echo $value['name']; ?>" type="hidden">
<input name="amount_<?php echo $key + 1; ?>" value="<?php echo $value['amount']; ?>" type="hidden">
<input name="quantity_<?php echo $key + 1; ?>" value="<?php echo $value['quantity']; ?>" type="hidden">
<input name="item_number_<?php echo $key + 1; ?>" value="<?php echo $value['number']; ?>" type="hidden">
<?php endforeach; ?>
<input name="no_shipping" value="2" type="hidden">
<input name="return" value="WEB_SITE/thank-you.html" type="hidden">
<input name="notify_url" value="WEB_SITE/process.html" type="hidden">
<input name="cancel_return" value="WEB_SITE/shopping-cart.html" type="hidden">
<input name="business" value="EMAIL" type="hidden">
<input name="currency_code" value="USD" type="hidden">
<input name="cmd" value="_cart" type="hidden">
<input name="upload" value="1" type="hidden">
<input name="rm" value="2" type="hidden">
<input name="charset" value="utf-8" type="hidden">
</form>
我在此论坛或 PayPal 上找不到对我正在寻找的任务的支持。我要求的可能吗?
好的,经过进一步研究和尝试新事物后,我发现了一种有效的方法。只需使用字段 "shipping_(n)" 并将值设置为“0”即可覆盖运费计算并将其标记为 $0.00。感谢大家的尝试。这是我更正的代码:
<form id="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display: none;">
<?php foreach($checkout as $key => $value): ?>
<input name="item_name_<?php echo $key + 1; ?>" value="<?php echo $value['name']; ?>" type="hidden">
<input name="amount_<?php echo $key + 1; ?>" value="<?php echo $value['amount']; ?>" type="hidden">
<input name="quantity_<?php echo $key + 1; ?>" value="<?php echo $value['quantity']; ?>" type="hidden">
<input name="item_number_<?php echo $key + 1; ?>" value="<?php echo $value['number']; ?>" type="hidden">
<?php if(strpos($value['number'], 'PROGRAMS') !== FALSE): ?>
<input name="shipping_<?php echo $key + 1; ?>" value="0" type="hidden">
<?php endif; ?>
<?php endforeach; ?>
<input name="no_shipping" value="2" type="hidden">
<input name="return" value="WEB_SITE/thank-you.html" type="hidden">
<input name="notify_url" value="WEB_SITE/process.html" type="hidden">
<input name="cancel_return" value="WEB_SITE/shopping-cart.html" type="hidden">
<input name="business" value="EMAIL" type="hidden">
<input name="currency_code" value="USD" type="hidden">
<input name="cmd" value="_cart" type="hidden">
<input name="upload" value="1" type="hidden">
<input name="rm" value="2" type="hidden">
<input name="charset" value="utf-8" type="hidden">
</form>