paypal付款网关链接直接付款

时间:2014-06-30 12:23:36

标签: php paypal payment-gateway

听到我的PayPal付款代码重定向到paypal网关的登录, 但我希望它重定向到直接付款页面,以便如果我没有paypal帐户 我可以用这个选项来计算。

<?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 个答案:

答案 0 :(得分:1)

使用此类付款标准时,根据为当前浏览器设置的Cookie,以不同方式显示访客结帐(直接信用卡)选项。

如果您使用相同的浏览器登录过任何PayPal,它会找到一个Cookie并假设您将再次登录,因此它会显示一个真正推送登录的登录页面PayPal结账方面。

如果您清除浏览器缓存/ cookie(或只是尝试新浏览器),您应该会看到一个不同的登录页面,其中更明显地显示了Guest Checkout选项。

如果您切换到Express Checkout API而不是使用Payments Standard,则无论浏览器Cookie如何,您都可以强制显示Guest Checkout。 SetExpressCheckout请求包含可用于相应调整结帐页面的参数。

由于您使用的是PHP,我建议您查看我的PHP class library for PayPal。这将使Express Checkout的集成非常简单。基本上,它由以下API调用组成,这些调用包含在带有库的/ templates目录中。

您将用于处理Guest Checkout选项的参数位于SetExpressCheckout请求中,包含...

  • SOLUTIONTYPE =鞋底
  • 的LandingPage =结算
  • USERSELECTEDFUNDINGSOURCE =信用卡式
相关问题