Tuesday, 29 March 2016

Paypal Buynow button with Dynamic Fields

paypal buynow button with dynamic fields


DEMO - (Please Don't do Payment).





Sandbox Custom Button
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_xclick" />
    <input name="business" type="hidden" value="business_a@no-spam.ws" />
    <input name="no_shipping" type="hidden" value="1" />    
    <input name="item_name" type="hidden" value="Product Name" />
    <input name="item_number" type="hidden" value="123456" />
    <input name="amount" type="hidden" value="10.25" />
    <input name="currency_code" type="hidden" value="USD" />
    <input alt="PayPal - The safer, easier way to pay online!" border="0" name="submit" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" />
    <input name="return" type="hidden" value="http://example.com/ohio-university/success/tour_type/private" />
    <input name="cancel_return" type="hidden" value="http://example.com/ohio-university/cancelled/order_id/00010" />        
    <input name="notify_url" type="hidden" value="http://example.com/ohio-university/ipn/order_id/00010" />        
    <input name="button_subtype" type="hidden" value="services" />
</form>




Paypal Custom Button
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_xclick" />
    <input name="business" type="hidden" value="business_a@no-spam.ws" />
    <input name="no_shipping" type="hidden" value="1" />
    <input name="item_name" type="hidden" value="Product Name" />
    <input name="item_number" type="hidden" value="123456" />
    <input name="amount" type="hidden" value="10.25" />
    <input name="currency_code" type="hidden" value="USD" />
    <input alt="PayPal - The safer, easier way to pay online!" border="0" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" />
    <input name="return" type="hidden" value="http://example.com/ohio-university/success/tour_type/private" />
    <input name="cancel_return" type="hidden" value="http://example.com/ohio-university/cancelled/order_id/00010" />        
    <input name="notify_url" type="hidden" value="http://example.com/ohio-university/ipn/order_id/00010" />        
    <input name="button_subtype" type="hidden" value="services" />
</form>

Understand the Hidden variables
  1. cmd:value is _xclick, means this is Buy Now page.
  2. business: paypal email address where you will received the payment.
  3. no_shipping: Show the shipping details in paypal checckout page, 0-Hide, 1-Show.
  4. item_name: Product Name display in paypal cart page.
  5. item_number: this is order number and should be always unique.
  6. amount: Amount of order.
  7. currency_code: Currency code of order amount.
  8. return: After order complete, user will return to this URL.
  9. cancel_return: If user cancel the payment in paypal checkout page, he will return to this URL.
  10. notify_url: This is notify URL for developer, where developer update the details after payment success/failed/onHold etc.


Monday, 28 March 2016

How to set P3P http header in PHP?

How to set P3P http header in PHP?

Question: How to set P3P In header with PHP?
header('P3P: CP="NOI ADM DEV COM NAV OUR STP"');



Question: What is header in php?
In Gernal terms, Header means head of body section.
In Web World, Every one can see the content of body and can't see header section easily.


Question: What is header function in php?
he header() function sends a raw HTTP header to a client. header() must be called before any actual output is sent.


Question: What is P3P?
Full form of P3P is Platform for Privacy Preferences.
The P3P is a protocol allowing websites to declare their intended use of information they collect.


Question: What are main content for P3P?
  1. What kind of information is collected like email, password and ip address etc From browser.
  2. How you are using this information.
  3. How long information is stored in Browser



Question: What is file format of P3P?
File Name: p3p.xml
File Format:

  <policy-references>
    <expiry max-age="10000000"><!-- about four months -->
  </expiry></policy-references>



Question: What are benefits of P3P?
P3P allows browsers to understand their privacy policies in a simplified and organized manner.


Question: What is Third Party content in Web?
When we include iframe in any webpage, content of iframe is "third party content".


Question: When P3P is born?
2002


Question: What is the most broad P3P header that will work with IE?
CON, TEL, PHY, ONL, FIN, GOV
CON: Information may be used to contact the individual for the promotion of a product or service.
TEL: Information may be used to contact the individual via a voice telephone call for promotion of a product or service.
PHY: Information that allows an individual to be contacted by telephone OR Address.
ONL: This information is independent of the specific computer used to access the network.


Question: Which browser is consider P3P?
Internet Explorer


Question: Why cookie is disabled for Iframe In website in IE Browser?
Because IE does not fully trust on Iframe content, He consider it third party content.