I'm using paypal standard payment system to accept payment from my customers. I've made INR as primary in my paypal account.But it gives the error when I pass currency code as INR. I've already referred about this issue with some websites including,
https://www.paypal-community.com/t5/About-Business-Archive/Accepting-Indian-currency/td-p/615019
Here is my code:
<form action="<?php echo $paypal_link; ?>" method="POST">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="<?php echo $paypal_username; ?>">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="<?php echo $row['name']; ?>">
<input type="hidden" name="item_number" value="<?php echo $row['id']; ?>">
<input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
<input type="hidden" name="currency_code" value="INR">
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://.....'>
<input type='hidden' name='return' value='http:....'>
<!-- 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>
Can anybody help to solve this issue?
Please check it which payment method you have purchased. Ex:(DoDirect, ExpressCheckout).
Particular payment method supported the INR. Review everything.
Related
I'm developing an ecommerce website (as a project) and I want to integrate payment gateway in same. In this project when a user clicks on a product at index page, he's redirected to product_detail.php where there is a buy now button which directs him to payment gateway, but I always get the error "BAD_INPUT_ERROR: Things don't appear to be working at the moment. Please try again later."
Here's a part of my code
<form action="<?php echo $paypalURL; ?>" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="<?php echo $paypalID; ?>">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="<?php echo $row['name']; ?>">
<input type="hidden" name="item_number" value="<?php echo $row['id']; ?>">
<input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
<input type="hidden" name="currency_code" value="INR">
<INPUT TYPE="hidden" name="charset" value="utf-8">
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://localhost/search/cancel.php'>
<input type='hidden' name='return' value='http://localhost/search/success.php'>
<!-- Display the payment button. -->
<input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
</form>
Am I missing something? (I'm a beginner in php and I learned this from a website), also I wasn't able to turn on Auto return in my paypal sandbox account because they weren't able to validate my return URL. Do I need to host my project first so that it accepts my return URL?
My paypal payment completed successfully but after payment,I don't get transaction detail like transaction id, currency, price, item,receipt no etc...
before 15 days its working properly. but now its not working.
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-
bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="kin#kinskards.com">
<!-- Specify a PayPal Shopping Cart Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Birthday - Cake and
Candle">
<input type="hidden" name="amount" value="3.95">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="cancel_return"
value="http://localhost/PayPalDemo/PayPalDemoCancel.php">
<input type="hidden" name="return"
value="http://localhost/PayPalDemo/PayPalDemo/Succes.php">
<!-- Display the payment button. -->
<input type="image" name="submit"
src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_addtocart_120x26.png"
alt="Add to Cart">
<img alt="" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>
You must pass notify_url parameter like cancel_return.
<input type="hidden" name="notify_url" value="http://localhost/PayPalDemo/PayPalDemoPayment.php" />
Also you must set this URL in sandbox account in IPN section. Refer this https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSimulator/
I have a problem with integrating paypal gateway in my website
I tested many times and used many codes.
My current code :
<?php
//Include DB configuration file
include 'dbConfig.php';
//Set useful variables for paypal form
$paypalURL = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; //Test PayPal API URL
//$paypalID = 'PayPalMerchant#example.com'; //Business Email
$paypalID = 'intermixitsolution#gmail.com';
?>
<?php
//Fetch products from the database
$results = $db->query("SELECT * FROM products");
while($row = $results->fetch_assoc()){
?>
<img src="images/<?php echo $row['image']; ?>"/>
Name: <?php echo $row['name']; ?>
Price: <?php echo $row['price']; ?>
<form action="<?php echo $paypalURL; ?>" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="<?php echo $paypalID; ?>">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="<?php echo $row['name']; ?>">
<input type="hidden" name="item_number" value="<?php echo $row['id']; ?>">
<input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
<input type="hidden" name="currency_code" value="USD">
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://intermixitsolution.net/paypal/cancel.php'>
<input type='hidden' name='return' value='http://intermixitsolution.net/paypal/success.php'>
<!-- 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>
<?php } ?>
In this code if i used
$paypalID = 'intermixitsolution#gmail.com';
It gives error as:
And if i use
$paypalID = 'PayPalMerchant#example.com';
Everything working fine
Suggest me solution.Thanks
i have following problem.
I integrated Paypal to my website. Now I want to test the PayPal settings. I test it in the sandbox enviroment. So the paying is working very well and after the payment the site redirects to my success.php site.
and there i have a problem.
Normaly it should show something like mywebsite.de/success.php?tx=83437E384950D&st=Completed&amt=10.00&cc=USD&cm=&item_number=1
but it only shows
mywebsite.de/success.php
my code looks like this
paypalURL = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; //Test PayPal API URL
$paypalID = 'mywebsite#site.de'; //Business Email
<center><form action="<?php echo $paypalURL; ?>" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="<?php echo $paypalID; ?>">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="1 Monat Premium Mitgliedschaft">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="49.99">
<input type="hidden" name="currency_code" value="EUR">
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://mywebsite.de/index.php'>
<input type='hidden' name='return' id='return' value='http://mywebsite.de/success.php/'>
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypalobjects.com/de_DE/DE/i/btn/btn_buynowCC_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></center>
What did I wrong hand how do i get the invformation of paypal for my success page??
Pass the rm variable with value as 2, refer the below:
<input type="hidden" name="rm" value="2">
Once you pass rm=2 then you will see the below variables after the buyer redirect to your website:
http://mywebsite.de/success.php/?amt=10.84&cc=USD&item_name=XXXXX&st=Completed&tx=XXXXXXX
<form name="myform" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<div id="other_element"></div>
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="<?php echo $adminpaypal; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Monthly Subscription">
<input type="hidden" name="a3" value="5.00">
<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="sra" value="1">
<input type="hidden" name="notify_url" value="<?php echo $paypal_notify; ?>" id="payment-notify" />
<!-- Display the payment button. -->
<input name="return" value="<?php echo $paypal_return; ?>" type="hidden">
<input type="image" src="" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
I have created form of paypal for monthly subscription. After subscription, I am getting "subscription id". Now I am working on making unsubscribe button.Is it possible to make unsubscribe button via passing subscription id on link ?
If you created your subscription using subscription button creator then you can follow these steps.
When you go to your saved buttons, click on "action"-->"view code". At the bottom, under your code, there is a "create unsubscribe button" option.
Create the button and copy the code. Paste it in your web app. You are good to go.
Here is the button creator code with hidden values---
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick"> //custom variable. You can access it like $_POST['cmd'] when you call listener (IPN)
<input type="hidden" name="hosted_button_id" value="*********">
<input type="hidden" name="custom" value="<?php echo $_SESSION['user']['id']; ?>">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
And here is the code for unsubscribe button. When you will create unsubscribe button, it will generate same code. Just ****** will be replaced by some value.
<a HREF="https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=*******">
<img SRC="https://www.paypalobjects.com/en_US/i/btn/btn_unsubscribe_LG.gif" BORDER="0">
</a>