Business Account Not Giving Credit Card Option

Discussion in 'PayPal' started by Asimsidd, Jan 8, 2014.

  1. #1
    Well I have a website for which I have a Paypal business account (registered in UK). The paypal is integrated with my website and is working just fine. When user clicks on the "Proceed To Pay" the user is taken to Paypal's website (screenshot below). Now the only problem I have with this procedure is the fact that customers HAVE to make a Paypal account first in order to pay me. I am baffled with all the options Paypal is offering (standard, pro, merchant, what not) and I am not sure what is it exactly that I am doing wrong.

    [​IMG]

    Please advice and explain if I need to change something in my code to let the customer pay using their Credit Card directly(on Paypal's website) rather than asking them to open Paypal account first.

    The HTML form that is on my confirmorder page is as follow.
    <form class="paypal" action="payments.php" method="post" id="paypal_form" target="_parent">
        <input type="hidden" name="cmd" value="_xclick" />
        <input type="hidden" name="no_note" value="1" />
        <input type="hidden" name="lc" value="US" />
        <input type="hidden" name="currency_code" value="USD" />
        <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest" />
        <input type="hidden" name="amount" value="<?php echo $productunit_price * 1.05;?>"  />
        <input type="hidden" name="quantity" value="<?php echo $product_quantity;?>"  />
        <input type="hidden" name="first_name" value="<?php echo $customer_first_name;?>"  />
        <input type="hidden" name="last_name" value="<?php echo $customer_last_name;?>"  />
        <input type="hidden" name="notify_url" value="http://mywebsite.com/payments.php"  />
        <input type="hidden" name="payer_email" value="<?php echo $customer_email;?>"  />
        <input type="hidden" name="item_name" value="<?php echo $service_name;?> (<?php echo $product_name;?>)" / >
        <input type="hidden" name="custom" value="<?php echo $orderalias.",".$_SESSION["user_id"];?>" / >
        <input type="image"  value="Submit Payment" src="imgs/proceed_btn.jpg"/>
    </form>
    HTML:
    The php code in payments.php is as follows:

    <?php
    // PayPal settings
    $paypal_email = 'mypaypalid';
    $return_url = 'http://mywebsite.com/thankyou.php?payment=1';
    $cancel_url = 'http://mywebsite.com/orders.php';
    $notify_url = 'http://mywebsite.com/payments.php';
    
    if (!isset($_POST["txn_id"]) && !isset($_POST["txn_type"])){
        // Firstly Append paypal account to querystring
        $querystring .= "?business=".urlencode($paypal_email)."&"; 
        //loop for posted values and append to querystring
        foreach($_POST as $key => $value){
            $value = urlencode(stripslashes($value));
            $querystring .= "$key=$value&";
        }
        // Append paypal return addresses
        $querystring .= "return=".urlencode(stripslashes($return_url))."&";
        $querystring .= "cancel_return=".urlencode(stripslashes($cancel_url))."&";
        $querystring .= "notify_url=".urlencode($notify_url);  
        // Redirect to paypal IPN
        header('location:https://www.paypal.com/cgi-bin/webscr'.$querystring);
        exit();
    }else{
    
        // read the post from PayPal system and add 'cmd'
        $req = 'cmd=_notify-validate';
        foreach ($_POST as $key => $value) {
            $value = urlencode(stripslashes($value));
            $value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i','${1}%0D%0A${3}',$value);// IPN fix
            $req .= "&$key=$value";
        }
    
        // assign posted variables to local variables
        $data['item_name']          = $_POST['item_name'];
        $data['item_number']        = $_POST['item_number'];
        $data['payment_status']     = $_POST['payment_status'];
    
        $data['payment_amount']     = $_POST['mc_gross'] * 0.95;
        $data['payment_currency']   = $_POST['mc_currency'];
        $data['txn_id']             = $_POST['txn_id'];
        $data['receiver_email']     = $_POST['receiver_email'];
        $data['payer_email']        = $_POST['payer_email'];
    
        $data['custom']             = $_POST['custom'];
        $separatedata = explode(",",$data["custom"]);
        $orderalias = $separatedata[0];
        $user = $separatedata[1];
    
        if($data['payment_status']=="Completed" ){ 
            // do my stuff here        
        }else{
            // do my stuff here
        }      
    }
    ?>
    PHP:

     
    Asimsidd, Jan 8, 2014 IP
  2. sarah_23

    sarah_23 Active Member

    Messages:
    150
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    78
    Digital Goods:
    1
    #2
    This is the standard procedure and it's also in my website too. Customer need to sign up before making payment. Sign up is fast and easy. What's the deal ?
     
    sarah_23, Apr 13, 2014 IP