【问题标题】:Integrate paypal 'Buy now' button programmatically以编程方式集成贝宝“立即购买”按钮
【发布时间】:2013-06-18 23:46:04
【问题描述】:

在我的网站中,我正在以编程方式集成 paypal 立即购买按钮。

这就是我所拥有的:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" style="margin-top: 30px;">
<!-- Specify a Buy Now button. --> 
    <input type="hidden" name="cmd" value="_xclick" />

    <!-- Identify your business so that you can collect the payments. --> 
    <input type="hidden" name="business" value="me@email.com" /> 
    <!-- Specify details about the item that buyers will purchase. --> 
    <input type="hidden" name="item_name" value="Your items." />
    <input type="hidden" name="item_number" value='@Model.OrderId' />
    <input type="hidden" name="amount" value='@Model.Total' />
    <input type="hidden" name="currency_code" value="DKK" /> 

    <!--Don't want any shipping address. -->
    <input type="hidden" name="no_shipping" value="1"/>

    <!-- Specify a URL for the payment confirmation page and a page that is displayed
         if the user cancels a transaction. Also specify a URL that PayPal can post IPN
         messages to (see explanation below). --> 
    <input type="hidden" name="return" value="http://example.com/Order/Complete/" />
    <input type="hidden" name="cancel_return" value="http://example.com/Order/Cancel/" />
    <input type="hidden" name="notify_url" value="" />

    <!-- Do not prompt customers to include a note with their payment. --> 
    <input type="hidden" name="no_note" value="1" />

    <!-- Display the payment button. -->
    <input type="image" name="submit"
        src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif"
        alt="PayPal — The safer, easier way to pay online." />
    <img src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif"
        width="1" height="1" alt="" />
</form>

现在我有几个问题,通过谷歌搜索我还没有找到任何答案,我也看到了 paypal 文档,但没有真正找到任何东西:(

  1. 当我访问贝宝网站时,它没有显示通过信用卡支付的选项。它仅显示拥有贝宝帐户的付款选项以及创建新贝宝帐户并付款的选项。如何让它显示通过信用卡支付的选项??

  2. 付款时在贝宝网站上显示我的电子邮件地址。但我想向我的客户展示我的公司名称而不是我的电子邮件。我该怎么做?

  3. 在我使用我的 paypal 帐户付款后,即使我在“return”字段中有值,它也不会自动重定向到我的页面。我还需要做其他事情吗?

【问题讨论】:

    标签: asp.net-mvc paypal paypal-sandbox


    【解决方案1】:

    允许买家使用信用卡付款的选项仅适用于经过确认和验证的 PayPal 帐户。您在上面提供的“业务”价值未与 PayPal 帐户相关联——它可能不是您正在使用的帐户,但这是我目前唯一可用的信息。

    买卖双方也有一些国家/地区限制。

    要显示企业名称,您需要将“企业”值作为与企业 PayPal 帐户相关联的确认电子邮件地址。

    仅定义“return”变量不会让买家自动返回您的网站。您需要在接收者帐户中启用自动返回。

    【讨论】:

    • 嗨..感谢您的回复。我理解了两个答案,但重定向了一个。我必须在贝宝网站中设置自动重定向链接吗?仅当我在贝宝中创建按钮但我没有使用贝宝提供的向导创建按钮时,该选项才可用。我将所有参数手动放入我的代码中。你明白我的意思了吗?还是我不理解流程?
    猜你喜欢
    • 2017-08-15
    • 2013-03-25
    • 2013-04-29
    • 2011-07-17
    • 2017-12-21
    • 2016-11-21
    • 1970-01-01
    • 1970-01-01
    • 2012-04-07
    相关资源
    最近更新 更多