How can I change Hidden Value in Paypal Button - paypal

We are creating a simple sales site for local pickup no shipping, so in keeping it simple, we decided to use Vb.net and SQL Server, creating a catalog page and detail page with buying it now Paypal button. In using SQL server it will fill out the details page but we like it to be able to change the "value" in the following line : . (the value is given when creating a button, but stored the value in SQL) Is there a simple solution
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="?????">
<input type="image" src="https://www.paypalobjects.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.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Thinking about this more, you're probably going around this the wrong way. There is no reason to store hosted button IDs in a database; such buttons exist for limited HTML-only websites.
Since your website is not limited to HTML, dispense with hosted buttons entirely and render buttons using a standard PayPal Checkout integration, which uses the JS SDK (and can optionally communicate with a backend to create and capture an order--see the full stack example in that guide, the backend routes of which can be implemented in whichever environment, .net in your case)

Related

how to create a payapal's payment form?

I want to create a form for paypal payment. like this form.
what i want is to make a simple paypal button. after clicking on that button this form will appear. but the problem is when ever I create get payment button , from my paypal account I end up with this kind of form.
how to get that form in paypal? thanks in advance.
in addition i got a project code. this code is a paypal button link up with a form like my first image.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZEFZFYBY2SZB8">
<input type="image" src="https://www.paypal.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.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
when i make a button from my paypal account. after click that button i end up with the form like my second image. how do i create the form like first image.
Please Describe what kind of Script or CMS you are using is it PHP or HTML or .... ?
for Creating a button Login to your Paypal Account on Seller preferences and make the botton or find information Here
if you are using Wordpress and Woocommerce you can install plugins Here
if you are using PHP Scripts you can find Code Integration Here
UPDATE
Regarding your Type of Form you wanted you can download either one of the plugins written by Scott Paterson Below
https://en-gb.wordpress.org/plugins/contact-form-7-paypal-add-on/
https://en-gb.wordpress.org/plugins/easy-paypal-donation/
The First Plugin is the Form that you referred on your comments below
just leave the price and form empty
See following link which guides you to get started with using Paypal Payment Gateway :
https://phppot.com/php/paypal-payment-gateway-integration-in-php/

Paypal Donation button doesn't work

It works fine for me using chrome, and a buddy using FF says it works as well. Doesn't work on IE at all. All I did was copy / paste the button code from paypal and put it into my footer. Page I'm getting says: Error Detected; Some required information is missing or incomplete. Please correct your entries and try again. Help?
<div style="
width: 145px;
margin: 0 auto;
"><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="encrypted" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAG9sQZQh2AAgcLjbZ70VuFvOKqmH4ReOo6Hu/t0tIB9IlTsOgb/NyBsdl+/ZRBjRsUSACCQ4h+jsnR7ir6c6zOcLgzqgxavbyeSldy/ffoCkjdYrzzKViCwNzJ6lmRDQ+Y1D66x78J0RPru4YfrTPgrrZkJpmMTgDMvsi8WHgXljELMAkGBSsOAwIaBQAwgbQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIUDpPdk0V022AgZBAx7diT5xNM3BSQQQUws7Uf6k37ApsBEQOYN1HchfiJeIMxeM+t5gEr3vE5ozhu2M3IROdCfUr2hmLHjpuSWv6ehAhNZee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AcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMzA5MjAxOTUyMTlaMCMGCSqGSIb3DQEJBDEWBBRKvZzhJd5FzC14DnbI/qkwH4zAFTANBgkqhkiG9w0BAQEFAASBgGCNTqM9LVC2N/Cy/IS18efGNcw9r6xIO4Nq6E83Ho1RxR+KIbmjvxH283rLl82xJul/xcoXWLQapR5M77qM6NjIpo4X3RmNCBG0vFFirnYnSsnVMNlPchraZ/3bXfmvhJP3M+FiL7GS6OoXPWeNq70/XBi133jAq+q0kkRzw4EM-----END PKCS7-----
">
<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!" style="
padding-top:30px;
padding-left:30px;
">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
Looks like this is related to PayPal button code protection.
By default PayPal button code has a hidden field named encrypted that contains all information about payment in encrypted form.
When Remove code protection link (located above textarea with button code in PayPal button generation page) is clicked different code, containing many fields in plain-text form is displayed.
I have faced situation where protected (encrypted) code had this issue, but unprotected code worked without any issues. NB Using unprotected code may result in decreased security - by modifying unprotected button code users can make payments with changed currency, purpose or reference ID. Besides spambots can easily pick up e-mail from unprotected button code if email address is used instead of secure merchant ID. Also it is recommended to ask PayPal support for other possible issues that may arise from using unprotected code.

Amount is not displaying in paypal form

I am using the following paypal code but still the amount is not displayed in paypal form once the website redirect the page to paypal.
`<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="XXXX">
<input type="hidden" name="amount_1" value="200">
<input type="image" style="width: 70px !important; padding: 0px !important;" src="http://www.merlioncricket.com/Login/static/images/payment.png" 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>`
Please let me know, why the amount is not displaying.
Thanks,
Gladiator
Finally I found the answer, & maybe it is useful to others, whenever you create the paypal button make sure in step 2 "Save Button At PayPal" is not clicked & second once you create the button, remove code protection & then select the code & copy the paypal generated code.
It will solve the problem.
Thanks....
When using a hosted button, you can not pass over an amount. The hosted buttons, prevents someone from directly modifying the code and passing over a different amount. If you are wanting a different amount, you would need to log into your account and edit the hosted button. If you want to dynamically populate the amount, then you would need to create a non hosted clear text button.

PayPal encrypted button as text link

I use PayPal Api to create encrypted BuyNow buttons. The Api return button as form HTML code.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIIWwYJKoZIhvcNAQcEoIIITDCCCEgCAQExggE6MIIBNgIBADCBnjCBmDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRUwEwYDVQQKEwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMxFDASBgNVBAMUC3NhbmRib3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Zm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEVMBMGA1UEChMMUGF5UGFsLCBJbmMuMRYwFAYDVQQLFA1zYW5kYm94X2NlcnRzMRQwEgYDVQQDFAtzYW5kYm94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTIwODI5MDg1NTU1WjAjBgkqhkiG9w0BCQQxFgQUaBaJ4m2GzLbeacAcXs2DCghZIEgwDQYJKoZIhvcNAQEBBQAEgYB3vXv0Qlqda8ejg8FWLie/fvC9p8sk/TP+gBXnxi5sNPM0N9NTHp3Epu8qZR9FJVctrBkeF5BosIqhCfNe9HV12PFbv7N9jXSNJ8Dkr0TVtlAWhSmoeaDDHSm3uhYYJ4wcWImLSGufOdoE/cyGys8rxv7noJN6YjTfbgXbum9DZQ==-----END PKCS7-----
">
<input type="image" src="https://www.sandbox.paypal.com/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/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
The problem is that I do not want to use FORM for paypal buttons and also I do not find a way to change default paypal button which is embedded in form html code. I would like to use encrypted paypal button as simple text link.
I have tried to just copy all form variables and build url with parameters like
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_s-xclick&encrypted=-----BEGIN PKCS7-----MIIIWwYJKoZIhvcNAQcEoIIITDCCCEgCAQExggE6MIIBNgIBAD.....
Unfortunately it do not work. Maybe someone has solution?
In the BMCreateButton API call, instead of BUTTONTYPE=ENCRYPTED, set BUTTONTYPE=HOSTED. It will be the same security-wise, but it would also return an 'EMAILLINK', which you could then use.
BUTTONTYPE=ENCRYPTED unfortunately will not return an EMAILLINK.
Additionally, if you include the full encrypted text inside your link, you may well run into a LimitRequestLine limitation in Apache (default: 8190), depending on your Apache configuration.
It's just much, much better to keep the URL as short as possible.
You copied the link wrong. It will work fine.
However, a hosted button is much much much better. And editable via the ButtonManager API.
I had the same issue, I urlencoded the encrypted value and it worked. I hope this helps for anyone else having the same issue that does not want to use the API to make hosted buttons.

can't POST item price in paypal sandbox

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YYHZM9FTBZQGW">
<input type="hidden" name="amount" value="20.00">
<input type="image" src="https://www.sandbox.paypal.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.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
this is a paypal sandbox button. all i want to do is to post the TOTAL price of all the product the user buy in my website.
I created a button with nothing to post because basically i want to post dynamically in the future using a php variable so I think I don't need to set up the item price, name, quantity in the sandbox create button features. how am i suppose to do that.
this is the output. I want the item price to be not editable same as with description and quantity
The reason you can't override the amount dynamically, is because you have a so-called 'PayPal hosted button'.
With a hosted button, the amount is stored on PayPal's side and can't be overwritten with the 'amount' variable.
You'll either want to use a non-hosted button, or use the BMUpdateButton API call to dynamically update the button's amount.
An example request for BMUpdateButton would look as follows:
USER=Your API username
PWD=Your API password
SIGNATURE=Your API signature
VERSION=82.0
HOSTEDUBTTONID=The value of <input type="hidden" name="hosted_button_id" value="">
BUTTONTYPE=The type of button. E.g. BUYNOW
BUTTONCODE=The type of code you want to get back. E.g. HOSTED
L_BUTTONVAR0=amount=The new amount with a period as separator
L_BUTTONVAR1=item_name=Optional: a new item name if you wish
Similary, you could also use the BMCreateButton API to create a new button, or use the BMButtonSearch API to search through a list of all your stored hosted buttons (to find the hosted_button_id of your button automatically, for example)
The reason to use a hosted button is because it's more secure. A non-hosted, unencrypted button would basically leave the amounts open to manipulation. Fraudulent transactions waiting to happen.