Thursday, 31 March 2016

Instant Payment Notification paypal

Instant Payment Notification paypal

Question: What is IPN?
IPN is a message service by paypal that notifies you regarding PayPal transactions.


Question: What is full form of IPN?
Full form of IPN is Instant Payment Notification.


Question: For what type of transactions, paypal send notification?
  1. Instant payments (including Express Checkout payments, direct credit card payments, and calls made to the Adaptive Payments API)
  2. eCheck payments (status pending, completed, and denied)
  3. Pending payments
  4. Authorizations
  5. Recurring payments and subscription payment actions
  6. Chargebacks, disputes, reversals, and refunds associated with different transactions



Question: From where I can send IPN online?
https://developer.paypal.com/developer/ipnSimulator/
(for this, First you MUST set IPN URL in your account)


Question: Give me URL of IPN Simulator?
https://developer.paypal.com/developer/ipnSimulator/
(for this, First you MUST set IPN URL in your account and that must be https URL)


Question: Can I test IPN Simulator in local system?
No, You can't.


Question: Where I can set IPN URL?
Login to Merchant Account => Merchant Services => Instant payment notifications (click on link)
Direct Link for Sandbox: https://www.sandbox.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-ipn-notify
Direct Link for Paypal: https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-ipn-notify


Question: In PayNow Form, Can i set IPN URL? If yes, how?
Yes, you can set.
<input name="notify_url" type="hidden" value="http://example.com/ipn-url.php" />       



Question: What is Full form of PDT?
Full form of PDT is PayPal Payment Data Transfers.


Question: What is PDT? and What is use of PDT?
PDT is for notification similar to IPN.


Question: How PDT is different from IPN?
With PDT you get the notification instantly and can do any additional processing required and show the user a confirmation page.
Whereas IPN you are guaranteed to be notified that the payment was received even computer get crash after payments.


Question: From where i can view the IPN History?
https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history


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.