PayPal IPN - Changing from Sandbox to Live stops working - php

I am using the PayPal IPN System which works perfectly in sandbox mode. All the payments went through successfully and my site updated as required. So, being ready to go live, I change my sandbox links to live links:
$action = 'https://www.paypal.com/cgi-bin/webscr';
But now, whenever the payment form is posted to this address, it ends up at
https://www.paypal.com/webapps/hermes?token=...
which just shows a blank page. No error_log is created on my server.
Here is my form data before the link to PayPal is clicked.
<form name="frm_payment_method" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="business" value="payments#domain.com">
<input type="hidden" name="notify_url" value="http://domain.com/ipn.php">
<input type="hidden" name="cancel_return" value="http://domain.com/cancelled.php">
<input type="hidden" name="return" value="http://domain.com/success.php">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="lc" value="">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="page_style" value="paypal">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="item_name" value="1 Credit">
<input type="hidden" value="_xclick" name="cmd">
<input type="hidden" name="amount" value="1.50">
<p><button type="submit" name="submit" class="btn btn-primary">Proceed to PayPal</button>
Cancel</p></form>
Of course, replacing domain.com with my own correct domains.

Related

How to change currency in PayPal for 3rd-party shopping cart checkout?

I am using this PayPal payment method in my project and I facing one issue in currency.
I have followed this link steps(https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside#methodone) and integrated PayPal, all things working fine but the currency showing wrong on the checkout page but when going to the next page it is showing properly.
I want to change the currency text from USD to EUR on the checkout page. how it is possible.
Can any help with it?
here is code
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="frmTransaction" id="frmTransaction">
<input type="hidden" name="business" value="Email">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="shipping" value="0"/>
<input type="hidden" name="item_number" value="">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="notify_url" value="">
</form>
1, Add EUR currency to your Paypal account using this link
like this screenshot
OR
Go to > Account Settings > BUSINESS PROFILE > Money, banks and cards > Currency management
2, Remove these two elements from your form
<input type="hidden" name="rm" value="2">
<input type="hidden" name="upload" value="1">
your final form code like below
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="frmTransaction" id="frmTransaction">
<input type="hidden" name="business" value="web91.siddharth#gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="shipping" value="1"/>
<input type="hidden" name="item_number" value="">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="notify_url" value="">
<input type="submit" value="Pay Now">
</form>

PayPal html button for digital goods

I'm having a problem with a PayPal button that I made. Yesterday I got my first sale of a digital good on my website, everything worked well except at the end when PayPal blocked the payment.
I called them to know why and they explained me that it was because the order was made for physical products and the shipping information was missing.
They unblocked the payment but I can't find how to set that the payment is for digital goods.
My code below:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="my email">
<input type="hidden" name="lc" value="IT">
<input type="hidden" name="item_name" value="product">
<input type="hidden" name="amount" value="00.00">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="mysite">
<input type="hidden" name="cancel_return" value="mysite">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_SM.gif:NonHosted">
<input type="hidden" name="custom" value="userid" />
<input type="hidden" name="notify_url" value="IPN ">
<input type="image" src="img/paypal1.png" style="width: 100%; height: 100%;" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>
Your code is correct to not collect shipping for a digital good, no_shipping=1. Ref: https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/#paypal-checkout-page-variables
Perhaps you were misinformed as to why the payment was on hold.
One thing you can do is to ensure the item name makes clear that it is something digital.

Paypal IPN response on specific port

I'm integrating Paypal with CakePHP 3.x. but I'm facing problem to get IPN response from PayPal. my site is running on port number 4902.
My form is
<form method="post" accept-charset="utf-8" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<div style="display:none;">
<input type="hidden" name="_method" value="POST">
</div>
<input type="hidden" name="business" value="mypaypalemail#domain.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Test Item">
<input type="hidden" name="amount" value="18">
<input type="hidden" name="cpp_header_image" value="http://example.com/images/logo.jpg">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="shipping" value="4.99">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="quantity" id="quantity" value="1">
<input type="hidden" name="handling" value="0">
<input type="hidden" name="custom" value="21">
<input type="hidden" name="cancel_return" value="http://example.com:4902/payments/cancel">
<input type="hidden" name="notify_url" value="http://example.com:4902/payments/ipn">
<input type="hidden" name="return" value="http://example:4902/payments/success">
<div class="submit">
<input type="submit" class="button greenbtn" value="Pay Now">
</div>
</form>
It is working fine if I run this code without any port number. but if I use port number then I get success and cancel response from PayPal but not get IPN response, I had tried with Paypal IPN Simulator, it says me that We're sorry, URL with port number is not allowed for IPN.
And I can't use any other port. can anyone help me please to resolve this issue?
---Edited-----
Like PayPal IPN on a port other than 80 I am not using Nginx server
Thanks.

paypal do not return txn_id in mobile site

I have using paypal in my desktop website and it worked. Below is my code:
<?php
......
echo '<form name="form1" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"><div>
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="charset" value="UTF-8">
<input type="hidden" name="cancel_return" value="'.$host.'/my-order-history">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="'.$host.'/payment-done?nid='.$node->nid.'&order='.date("YmdHis",$time).'">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="currency_code" value="HKD">
<input type="hidden" name="handling_cart" value="0.00">
<input type="hidden" name="invoice" value="'.date("YmdHis",$time).'">
<input type="hidden" name="tax_cart" value="0.00">
<input type="hidden" name="business" value="'.$paypal.'">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="amount" value="'.$total_amount.'">
<input type="hidden" name="item_name" value="'.$company_name."-".date("YmdHis",$time).'">
<input id="go_pay" type="submit" name="next" value="confirm" />
</form>';
......
?>
and in payment-done page, I can get the txn_id with $_POST["txn_id"]. But When I use above code in my mobile website, I can pay with paypal by I can't get the txn_id in payment-done page. What can I do to change the code to work in mobile site?
Thank you.
Paypal says the txn_id value is:
The merchant's original transaction identification number for the payment from the buyer, against which the case was registered.
So this seems to imply that if you are not getting a txn_id value back from your transaction, then you're not supplying one to Paypal to use. So this means that you're loosing some data placement in your display flow for transitioning between desktop and mobile display of your website.

Paypal dynamic return url not working

I am trying to make a paypal payment and I have a problem when returning to my page after the payment is completed.
I want to do it dynamically (so I do not want to set it in the paypal's account option, as I may use this account for other things). This is the form I send to paypal:
<form id="paypalForm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="notify_url" value="http://zopomobile.es/pruebas/modules/rmaforsat/ipn_paypal.php">
<input type="hidden" name="item_name_1" value="Pago de su orden a Zopomobile.">
<input type="hidden" name="item_number_1" value="1">
<input type="hidden" name="amount_1" value="259.12">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="custom" value="152">
<input type="hidden" name="business" value="admin-facilitator#zopomovil.es">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="return" value="http://zopomobile.es/pruebas">
<input type="hidden" name="cancel" value="http://zopomobile.es/pruebas/NO">
<input type="hidden" name="rm" value="2">
</form>
I have tried changing the "return" variable to "return_url", still not working.
If you want to automatically re-direct to "http://www.zopomobile.es/pruebas/"
then you need to turn on "Auto Return" on your PayPal profile.
Right now, Auto Return is "OFF" in your profile.
The return parameter is return
https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_profile-website-payments
Check above link to turn on the "Auto Return" feature.

Categories