does not work recurring paypal sandbox - php

my php code generates html form which is submitting automatically with redirection of customers:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" name="vm_paypal_form" id="vmPaymentForm" accept-charset="UTF-8">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="bolpav#example.com" />
<input type="hidden" name="custom" value="otmjboutim6sl98u6olis61nm7" /
><input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="http://example.com/devportal/index.php?option=com_virtuemart&view=vmplg&task=pluginresponsereceived&on=3L99030&pm=1&Itemid=166&lang=" />
<input type="hidden" name="notify_url" value="http://example.com/devportal/index.php?option=com_virtuemart&view=vmplg&task=notify&tmpl=component&lang=" />
<input type="hidden" name="cancel_return" value="http://example.com/devportal/index.php?option=com_virtuemart&view=vmplg&task=pluginUserPaymentCancel&on=3L99030&pm=1&Itemid=166&lang=" />
<input type="hidden" name="rm" value="1" />
<input type="hidden" name="bn" value="VirtueMart_Cart_PPA" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="image_url" value="http://example.com/devportal/images/virtuemart/vendor/" />
<input type="hidden" name="item_name" value="Order Number: 3L99030" />
<input type="hidden" name="lc" value="EN" />
<input type="hidden" name="a3" value="105" />
<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="srt" value="52" />
<input type="hidden" name="sra" value="1" />
<input type="submit" value="Please wait while redirecting to PayPal" />
</form>
After this form is submited i see page with order number, price and message : ". To complete your checkout using PayPal, please log in." After i click Login button then it redirects me to login page . But after i login then it open dasboard and forgets about payment . So payment procedure gets broken. I am using Sanbox business account for seller and sandbox personal account for customer. Can anybody help?

It seems to be a known issue at PayPal's end. The engineering team is working on this for a fix. Will update here once it gets fixed.

Related

How to make sure the paypal notify_url being called from paypal server?

I was working with paypal recurring payment subscription form and using sandbox account for testing
here is my form:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="testacc#email.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Standard Pack">
<input type="hidden" id="item_number" name="item_number" value="1233434-23213">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="user_id" value="13692">
<input type="hidden" id="package_id" name="package_id" value="<?php echo $package_type; ?>">
<input type="hidden" name="a1" value="0">
<input type="hidden" name="p1" value="1">
<input type="hidden" id="t1" name="t1" value="M">
<input type="hidden" id="a3" name="a3" value="10">
<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="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input name="return" type="hidden" value="<?php echo base_url();?>package/new_payment_success" />
<input name="notify_url" type="hidden" value="<?php echo base_url();?>package/new_payment_notify" />
<input name="cancel_return" type="hidden" value="<?php echo base_url();?>package/new_payment_cancel" />
<div class="paypal-btn">
<input type="image" src="pay-with-paypal.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style='width: 125px'>
</div>
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
and it's working totally fine and sends a success information to notify_url url
now for security purpose im checking HTTP_USER_AGENT from $_SERVER variable but this can be modified too.
so how can i make sure that transection is done successfully before i update my database?
I think that you can verify the whole POST content by appending cmd=_notify-validate and sending it to PayPal. They will answer you with a Verified or Not verified response.
Please, check the link below for more information:
https://developer.paypal.com/docs/classic/ipn/gs_IPN/

PayPal recurring payment code integration

I am new in PayPal integration. I need monthly PayPal recurring payment for users. I already have instant payment working with this method:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" name="form_paypal" id="paypal_form">
<input type="hidden" name="amount" value="<?php echo $amount; ?>" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="lc" value="USA" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="business" value="test#gmail.com">
<input type="hidden" name="custom" value='<?php echo $custom;?>' />
<input type="hidden" name="first_name" value= "Anonymous" />
<input type="hidden" name="last_name" value="User" />
<input type="hidden" name="payer_email" value="customer#example.com" />
<input type="hidden" name="item_number" value="123" / >
<input type="hidden" name="item_name" value="test.co Services" / >
<input type="hidden" name="notify_url" value="http://test.co/pg_return.php" / >
<input type="submit" value="Pay" name="pay" id="paypal_submit">
</form>
What do I need to change to integrate recurring payment in my panel? Please help me! If needed I will provide more info!
Based on your example, here's how to set up subscription/recurring payment using the same method:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" name="form_paypal" id="paypal_form">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="test#gmail.com">
<input type="hidden" name="a3" value="<?php echo $amount; ?>" />
<input type="hidden" name="t3" value="M" >
<input type="hidden" name="p3" value="1" >
<input type="hidden" name="src" value="1" >
<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="custom" value="<?php echo $custom;?>"/>
<input type="hidden" name="first_name" value= "Anonymous" />
<input type="hidden" name="last_name" value="User" />
<input type="hidden" name="item_number" value="123" / >
<input type="hidden" name="item_name" value="test.co Services" / >
<input type="hidden" name="notify_url" value="http://test.co/pg_return.php" / >
<input type="submit" value="Pay" name="pay" id="paypal_submit">
</form>
Note that I have made several changes. "a3" denotes the amount of subscription and "p3" indicates the unit of duration (that is, M = monthly, D = daily and so on). To make the subscription recurs indefinitely, set "src" and "p3" to 1.
For reference, you can read on PayPal documentation link here: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HI00JQU

PayPal Checkout with Multiple Items with Quantuty - Unknown Error

I am trying send a PayPal multiple items with quantity and amount in a shopping cart. When i try to send the following i get a unknown error. i dont know why
<form name="check_out_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="sales#ss.com"/>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="item_number_1" value="1"/>
<input type="hidden" name="item_name_1" value="Featured: 3"/>
<input type="hidden" name="amount_1" value="9.95"/>
<input type="hidden" name="quantity_1" value="3"/>
<input type="hidden" name="item_number_2" value="2"/>
<input type="hidden" name="item_name_2" value="Standard: 2"/>
<input type="hidden" name="amount_2" value="2.95"/>
<input type="hidden" name="quantity_2" value="2"/>
<input type="hidden" name="page_style" value="Career"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="no_shipping" value="1"/>
<input type="hidden" name="return" value="http://www.sss.com/welcome.php?id=success"/>
<input type="hidden" name="return_cancel" value="http://www.sss.com/welcome.php"/>
<input type="hidden" name="custom" value="id|1-custom|1-fea|9.95|3|29.85-std|2.95|2|5.9-total|"/>
<input type="hidden" name="notify_url" value="http://www.sss.com/ipn.php"/>
<input type="hidden" name="cbt" value="Complete Upgrade">
<input type="submit" name="button" id="button" value="Pay now"/>
</form>
I cant figure out what i am doing wrong here i get error saying
"We have detected a problem with this shopping cart. If the problem persists, please contact the merchant. At this time, we are unable to process your request. Please return to xxl and try another option."
Add a new variable called "upload", so it might look like:
...
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
...
Tried it, worked with your code in my PP-Sandbox.

How do i get the status of Paypal when it is completed

.I am developing a site where users can login with paypal and pay for a specific service. Money is transferring correctly. But i always get the status as Pending and reason as paymentreview or reason as unilateral. Is there any way to get the status when it is completed. I am testing this in sandbox. my code is
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST" name="_cart" id="paypal_form">
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="mybusiness#gmail.com" />
<input type="hidden" id="custom" name="custom" value=""/>
<input type="hidden" id="on0" name="on0" value="0"/>
<input type="hidden" id="amount_1" name="amount_1" value="10" />
<input type="hidden" name="currency_code" value="<?php echo $cntry; ?>" />
<input type="hidden" name="item_name" value="Account Deposit" />
<input type="hidden" id="amount" name="amount" value="10" />
<input type="hidden" name="return" value="RETURN URL AFTER TRANSACTION" />
<input type="hidden" name="notify_url" value="URL FOR UPDATING STATUS AFTER PAYMENT" />
<input type="hidden" name="cancel_return" value="MYSITE.COM" />
</form>
Thank you..
That's what IPN is for. You get a notice sent to you by Paypal that will notify you when you get paid or when your payment status changes. So Paypal will notify you when your payment status goes to Completed

Paypal IPN not responding at all

Anybody having this problem? Suddenly paypal is not returning POST data to the notify_url. Array is completely empty and it happens when payment is made through new paypal checkout system.
Below is the final page after payment is made. When I click continue booking, it should have redirected to notify_url with POST data for validation and stuff but data is an empty array.
My request code is listed below. Can anybody please take a look at it and tell me whether some variable is missing or i am doing something wrong?
<form method="post" name="paypal_form" action="http://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="business" value="ayaz.a_1286483626_biz#gmail.com" />
<input type="hidden" name="cmd" value="_xclick" />
<!-- the next three need to be created -->
<input type="hidden" name="return" value="https://system1.smanager.net/SM/lib/booking_system/response.php" />
<input type="hidden" name="cancel_return" value="https://system1.smanager.net/SM/lib/booking_system/paypal_ipn.php?cancelled=true" />
<input type="hidden" name="notify_url" value="https://system1.smanager.net/SM/lib/booking_system/response.php" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="bn" value="toolkit-php" />
<input type="hidden" name="cbt" value="Continue Back to Booking System" />
<!-- Payment Page Information -->
<input type="hidden" name="no_shipping" value="" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="cn" value="Comments" />
<input type="hidden" name="cs" value="" />
<!-- Product Information -->
<input type="hidden" name="item_name" value="TestProduct" />
<input type="hidden" name="amount" value="10.23" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="item_number" value="1234" />
<input type="hidden" name="undefined_quantity" value="" />
<input type="hidden" name="on0" value="" />
<input type="hidden" name="os0" value="" />
<input type="hidden" name="on1" value="" />
<input type="hidden" name="os1" value="" />
<!-- Shipping and Misc Information -->
<input type="hidden" name="shipping" value="0.0" />
<input type="hidden" name="shipping2" value="" />
<input type="hidden" name="handling" value="" />
<input type="hidden" name="tax" value="6" />
<input type="hidden" name="custom" value="somedata" />
<input type="hidden" name="invoice" value="" />
<!-- Customer Information -->
<input type="hidden" name="first_name" value="ayaz" />
<input type="hidden" name="last_name" value="alavi" />
<input type="hidden" name="address1" value="Address" />
<input type="hidden" name="address2" value="" />
<input type="hidden" name="city" value="" />
<input type="hidden" name="state" value="abc" />
<input type="hidden" name="zip" value="" />
<input type="hidden" name="email" value="ayaz.a_1286483582_per#gmail.com" />
<input type="hidden" name="night_phone_a" value="" />
<input type="hidden" name="night_phone_b" value="" />
<input type="hidden" name="night_phone_c" value="" />
</form>
</body>
Thanks.
I have also face same problem.
Please set the following settings in Your business account.
In Website Payment Preferences
=> Auto Return: On
=> Set Return URL
=> Payment Data Transfer: On.
Please try this, this may help you.
All the best.
Kanji

Categories