How to protect user edit paypal button ?
this is paypal buy now button on my site
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="hidden" name="amount" value="12.99">
<input type="image" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
my customer will edit paypal button like currency_code, amount
i want to know , how can i protect user to edit paypal button ?
Log into your PayPal account and use the button tool to create a saved button. the saved button replaces all of the sensitive data in the button code with a "Hosted button ID. here is an example of the hosted button code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="L7NSNLBNU69AC">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_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>
Related
I am new to PHP , and PayPal.
I need to do crowdfunding site.
Here I have a form where user can choose pay method :
Pay with terminal
Bank transfer
Paypal
Input with amount that user want to donate for project, and some fields like name, surname , phone etc.
Now action of my form is example.com/pay.php, here I register pay in my database with status "in progress" and i want after it to redirect user to PayPal page.
How to redirect user to PayPal with necessary data (see in PayPal button code) , after I add the transaction to my database?
Code of of my PayPal button:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="BJKELCPG5WDSN">
<input type="hidden" name="lc" value="MD">
<input type="hidden" name="item_name" value="Help African child">
<input type="hidden" name="item_number" value="2299">
<input type="hidden" name="amount" value="67.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="1">
<input type="hidden" name="return" value="http://example.com/test/thanks.php">
<input type="hidden" name="cancel_return" value="http://example.com/test/">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="notify_url" value="http://example.com/test/listener.php">
<input type="image" src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Help me please with this problem.
I'm using a CodeIgniter 3 and I'm having a hard time on implementing the paypal integration on my website . For now I'm trying it on the sandbox and followed this tutorial Paypal Integration Using CodeIgniter
Now the problem here is on my
views/products/index.php
<a href="<?php echo base_url().'products/buy/'.$product['id']; ?>">
<img src="<?php echo base_url(); ?>assets/images/x-click-but01.gif" style="width: 70px;">
</a>
Now when i click the button Paypal Buy Now now it
redirects me to
products/buy/1 was not found on this server.
I follow the instruction
and here is what on my database
Then i tried using the paypal button
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="S3RE65SMVGAHC">
<input type="image" src="https://www.sandbox.paypal.com/en_GB/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
and it redirects me to paypal but without the prices that i inputted on my database. SOMEONE HELP ME PLEASE
The error message
products/buy/1 was not found on this server.
is saying that the controller Products.php was not found.
Assuming the file is in the `applications/controllers' directory (it should be) then you need to make sure that the file name starts with an uppercase 'P'. In other words, the file name should be Products.php not products.php
Please try below sample codes.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUR_ACCOUNT_EMAIL/MERCHANTID">
<input type="hidden" name="item_name" value="test">
<input type="hidden" name="amount" value="10">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
</form>
And refer to below link for details of each variable.
https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
<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>
how to hide paypal button code from user ?
for example codecanyon.net when i purchase some item i don't see paypal form , how can i do that ?
my user will edit price and currency code
i use code look like this.
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="hidden" name="amount" value="12.99">
<input type="image" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="text" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="text" name="amount" value="12.99">
<!-- for submit button -->
<input type="submit" name="submit" value="Pay now">
<!-- for image button -->
<input type="image" src="your button image url" border="0" name="submit" alt="Give here some title">
</form>
For currency you should use select box
<input type="text" name="currency_code" value="USD">
<select name="currency_code" >
<option value="USD">USD</option>
</select>
when you use the button tool to create a saved button all the sensitive data is stored in the account and is replaced by a "Button ID". Here's an example:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="L7NSNLBNU69AC">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_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>
Use:
<input type="image" src="your image url" border="0" name="submit" alt="Pay Now">
Is it possible to redirect the user to certain page after the payment is successful.
I have this form, and when the user fills the details, I want to redirect the user to my page when the payment is successful. Is it possiblt?
This is a sample of paypal payment code.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="accounts#freelanceswitch.com">
<input type="hidden" name="item_name" value="Donation">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="9.00">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="AU">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="return" value="http://net.tutsplus.com/payment-complete/">
<input type="image" src="https://www.paypal.com/en_AU/i/btn/btn_buynow_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_AU/i/scr/pixel.gif" width="1" height="1">
</form>
Here <input type="hidden" name="return" value="http://net.tutsplus.com/payment-complete/"> specifies the return url. For more info - Go Here
Consider also the Auto return option: it allows you to set up an url for all buttons.
Log in and click the Profile subtab under My Account.
Click the Website Payment Preferences link under Selling Preferences.
Click the On radio button to enable Auto Return.
Enter the Return URL
The Return URL will be applied universally to all Auto Return payments. This can be overridden by mentioning separate return URLs in the payment buttons that you’ve created in your PayPal profile
More info in this answer.