drbi19093 2014-06-30 12:23
浏览 58
已采纳

paypal付款网关链接直接付款

hear is my code for paypal payment it redirects to login of paypal gateway, but i want it redirect to direct payment page so that if i haven't paypal account i can countinue with that option.

<?php
    $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
    $paypal_id = 'gohilpriyank-facilitator@ymail.com';
    ?>
    <div class="form-group row-fluid">
        <div class="span6">
            <span style="font-weight: bold">Ship To Address:-</span>
            <div><?php echo $ship_to['ship_address']; ?></div>
            <div><?php echo $ship_to['ship_landmark']; ?></div>
            <div><?php echo $ship_to['ship_city']; ?></div>
            <div><?php echo $ship_to['ship_state']; ?></div>
            <div><?php echo $ship_to['ship_pincode']; ?></div>
        </div>
        <div class="span6">
            <span style="font-weight: bold">Choose Payment Mode</span>
            <form action="<?php echo $paypal_url; ?>" method="post" name="frmPayPal1">
                <input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
                <input type="hidden" name="cmd" value="_xclick">
                <input type="hidden" name="item_name" value="Kevalam Payment">
                <input type="hidden" name="item_number" value="<?php echo count($this->cart->contents()); ?>">
                <input type="hidden" name="credits" value="510">
                <input type="hidden" name="userid" value="1">
                <input type="hidden" name="amount" value="<?php echo $_SESSION['grand_total']; ?>">
                <input type="hidden" name="cpp_header_image" value="http://k1-pc/myriad/assets/user_temp/image/logo.png">
                <input type="hidden" name="no_shipping" value="1">
                <input type="hidden" name="currency_code" value="USD">
                <input type="hidden" name="handling" value="0">
                <input type="hidden" name="cancel_return" value="http://k1-pc/myriad/cancel.php">
                <input type="hidden" name="return" value="http://k1-pc/myriad/success.php">

                <input type="image" src="https://paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit">
            </form> 
        </div>
    </div><div class="clear"></div>
  • 写回答

1条回答 默认 最新

  • dongzenglin8292 2014-07-01 06:57
    关注

    When using Payments Standard like this the Guest Checkout (direct credit card) option is displayed differently based on the cookies set for the current browser.

    If you've ever signed in to any PayPal with the same browser it will find a cookie and assume that you'll be signing in again, so it will show you a landing page that really pushes the login aspect of PayPal checkout.

    If you clear your browser cache/cookies (or just try a fresh browser) you should see a different landing page where the Guest Checkout option is more prominently displayed.

    If you switch to the Express Checkout API instead of using Payments Standard you can force Guest Checkout to be displayed more prominently regardless of browser cookies. The SetExpressCheckout request includes parameters you can use to adjust the checkout pages accordingly.

    Since you're using PHP, I'd recommend taking a look at my PHP class library for PayPal. It would make integrating Express Checkout very simple for you. Basically, it consists of the following API calls, which are included in the /templates directory with the library.

    The parameters you'll use to handle the Guest Checkout options are in the SetExpressCheckout request and consist of...

    • SOLUTIONTYPE=Sole
    • LANDINGPAGE=Billing
    • USERSELECTEDFUNDINGSOURCE=CreditCard
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 哪个tomcat中startup一直一闪而过 找不出问题
  • ¥15 这个怎么改成直流激励源给加热电阻提供5a电流呀
  • ¥50 求解vmware的网络模式问题 别拿AI回答
  • ¥24 EFS加密后,在同一台电脑解密出错,证书界面找不到对应指纹的证书,未备份证书,求在原电脑解密的方法,可行即采纳
  • ¥15 springboot 3.0 实现Security 6.x版本集成
  • ¥15 PHP-8.1 镜像无法用dockerfile里的CMD命令启动 只能进入容器启动,如何解决?(操作系统-ubuntu)
  • ¥30 请帮我解决一下下面六个代码
  • ¥15 关于资源监视工具的e-care有知道的嘛
  • ¥35 MIMO天线稀疏阵列排布问题
  • ¥60 用visual studio编写程序,利用间接平差求解水准网