将商品总计添加到PayPal的订单摘要中,以实现全部购物车总付款 [英] Adding item total to PayPal's order summary, for full aggregate cart payment

查看:60
本文介绍了将商品总计添加到PayPal的订单摘要中,以实现全部购物车总付款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经拥有了自己的购物车并已完成所有设置,我只需要为我的网站用户提供一个立即付款"按钮,我只打算将整个购物车的总金额发送至payPal,仅此而已整合必要.因此,我网站上的客户已经检查了他们的订单,检查的数量和单个项目的运输费用等,现在只需要给PayPal提供他们将确认并支付的总金额即可.

I've got my own shopping cart and everything set up, I just need a "Pay Now" button for my website users, and I just intend to send the entire cart's total amount up to payPal, that's it, no other integration necessary. So the customers on my website have already reviewed their order, checked quantities and shipping charges etc for individual items, and now PayPal just needs to be given the total amount which they will confirm and pay.

我的立即付款"按钮的代码如下($overall_total已经在我的php代码中的上方计算出):

My code for the "Pay Now" button is below ($overall_total has already been calculated somewhere above in my php code):

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   <input type="hidden" name="cmd" value="_s-xclick">
   <input type="hidden" name="hosted_button_id" value="JRECLRTYAJDKY">
   <input type="hidden" name="amount" value="<?php echo $overall_total;?>">
   <input type="hidden" name="item_total" value="<?php echo $overall_total;?>">
   <input type="hidden" name="item_name" value="Your Shopping order">
   <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.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>

用户点击立即付款"时会提交此表单,然后进入下一页.但是,即使我包含了amountitem_total变量,下一页的item_total也为0.00.另外,我不希望显示任何QuantityItem price,因为我只是为客户实施了汇总购物车付款,并且他们已经在付款前查看了每件商品的费用.这是我得到的:

The user submits this form when they hit "Pay Now", and they come to next page. But Even though I included the amount and item_total variables, the next page gives me an item_total of 0.00. Also, I don't want any Quantity or Item price to show since I am simply implementing an aggregate cart payment for customers, and they have already reviewed per item charges before coming to the payment. This is what I get:

如何摆脱QuantityItem price,并在贝宝摘要的总价内包含我计算出的$overall_total值?

How can I get rid of Quantity and Item price, and have the $overall_total value that I calculated inside the total price on the PayPal summary?

推荐答案

没有item_total或没有总数,因为每个按钮一次处理一个项目

there is no item_total or any total, since every single button handles ONE item at once

$overall_total必须为英文格式,并带有.".作为小数点分隔符

$overall_total must be in the english format with "." as decimals separator

问题可能是cmd参数.代替使用:

problem may be the cmd parameter.. use instead:

<input type="hidden" name="cmd" value="_xclick">

还需要指定:

<input type="hidden" name="business" value="yourBusiness@yourBusiness.tld">


查看此示例以获得更完整的示例:


look at this for a more complete example:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="yourBusiness@yourBusiness.tld">

    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="amount" value="10.10">
    <input type="hidden" name="currency_code" value="USD">

    <input type="hidden" name="item_name" value="Item bought desc">

    <input type="hidden" name="button_subtype" value="services">
    <input type="hidden" name="no_note" value="0">

    <input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynow_SM.gif:NonHostedGuest">
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.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>

还可以看看:

  • the documentation of cart parameters: HTML Form Basics for PayPal Payments Standard
  • the cart button builder: Create a PayPal payment button

关于数量"问题,遗憾的是您无法隐藏它...如果这对您来说是重要的问题,您可以尝试使用可自定义且执行起来并不难的ExpressCheckout(使用php)

about the "quantity" issue, sadly you can't hide it... if this is an important issue for you, you could try instead the ExpressCheckout (using php) which is very customizable and not that difficult to implement

希望能有所帮助

这篇关于将商品总计添加到PayPal的订单摘要中,以实现全部购物车总付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆