how to hide paypal button code from user? - php

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">

Related

PayPal buy now button with IPN

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.

Dynamic Paypal button based on email account address

Is there a way to modify the PAYPAL generated button code below to make it dynamic using a php varible? This is the original 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="ZBA2RX3Q8L9V8">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_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>
This is the logic that I am after:
<?PHP $paypal_email=client#website.com; ?>
<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="<?PHP echo $paypal_email ?>">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_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>
THIS IS MORE DYNAMIC-FRIENDLY AND IT WORKED:
<form name="_xclick" action="https://www.paypal.com/ck/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?PHP ech VARIABLE HERE; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="amount" value="1.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
THIS IS MORE DYNAMIC-FRIENDLY AND IT WORKED:
<form name="_xclick" action="https://www.paypal.com/ck/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?PHP ech VARIABLE HERE; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="amount" value="1.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

How to get Paypal 'Add to Cart' button response?

I m trying to add a Paypal Add to cart button in my application. For that i create code from paypal sanbox. This is my form,
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="EGZD52TPWUERY">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Fees">
<input type="hidden" name="item_number" value="255">
<input type="hidden" name="amount" value="85.00">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:" />
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="my-application/paypal/success">
<input type="hidden" name="tax_rate" value="0.000">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="item_id_<?php echo $res_1->id; ?>" value="<?php echo $res_1->id; ?>" />
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_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_US/i/scr/pixel.gif" width="1" height="1">
</form>
The payment transaction is completed successfully and the redirect is done perfectly to my application. But the problem is i didn't get any response in that page. I tried var_dump($_POST). It retruns null. Don't know why i didn't get any response. Any help is appreciated.
Check the following link and update your paypal account.The response is in $_GET
https://developer.paypal.com/webapps/developer/docs/classic/products/payment-data-transfer/

Want to connect my shopping cart total price to a paypal checkout

I have a displaycart.php page where it displays all items I have in a shopping cart, each item has an ItemUnitPrice field where it shows the unit price of the item.
If I have say 6 items in the cart then I want to add up the total ItemUnitPrice fields and set that amount to be paid with PayPal.
I have checked out PayPals button features which they allow and you can only set a given price for the user to pay for when you create the button.
Is there a way I can link the PayPal button to my database so it shows the total of all the ItemUnitPrice fields.
The variable which holds the total ItemUnitPrice:
<?php
$Total = $Quantity * $ItemUnitPrice;
?>
The PayPal 'Pay Now' Button:
<html>
<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="KAMQ5PVWVDYYN">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_paynow_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_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</html>
Edit:
Yeah I've done something stupidly wrong!
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_BLANK">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="info#asianweddingservices.org" />
<input type="hidden" name="item_name" value="<? $ItemDesc ?>" />
<input type="hidden" name="item_number" value="<?$ItemCode ?>" />
<input type="hidden" name="amount" value="<?$Total ?>" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="lc" value="GB" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input src="paypal/purchase.png" name="Submit" type="image" value="purchase" alt="Purchase" />
</form>
Yes. Change the set value to your total.
Show your code and I can edit the answer to fix it for you.
Add this:
<input type="hidden" name="amount" value="<? echo $Total; ?>" />
If that doesn't work:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_BLANK">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="PAYPAL EMAIL" />
<input type="hidden" name="item_name" value="ITEM NAME" />
<input type="hidden" name="custom" value="CUSTOM VALUE" />
<input type="hidden" name="item_number" value="ITEM NUMBER" />
<input type="hidden" name="amount" value="TOTAL" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="lc" value="GB" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input src="paypal/purchase.png" name="Submit" type="image" value="pruchase" alt="Purchase" />
</form>
Replacing the values to yours of-course.

Paypal Payment Notification

I would like to have the Notification like if the transaction made is success or failure.
My Code :
<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="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="T4ETNVYF7D898">
-->
<input type="hidden" name="business" value="uresh._1304751477_biz#yahoo.com">
<input type="hidden" name="item_name" value="Ramakdu">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="return" value="http://localhost/paypal/">
<input type="image" src="https://www.sandbox.paypal.com/WEBSCR-640-20110429-1/en_US/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/WEBSCR-640-20110429-1/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<?php
print_r($_REQUEST);
?>
Try this:
<input type="hidden" name="return" value="http://example.com/paymentsuccess" />
<input type="hidden" name="notify_url" value="http://example.com/paymentsuccess">
<input type="hidden" name="cancel_return" value="http://example.com/paymentfailure" />
Return should be a link and not "localhost".
Keep in mind that "notify_url" must be a publicly accessible URL. Return will work for testing, but notify_url is a POST initiated from the PayPal-side, and must thus be publicly acc

Categories