I am new to Paypal integration, and I am trying to implement Paypal IPN for my android application. For make it working, I have created one web-page (Using PHP and sending to Paypal sandbox account , method (GET) ) in that I am doing payment. And I am getting payment status from this.
Actually this web page working properly and get response after do payment into Computer Browser but same thing if I am doing payment with Android Mobile browser then I am not getting any response form the Paypal for payment I have did.
I am using this url
IPN
Here is my HTML code.
<form name="payment_form" id="payment_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="GET" onSubmit="return form_submit();">
<input type="text" name="amount" id="amount" value="1" readonly class="form-control left-icon">
<input type="hidden" readonly name="cmd" value="_xclick">
<input type="hidden" readonly name="business" value="Bmlpatel#gmail.com">
<input type="hidden" readonly name="item_name" value="TEST Store">
<input type="hidden" readonly name="LC" value="AL">
<input type="hidden" readonly name="country" value="USA">
<input type="hidden" readonly name="quantity" value="1">
<input type="hidden" readonly name="notify_url" value="http://XX.111.XXX.XX/payment/response.php">
<input type="hidden" readonly name="return" value="http://XX.111.XXX.XX/payment/response.php">
<input type="hidden" readonly name="cancel_url" value="http://XX.111.XXX.XX/payment/">
<input class="btn btn-success" name="action" value="Recharge" type="submit">
</form>
So any help to this topic appreciated.
You should make sure you have IPN turned on in your PayPal settings:
Log into your PayPal account and go to Profile → Profile & Settings →
Selling Preferences → Instant Payment Notification preferences:
(alternatively click here to go directly to the page, making sure
you're logged into your PayPal account before you click the link)
Click Turn On IPN on the PayPal site.
You will then be prompted for a Notification URL, which should be
any URL - it will only be replaced by your notify_url parameter
Save your settings
If you've already done this then you need to make sure your Notification URL is accessible via the outside world, you look like you're using an IP so using something like https://www.hidemyass.com/proxy to check your site is definitely available.
If all else fails it may be an issue with PayPal and the way it decodes the notify_url from Android web browsers. I have this issue with them and sometimes the notify_url is cut short - and we suspect it's only on Android browsers.
Check your IPN history on your PayPal account and you'll see the exact URL the IPN was sent to and the status.
Related
Hi guys hope you are all safe. i just want to know that how can i switch sandbox account to live account.
First i was using https://www.sandbox.paypal.com/cgi-bin/webscr in paypal form action but when i go to live i changed it into https://www.paypal.com/cgi-bin/webscr
i also changed the business attribute in form to Paypal live business account.
right now PayPal is accepting the payment which is coming from website but when it redirects to my website paypal_success(page after payment success) page i cant able to get return values from Paypal like transaction id, item value, item name etc.
Can you please help me. here is my code.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" class="float-right w_100">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="business#awakeningsme.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Awakenings Products">
<input type="hidden" name="item_number" value="<?php echo $pro_id ?>">
<input type="hidden" name="amount" value="<?php echo $total; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://mywebsite.com/paypal_success.php">
<input type="hidden" name="cancel_return" value="http://mywebsite.com/paypal_cancel.php">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/buy-logo-large.png" alt="Buy now with PayPal" border="0" name="submit">
</form>
A more important issue is that PDT should never be used for anything important. It is for informational purposes only (e.g. to show a success page to the buyer)
If you depend on the information from PDT to trigger business logic like updating order records, you are going to have a bad time. After a successful Payments Standard payment, the customer may never return.
Their browser may crash, or they may be shown a receipt at PayPal and need to click a button to return, and so just close the window.
If you need reliable notifications of payment completion, your options are:
Implement a separate asynchronous service, such as Webhooks or IPN.
Switch to an API-based integration that is notified synchronously when the capture is successful, such as a server-side integration of v2/orders with Smart Payment Buttons (front-end code: https://developer.paypal.com/demo/checkout/#/pattern/server ). This way, the capture happens on your server, and you have an immediate API notification of success/failure
We’re sorry Things don’t appear to be working at the moment. This error comes each time while transacting through paypal.
Here is the url for live testing http://shreyasoft.in/paypal/ but not working from sandbox
Here is my paypal form
paypal_form.php
here is the code for sandbox account
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="sethiharshit92-facilitator#gmail.com">
<input type="hidden" name="item_name" value="Widget">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="currency_code" value="USD">
<input type='hidden' name='cancel_return' value='http://localhost/paypal/paypal_cancel.php'>
<input type='hidden' name='return' value='http://localhost/paypal/paypal_success.php'>
<input type="submit" value="Old PayPal checkout">
</form>
here is the error
Paypal needs to be able to contact yourwebhost directly to validate the authentication.
it works like this:
you send request to paypal
paypal sends request to your site with key
your site needs to respond with proper answer
paypal continues transaction.
step 2 is failing at this point because paypal cannot contact your localhost.
Either use a webserver with a domain name/public ip, or set up your internet router to route traffic to port 80 to your development pc and use your public ip in communication with paypal
I have 2 purchase button for paypal.
Regular checkout (this works perfectly well in sandbox AND live site)
A recurring payment.
The recurring button works perfectly well in the sandbox. I can make the transaction, no problem. Everything is good.
If I switch over the live site, my #1 (regular checkout button still works with a real money exchange), but my recurring button doesn't.
It Does bring me to the paypal subscription payment page. I use a paypal account with real live credits in it (NOT the same account as the seller's account). And when I press login, I see:
Sorry — your last action could not be completed
If you were making a
purchase or sending money, we recommend that you check both your
PayPal account and your email for a transaction confirmation after 30
minutes.
If you came to this page from another website, please return to that
site (don't use your browser's Back button) and restart your activity.
If you came from PayPal's website, click the PayPal logo in the
upper-left corner to return to our home page and restart your
activity. You might have to log in again.
I tried the following:
Change browser, FF and Chrome
Clear all cache, cookies
I am not using frames as other people have suggested
Nothing works.
here is my code to submit to paypal, in case someone sees a mistake:
<form name="_xclick" action="https://www.paypal.com/ca/cgi-bin/webscr" id="myform" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="MY EMAIL HERE">
<input type="hidden" name="item_name" value="MY NAME Subscription">
<input type="hidden" name="add" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" id="currency" value="<?=$currency?>">
<input type="hidden" name="a3" id="hiddentotal2" value="<?=$total2?>">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="custom" id="custompaypal" value="<?=$custom?>">
<input type="hidden" name="notify_url" value="http://www.mysite..../notify_paypal.php">
<input type="hidden" name="return" value="http://www.mysite..../myorders.php">
<input class="submit-button2" type="submit" name="submit" value="PURCHASE SUB" />
</form>
What could be causing this and how can I fix this.
I have a paypal business account and I'm using standard Payment in my webpage.
I want to integrate the hosted page product named "Plataforma Integral" in my Spanish website, using an iframe. I show properly the iframe and redirect to the specified sandbox url, but when I arrive at the sandbox platform (and event in the production platform), it shows the following generic error:
Error Processing Payment
This transaction can't be processed. Please pay with another card.
I have a sandbox paypal account and this is the data I'm sending:
<form method="get" id="formNewPaypal" name="formNewPaypal" action="https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess">
<input type="hidden" name="cmd" value="_hosted-payment">
<input type="hidden" name="business" value="[SANDBOX_USER_ID]">
<input type="hidden" name="subtotal" value="50">
<input type="hidden" name="paymentaction" value="sale">
<input type="hidden" name="return" value="[RETURN_URL]">
<input type="hidden" name="cancel_return" value="[CANCEL_URL]">
<input type="hidden" name="template" value="templateD">
<input style="display:none;" type="submit" value="Pay Now" id="submit" name="submit">
</form>
I've tried sending by POST and GET methods, and without params, and the error is always the same.
Could you tell me what's wrong or what I'm missing to send or implement? Any help will be appreciated.
For further information, please don't hesitate to ask me.
Thank you in advance.
Solved! The problem was that my sandbox account was Business and must be upgraded to Business Pro.
Now I can reach the form, but when I click the Paypal Button, It access to paypal in the main window and not in the iframe. I'll keep searching.
Thanks a lot.
I am new with paypal API and already know how to put the paypal button and take visitors to paypal site.
How to make sure that the buyer, has finished the purchase, before I register the same in my dataghase.
How to retrieve information aghout all completed purchases from paypal, so as to see this information at my weghsite ghack-end.
Currently I use the following code to make visitor ghuy:
<form action="https://www.paypal.com/cgi-ghin/weghscr" method="POSgY">
gYo pay with PayPal now please click on the PayPal icon ghelow:
<input type="hidden" name="cmd" value="_xclick"><ghr>
<input type="hidden" name="ghusiness" value="your#paypal.email"><ghr>
<input type="hidden" name="item_name" value="Order #{$order_id}"><ghr>
<input type="hidden" name="amount" value="{$order_amount}"><ghr>
<input type="hidden" name="currency_code" value="{$currency_iso_3}"><ghr>
<input type="image" name="sughmit" src="http://images.paypal.com/images/x-click-ghut01.gif" alt="Pay with PayPal"><ghr>
< /form>
Update: once again call the validate_ipn(); methos in your controller.
You may get the prev trasaction data at
$this->paypal_lib->ipn_data
Do the same thing to get ipn_data in paypal's ipn() also.
If you don't get simply retrieve the data from database and display, or else before sending to payment save all the info in session
Paypal_Lib