paypal integration and testing - paypal

I use sandbox for simple pay, my form is:
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal">
<input type="hidden" value="_cart" name="cmd">
<input type="hidden" value="1" name="upload">
<input type="hidden" value="1" name="no_note">
<input type="hidden" value="1" name="no_shipping">
<input type="hidden" value="USD" name="currency_code">
<input type="hidden" value="{{my external script here[http://example.com]}}" name="notify_url">
<input type="hidden" value="{{my email}}" name="business">
<input type="hidden" value="Eko " name="item_name_1">
<input type="hidden" value="107-372" name="item_number_1">
<input type="hidden" value="0.50" name="amount_1">
<input type="hidden" value="1" name="quantity_1">
<input type="hidden" value="E-mail" name="item_name_2">
<input type="hidden" value="Free Shipping" name="item_number_2">
<input type="hidden" value="0.00" name="amount_2">
<input type="hidden" value="1" name="quantity_2">
<input type="hidden" value="0.23" name="tax_cart">
<input type="hidden" value="0" name="discount_amount_cart">
<input type="hidden" value="http://test.t/put-log.php" name="return">
<input type="hidden" value="http://test.t/raw.html" name="cancel_return">
<input type="submit">
</form>
After submit this form I pay using another sandbox account. My payment is correct but Im not redirecting to notify_url, looks like my IPN is lost or not sending, maybe because sandbox mode or any other idea?
SOLVED
My sandbox account misconfiguration - added verfication (bank account) to sandbox account and now history logs looks ok
Thanks for help!!

notify_url is for IPN which is completely separate from the checkout flow. No redirection will take place with your notify_url. The redirect would be the "return" parameter and could be used with PDT, which is similar to IPN, however, the user is never guaranteed to make it back to your return URL so it's not recommended to handle any post-transaction processing with PDT.
IPN is what you want, but you have to remember it's separate from the checkout flow. Check the IPN History from the sandbox account you're using as the seller. Also check your web server logs. It could be that the IPN is getting triggered but you have an error in your script keeping it from running correctly. IPN History and your web server logs will help you track this down.

Related

how to change the name in the "cancel and return to" link on the express checkout

i'm creating a small marketplace where several sellers can sell their products and each has their own express checkout link, depending on their email.
my form is like this:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="form_paypal">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="bn" value="wa_dw_2.0.4">
<input type="hidden" name="business" value="receiver#gmail.com">
<input type="hidden" name="receiver_email" value="receiver#gmail.com">
<input type="hidden" name="amount" value="123.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.me.com/return.php">
<input type="hidden" name="item_name" value="Product Title Goes Here">
<input type="hidden" name="undefined_quantity" value="0">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="custom" value="12345">
<input type="hidden" name="cbt" value="Return to MY WEBSITE NAME">
<input type="hidden" name="cancel_return" value="http://www.me.com/failure.php">
<input type="hidden" name="notify_url" value="http://www.me.com/notify.php">
</form>
note that i set the "cbt" value as per https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/ but it's not working :( the return link still shows
"cancel and return to receiver#gmail.com"
which is confusing and just plain ugly for the buyer.
any ideas what i'm doing wrong here?
it's the same on the sandbox or the live version, i might add.
The document says "cbt : Sets the text for the Return to Merchant button on the PayPal Payment Complete page.For Business accounts, the return button displays your business name in place of the word "Merchant" by default. " This means you will see this text on the PayPal thank you page after the buyer completes the payments . Something like below :
First, what you're using here is Payments Standard, not Express Checkout. Eshan is correct with the information he provided regarding the parameter you're working with...it doesn't come up until after the payment is completed.
If you were actually using Express Checkout you would indeed have control over what you're asking about via the BRANDNAME parameter. It would still say "Cancel and return to" but then whatever you set for BRANDNAME would get output after that.
To my knowledge Payments Standard does not give you access to adjust the cancel link like EC does.

paypal return field ignored on live

I have a form like the below which works correctly when the business is a sandbox account but not when I use a genuine business account.
In the latter scenario the return field is never shown and instead I am seeing a paypal payment confirmation page.
I've tried enabling/disabling auto-return in the business account but it makes no difference.. any ideas?
<form target="paypal_iframe" name="form_iframe" id="form_iframe" method="post" action="https://securepayments.paypal.com/cgi-bin/acquiringweb">
<input type="hidden" name="cmd" value="_hosted-payment">
<input type="hidden" name="subtotal" value="100">
<input type="hidden" name="business" value="my#email.com">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="paymentaction" value="sale">
<input type="hidden" name="template" value="templateD">
<input type="hidden" name="return" value="http://www.mywebsite.com/receipt">
</form>
The only thing that could be causing it, is that if there are issues with the button and it being hosted or non hosted.
The resolution here was to add an extra field not covered in the iFrame documentation
<input type="hidden" name="showHostedThankyouPage" value="false">
Note that the field name is case sensitive.
PP_MTS_Chad was on the right line

Implementing PayPal IPN with custom cart use

I am trying to set up PayPal's IPN for custom cart use. But somehow it does not work. Can you guys have a look at the PayPal button code I am using? Do you notice any problems? Once I click on the Pay button, I am taking to PayPal's page that has the follow message:
We have detected a problem with this shopping cart. If the problem persists, please contact the merchant.
Questions:
What is the right way to name these variables: item_numberX or item_number_X? And the same with variables responsible for: price, name, and quantity. Do I need to add the underscore?
<input type="hidden" name="item_number_1" value="1">
<input type="hidden" name="item_name_1" value="Service 1">
<input type="hidden" name="amount_1" value="148.00">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="mc_gross_1" value="148">
<input type="hidden" name="item_number_2" value="2">
<input type="hidden" name="item_name_2" value="Service 2">
<input type="hidden" name="amount_2" value="30.00">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="mc_gross_2" value="30">
<input type="hidden" name="return" value="http://www.sitename.com/thank-you/">
<input type="hidden" name="notify_url" value="http://www.sitename.com/ipn.php">
<input type="hidden" name="first_name" value="Peter" />
<input type="hidden" name="last_name" value="James" />
<input type="hidden" name="payer_email" value="alex111#gmail.com" />
<input type="hidden" name="item_number" value="144" / >
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
Thank you.
You have most of the button right, the only variables I see issues with are "mc_gross_x", "payer_email" and "item_number". I am not sure where you got mc_gross_x at, but this would not be used in a button, you may have it confused with an IPN variable. As for payer_email, again you may have this confused with an IPN variable. If you are trying to populate the buyers email address on the PayPal payment page, it would just be "email". Also, you do not need to pass "item_number", since you are using the cart upload method, you would just use the format that you are already using up above in your code"item_number_x".
If the button still does not work for you, I would need to see the rest of the bottom code to see why it is not working.

Paypal dynamic subscription button ipn

I am using this code I found:
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="me#example.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<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">
</form>
When you generate a button from paypal site, it gives you the option to select the link where to send the ipn. My question is, how do I get the ipn confirmation using the code above or how do I set the link for it?
To add IPN notifications to this button specifically you can just add an additional hidden field to the form.
<input type="hidden" name="notify_url" value="http://www.domain.com/ipn-listener.php" />
That will only trigger an IPN for the initial transaction, though. If you want to get IPN's for all payments associated with this profile from there on you'll need to configure IPN in your PayPal account profile under the Instant Payment Notification Preferences section. Simply turn it on and set the URL you want to use.
At that point, the account profile setting will be sort of a default IPN that your account will use for all transactions. However, this can be overridden using notify_url (or NOTIFYURL in API requests.)
Hope that helps.

Paypal - a payment process to elucidate

I have just began working on a project processing paypal payment on a web site, which does not work fine in the sense that the email notification is sent if and only if the user goes back to the site. The fact is that I didn't code it and I even don't know what kind of api it uses. I read the doc which is quite obscure to me (It understood there is a token needs to be sent from the site by get request method but I am really not sure). I understand from the code that, in the following, the op=dodons uri is used to mange the response of paypal and to send an email notification to the user. Here is the only thing I can tell you about the page from which I want to fetch up how the payment is processed :
<form action="{$payPalURL}" method="post" class="payPalForm" id="frmpp">
<input type="hidden" name="cmd" value="_donations" id="typedon"/>
<input type="hidden" name="item_name" value="Donation" />
<input type="hidden" name="business" value="{$myPayPalEmail}" />
<input type="hidden" name="notify_url" value="{$url}/index.php?op=dodons&donation=1&tid={$randomID}&payment=1" />
<input type="hidden" name="return" value="{$url}index.php?page=campaign&op=dodons&campaign_id={$campaign->getId()}&don=ok" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="cbt" value="Continue" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="txn_id" value="{$randomID}" />
<input type="hidden" name="tid" value="{$randomID}" />
{if $logged_user != null}
<input type="hidden" name="a_id" value="{$logged_user->getId()}" />
</form>
It looks like you're using Payments Standard in combination with Payment Data Transfer (PDT).
PDT only works if the user makes it back to the site which is never guaranteed, even with Auto-Return enabled.
Instead, use Instant Payment Notification (IPN). This is a simple POST of all transaction data to a listener script on your server, and this happens regardless of whether or not the user makes it back to your site or not. It's completely separate from the checkout flow.