After transaction got successful at authorize.net SIM method it is not redirecting to my website URL. I am getting the error message
the referrer relay response or receipt link url is invalid
Here is my code of my transaction page which is submitting information. Please let me know my mistake in it.
<!-- Create the HTML form containing necessary SIM post values -->
<form method="post" id="finalform" action="<?php echo $url; ?>" >
<!-- Additional fields can be added here as outlined in the SIM integration guide
at: http://developer.authorize.net -->
<input type='hidden' name='x_login' value='<?php echo $loginID; ?>' />
<input type='hidden' name='x_amount' onkeyup="gethash(this.value);" value='<?php echo $amount; ?>' /><br/>
<input type='hidden' name='x_description' value='<?php echo $description; ?>' />
<input type='hidden' name='x_invoice_num' value='<?php echo $invoice; ?>' /><br/>
<input type='hidden' name='x_fp_sequence' value='<?php echo $sequence; ?>' />
<input type='hidden' name='x_fp_timestamp' value='<?php echo $timeStamp; ?>' />
<input type='hidden' name='x_fp_hash' id="fphash" value='<?php echo $fingerprint; ?>' />
<input type='hidden' name='x_test_request' value='<?php echo $testMode; ?>' />
<input type='hidden' name="x_first_name" value="<?php echo $_REQUEST['fne'];?>" />
<input type='hidden' name="x_last_name" value="<?php echo $_REQUEST['lne'];?>" />
<input type='hidden' name="x_company" value="<?php echo $_REQUEST['orgme'];?>" />
<input type='hidden' name="x_address" value="<?php echo $_REQUEST['adds'];?>" />
<input type='hidden' name="x_city" value="<?php echo $_REQUEST['cty'];?>" />
<input type='hidden' name="x_state" value="<?php echo $_REQUEST['ste'];?>" />
<input type='hidden' name="x_zip" value="<?php echo $_REQUEST['zip'];?>" />
<input type='hidden' name="x_cust_id" value="<?php echo $_REQUEST['cusd'];?>" />
<input type="hidden" name="x_receipt_link_method" value="LINK" >
<input type="hidden" name="x_receipt_link_url" value="http://www.uthstuph.com/payment-success/" >
<input type="hidden" name="x_relay_response" value="TRUE" >
<input type="hidden" name="x_relay_url" value="http://www.uthstuph.com/payment-success" >
<input type="hidden" name="x_phone" value="<?php echo $_REQUEST['phone'];?>"/>
<input type="hidden" name="x_email" value="<?php echo $_REQUEST['email'];?>"/>
<input type="hidden" name="x_billing_zip" value="<?php echo $_REQUEST['x_billing_zip'];?>"/>
<input type="hidden" value="<?php echo $_REQUEST['cno'];?>" autocomplete="off" maxlength="16" name="x_card_num" id="x_card_num" class="input_text"><br/>
<input type="hidden" value="<?php echo $_REQUEST['cexp'];?>" autocomplete="off" maxlength="20" name="x_exp_date" id="x_exp_date" class="input_text">
<input type="hidden" name="x_card_code" value="<?php echo $_REQUEST['ccode'];?>"/>
</form>
<script type="text/javascript">
document.getElementById("finalform").submit();
</script>
IN ACCOUNT SETTING I set
Default Receipt URL : http://www.uthstuph.com/payment-success/
Default Relay Response URL : http://www.uthstuph.com/payment-success/
I have tried both http as well as https.
Thanks in advance.
From the Authorize.net support page:
Error 14 may also occur if you try to submit x_receipt_link_url and
x_relay_url simultaneously, instead of choosing a receipt method.
Remove one of them and they should work. Also, from your Authorize.net account try the following:
To add a valid Response/Receipt URL:
Log into the Merchant Interface at https://account.authorize.net.
Click Account from the main toolbar.
Click Response/Receipt URLs under
Transaction Format Settings.
Click Add URL.
Enter your Response URL.
Click Submit
Related
When I save this form all type="text" fields are working fine. But hidden field values are not passing.
If I changed from "hidden" to "text" it works fine. I don't know why I am getting this problem.
<form action="../model/meter-reading-model" method="POST">
<input type='hidden' name='hdnTakenDate' id='hdnTakenDate' value='<?php echo $TakenDate; ?>' />
<input type='hidden' name='hdnSiteHeadDbKey' id='hdnSiteHeadDbKey' value='<?php echo $SiteHeadDbKey; ?>' />
<button type='submit' name="btnSaveData" id="btnSaveData" class='btn btn-lg btn-danger'> Save Reading Data </button>
</form>
Receiving in another page
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset($SaveData)){
$TakenDate = mysqli_real_escape_string($conn, $_POST['hdnTakenDate']);
$SiteHeadDbKey = mysqli_real_escape_string($conn, $_POST['hdnSiteHeadDbKey']);
}
}
It solved for me when i change this
<input type='hidden' name='hdnTakenDate' id='hdnTakenDate' value='<?php echo $TakenDate; ?>' />
<input type='hidden' name='hdnSiteHeadDbKey' id='hdnSiteHeadDbKey' value='<?php echo $SiteHeadDbKey; ?>' />
to this
<input type='hidden' name='hdnTakenDate' id='hdnTakenDate' value='<?php echo $TakenDate; ?>' **/>**
<input type='hidden' name='hdnSiteHeadDbKey' id='hdnSiteHeadDbKey' value='<?php echo $SiteHeadDbKey; ?>' **/>**
This is my first time integrating the Paypal Payment in a project and it is in CI. So the thing is everything is working perfectly except that the Notify Url was supposed to make me able to change the payment status from 'Pending' to 'Success' but it isn't in my case. I have the code below and i really have tried many things but still don't know where i am slipping off.
<form id="paypal-pre" action="<?php echo base_url('auth/process'); ?>" method="post">
<input type="hidden" name="user_id" value="<?php echo $_POST['register_user_id']; ?>">
<input type="hidden" name="first_name" value="<?php echo $_POST['customer_first_name']; ?>">
<input type="hidden" name="last_name" value="<?php echo $_POST['customer_last_name']; ?>">
<input type="hidden" name="addr1" value="<?php echo $_POST['customer_address1']; ?>">
<input type="hidden" name="addr2" value="<?php echo $_POST['customer_address2']; ?>">
<input type="hidden" name="city" value="<?php echo $_POST['customer_city']; ?>">
<input type="hidden" name="county" value="<?php echo $_POST['customer_county']; ?>">
<input type="hidden" name="postcode" value="<?php echo $_POST['customer_postcode']; ?>">
<input type="hidden" name="amount" value="<?php echo $_POST['payment_total']; ?>">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
Above is the billing info collection form.
function process(){
$arr['user'] = array(
'p_user_id' => $this->input->post('user_id'),
'p_billing_firstname' => $this->input->post('first_name'),
'p_billing_lastname' => $this->input->post('last_name'),
'p_billing_address1' => $this->input->post('addr1'),
'p_billing_address2' => $this->input->post('addr2'),
'p_billing_city' => $this->input->post('city'),
'p_billing_county' => $this->input->post('county'),
'p_billing_postcode' => $this->input->post('postcode'),
'p_status' => 'processing',
'p_amount' => $this->input->post('amount'),
);
$arr['pay'] = array(
'p_amount' => $this->input->post('payment_total'),
);
$this->load->model('demo_auth_model');
$this->demo_auth_model->process($arr);
$this->load->view('paypal',$arr);}
function notify() {
if($this->input->post('custom') != ''){
$id = $this->input->post('custom');
$amt = $_POST['amount'];
$sql = "UPDATE users_payments SET p_status='success' WHERE p_id='$id'";
$this->db->query($sql);
return;
}
}
The Process and notify controller function
<?php $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$paypal_id = '******#yahoo.com';
$amount = $_POST['amount'];
$id = mysql_insert_id();?>
<form id="paypal" action="<?= $paypal_url; ?>" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
<input type="hidden" name="amount" value="<?php echo $amount; ?>">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="item_name" value="<?php echo 'Business Register'; ?>">
<input type="hidden" name="custom" value="<?php echo $id; ?>" />
<input type='hidden' name='notify_url' value='<?php echo base_url('auth/notify'); ?>'>
<input type='hidden' name='cancel_return' value='<?php echo base_url('auth/cancel'); ?>'>
<input type='hidden' name='return' value='<?php echo base_url();?>'>
</form><script type="text/javascript">
document.getElementById('paypal').submit();
</script>
The main paypal form which is submitted automatically after saving the billing information.
public function process($arr) {
$this->db->set($arr['user']);
$this->db->insert('user_payments');
return;
}
Process Model from demo_auth_model
Any help would be really appreciated.
P.S. All database infos are correct
well for codeigniter i prefer this library
http://tutsnare.com/integrate-paypal-using-ci-merchant-in-codeigniter/
https://github.com/expressodev/ci-merchant
for 2 Reasons
1. Auto redirect to our website
2. Take all data in session to our website
Try it and enjoy
I'm looking to add a discount code to this Paypal button but don't know how to go about doing it.
Can anyone help or suggest how too, I just need it so a customer can enter a the code and receive 10% off the price
The code is below for the button
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>Please click on the link to pay</p>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="<?php echo C_OUR_EMAIL; ?>" />
<input type="hidden" name="first_name" value="<?php echo strfordisp($ofirstname); ?>" />
<input type="hidden" name="last_name" value="<?php echo strfordisp($olastname); ?>" />
<input type="hidden" name="address1" value="<?php echo strfordisp($theorder["oaddress"]); ?>" />
<input type="hidden" name="address2" value="<?php echo strfordisp($theorder["oaddress2"]); ?>" />
<input type="hidden" name="address3" value="<?php echo strfordisp($theorder["oaddress3"]); ?>" />
<input type="hidden" name="city" value="<?php echo strfordisp($theorder["otown"]); ?>">
<input type="hidden" name="zip" value="<?php echo strfordisp($theorder["opostcode"]); ?>" />
<?php $orderdets = mysql_query("select * from c4d_orderitems where orderid='" . $_SESSION["db_order"] . "' and confirm");
$iloop = 1;
while ($orderrow = mysql_fetch_array($orderdets))
{
$itemdesc = $orderrow["itemtypedesc"];
$itemdesc .= " to " . $orderrow["dpostcode"];
$itemprice = $orderrow["cost"] + $orderrow["surcharge"] + $orderrow["insurancecost"];
?>
<input type='hidden' name="item_name_<?php echo $iloop; ?>" value='<?php echo strfordisp($itemdesc); ?>' />
<input type='hidden' name="item_number_<?php echo $iloop; ?>" value='<?php echo $orderrow["itemtype"]; ?>' />
<input type='hidden' name="amount_<?php echo $iloop; ?>" value='<?php
// pctrends
if ((strtoupper($ofirstname)=="PCTRENDSTEST") || (strtoupper($olastname)=="PCTRENDSTEST") || (substr($_SERVER['REMOTE_ADDR'],0,11)=="82.152.55.1"))
echo("0.01");
else echo $itemprice;
?>' />
<input type='hidden' name="quantity_<?php echo $iloop; ?>" value='1' />
<?
$iloop++;
}
?>
<input type="hidden" name="return" value="<?php echo C_SITE_ROOT; ?>stage7.php" />
<input type="hidden" name="cancel-return" value="<?php echo C_SITE_ROOT; ?>order-cancel.php" />
<input type="hidden" name="notify_url" value="<?php echo C_SITE_ROOT; ?>paypal.php" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="invoice" value="<?php echo $_SESSION["db_order"]; ?>" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="no-shipping" value="1" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest" />
<input type="hidden" name="country" value="GB" />
<p class='fmenu'><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></p>
</form>
You must check for the discount-code validity (with AJAX) and make the appropriate calculations to apply the discount to the amount variable (with JavaScript) before to send the payment notification.
The user writes the discount-code insiede the custom variable where you can store whatever you want for your own tracking purposes.
// Check here on keypress with JS and AJAX for discount code validity
<input type="text" name="custom" value="" />
If the discount-code is verified, apply the discount to the amount variable. Something like this:
// Javascript and jQuery
if(verified == true) {
var discounted = $("[name='amount']").val() - ($("[name='amount']").val()/100)*10);
$("[name='amount']").val(discounted);
}
else {
alert("Discount code not found");
}
Then when you send the payment and get the information from paypal (the IPN response) process it like so:
$discountCode = $_POST["custom"];
// ... Discount-code validity check ...
$discountedAmount = $originalAmount - (($originalAmount/100)*10);
// And then check if the paid amount corresponds to the due amount
if($discountedAmount == $_POST["amount"])
I'm developing a web app in which I've to integrate a Paypal account. There are many radio buttons on the page that represents various credits and it's price and like wise. My Problem is, I want some functionality through which I can set various other fields of form on one of the radio button click. And those values are different for every radio button.
<form action='<?php echo $paypal_url; ?>' method='post' name='form'>
<div class="crea_paka_title">Creadit Pakages</div>
<?php
foreach($admin_credits as $credits){
?>
<div class="creadit_fields">
<span class="for_radio">
<input type="radio" name="1" id="<?php echo $credits['AdminCredit']['id'];?>" value="" />
</span>
<span class="for_creadit">
<?php echo $credits['AdminCredit']['tx_total_credits']; ?> Credits
</span>
<span class="for_cre_value">
$<?php echo $credits['AdminCredit']['nu_total_price']; ?>
</span>
</div>
<div style="clear:both;"></div>
<?php
}
?>
<input type='hidden' name='business' value='<?php echo $paypal_id; ?>'>
<input type='hidden' name='cmd' value='_xclick'>
<input type='hidden' name='item_name' value='<?php echo $credits['AdminCredit']['tx_total_credits'];?> Credits'>
<input type='hidden' name='item_number' value='<?php echo $credits['AdminCredit']['id'];?>'>
<input type='hidden' name='amount' value='<?php echo $credits['AdminCredit']['nu_total_price'];?>'>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='currency_code' value='USD'>
Like as above in my code I've to change the values of inputs on radio button click. Any suggestions are appreciated.
jQuery will do it:
$("#rbID").click(finction(){
$("otherRB").attr("checked",true);
});
I am trying to submit the following paypal form through a hosted-payment system. however, it does not seem to be passing through any of the variables apart from the price.
Can anyone see where I am going wrong:
<form action='https://securepayments.paypal.com/cgi-bin/acquiringweb' method='post' target='hss_iframe' id='PayPalForm' name='PayPalForm'>
<input type='hidden' name='cmd' value='_hosted-payment' />
<input type='hidden' name='charset' value='utf-8' />
<input type='hidden' name='currency_code' value='GBP' />
<input type='hidden' name='business' value='seller#email.com' />
<input type='hidden' name='paymentaction' value='sale' />
<input type='hidden' name='template' value='TemplateD' />
<input type='hidden' name='return' value='http://yoursite.com/groupon-success.php' />
<input type='hidden' name='notify_url' value='http://yoursite.com/paypal-groupon- ipn.php' />
<input type='hidden' name='item_name' value='Item name' />
<input type='hidden' name='item_number' value='4' />
<input type='hidden' name='subtotal' value='0.01' />
<input type='hidden' name='custom' value='41' />
<input type='hidden' name='address_override' value='true' />
<input type='hidden' name='first_name' value='Jack' />
<input type='hidden' name='last_name' value='Jones' />
<input type='hidden' name='address1' value='address1' />
<input type='hidden' name='city' value='Manchester' />
<input type='hidden' name='zip' value='M20 1AA' />
<input type='hidden' name='country' value='UK' />
<input type='hidden' name='billing_first_name' value='Jack' />
<input type='hidden' name='billing_last_name' value='Jones' />
<input type='hidden' name='billing_address1' value='address1' />
<input type='hidden' name='billing_city' value='Manchester' />
<input type='hidden' name='billing_zip' value='M20 1AA' />
<input type='hidden' name='billing_country' value='UK' />
</form>
it is then been passed to an iframe which seems to work fine using:
<iframe width="100%" scrolling="no" height="580px" frameborder="no" name="hss_iframe" style="float:right;"></iframe>
<script type="text/javascript">
$(function(){
$("#PayPalForm").submit();
});
</script>
Can anyone help with why this data does not seem to pass anything through
--------------- EDIT
Changed cmd to _xclick and passes through fine, so obviously an issue with _hosted-payment
Can anyone give any ideas
If by "however, it does not seem to be passing through any of the variables", you mean it doesn't display the item name / item number: that's correct. Website Payments Pro Hosted Solution doesn't currently support item details. You should remove these parameters as they're not in use for this product.
In addition, the billing/shipping address will be used, but you won't be able to modify them if you're using templateD.