Has anybody gotten PAYMENTREQUEST_0_DESC to work in the PayPal API? - paypal

I am passing my PayPal API call like this:
&METHOD=SetExpressCheckout
&RETURNURL=''
&CANCELURL=''
&PAYMENTREQUEST_0_PAYMENTACTION='SALE'
&PAYMENTREQUEST_0_NOTIFYURL=''
&BRANDNAME=''
&NOSHIPPING=0
&PAYMENTREQUEST_0_CURRENCYCODE=''
&LOCALECODE=US
&LOGOIMG=''
&CARTBORDERCOLOR=''
&ALLOWNOTE=0';
&PAYMENTREQUEST_0_CUSTOM=''
&PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID=''
&L_PAYMENTREQUEST_0_NAME1=''
&L_PAYMENTREQUEST_0_AMT1=''
'&L_PAYMENTREQUEST_0_QTY1=''
&PAYMENTREQUEST_0_ITEMAMT=''
&PAYMENTREQUEST_0_SHIPPINGAMT=''
&PAYMENTREQUEST_0_AMT=''
and obviously I am including the:
'&PAYMENTREQUEST_0_DESC='.urlencode($desc).
where $desc = "Payment made from My Website";
But it's not showing anywhere in the confirmation emails that PayPal sends. Neither in the sandbox nor in the live version.
Has anyone gotten this to work successfully?

If you don't include items information, this parameter will show on PayPal checkout page.

I found a way to do it.
It's with: '&PAYMENTREQUEST_0_NOTETEXT='.urlencode($desc).

Related

URL for Verifying PayPal IPN messages

My PaypalIPN.php has this line:
const VERIFY_URI = 'https://ipnpb.paypal.com/cgi-bin/webscr';
My Buy Now button says different:
"https://www.paypal.com/cgi-bin/webscr"
Is that correct with one going to ipnpb. and one going to www.paypal.com
Orders are scarce, there's something wrong somewhere, I'm doing a process of illimintation, can anyone verify the above?
If yours is working OK, can you take a look por favor?
Either URL can work, but the ipnpb one is newer and preferred, per the current IPN documentation.

Paypal-Merchant-SDK : How get only token using the SetExpressCheckout.php and then passe it to CreateRecurringPaymentsProfile.php?

Please can anyone explain to me step by step cause i'm so confused about the example that Paypal give us, the "SetExpressCheckout.php", it contains a lot of stuff, i want only to generate a token so i can create a Recurring Payments Profile using "CreateRecurringPaymentsProfile.php"
Please help, i have read some tutorials but never showed from the beginning how to start to create a subscription or Recurring Payments.
I'm using the Merchant-SDK-PHP : https://github.com/paypal/merchant-sdk-php
Just in case someone want to know why i want to use Paypal's classic API, it's because the REST API does not have an option to hide the shipping address when creating a subscription, and Web Experience cannot be attached to a plan or an agreement.
It was confusing because when you are in the samples pages, there's no where you can find what you should do after getting the token using SetExpressCheckOut.php.
So to pass the token to CreateRecurringPaymentsProfile.php, at the end of SetExpressCheckOut.php you need to redirect the costumer to > https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=$token
Where the $token is the Token you got in SetExpressCheckOut.php using :
$setECResponse = $paypalService->SetExpressCheckout($setECReq);
$token = $setECResponse->Token;
Before redirecting make sure (in your SetExpressCheckOut.php) $setECReqDetails->ReturnURL refers to the link that will trigger CreateRecurringPaymentsProfile.php
In my case i'm using Laravel
$setECReqDetails->ReturnURL = "domain.com/createsub"
And my route is : Route::get('createsub', 'PaypalContoller#CreateRecurringPayments')
So within the CreateRecurringPayments method i put all the stuff from CreateRecurringPaymentsProfile.php example.
Note : when you go live you need to remove sandbox from the link : > https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=$token

PayPal ignores response to instant update callback

PayPal is ignoring the response to my instant update callback.
I'm on sandbox
I'm getting the callback
I'm returning the exact example result in the documentation
...and PayPal continues to show my default shipping fee
Here's what I return from the callback (the example response at the end of this page):
METHOD=CallbackResponse&OFFERINSURANCEOPTION=true&L_SHIPPINGOPTIONNAME0=UPS Next Day Air&L_SHIPPINGOPTIONAMOUNT0=20.00&L_TAXAMT0=2.20&L_INSURANCEAMOUNT0=1.51&L_SHIPPINGOPTIONISDEFAULT0=false&L_SHIPPINGOPTIONNAME1=UPS Express 2 Days&L_SHIPPINGOPTIONAMOUNT1=10.00&L_TAXAMT1=2.00&L_INSURANCEAMOUNT1=1.35&L_SHIPPINGOPTIONISDEFAULT1=true&L_SHIPPINGOPTIONNAME2=UPS Ground2 to 7 Days&L_SHIPPINGOPTIONAMOUNT2=9.99&L_TAXAMT2=1.99&L_INSURANCEAMOUNT2=1.28&L_SHIPPINGOPTIONISDEFAULT2=false
I've also tried a much simpler response with no change in effect:
L_SHIPPINGOPTIONAMOUNT0=20.00&OFFERINSURANCEOPTION=false&L_SHIPPINGOPTIONISDEFAULT0=true&L_SHIPPINGOPTIONNAME0=Standard+Domestic&METHOD=CallbackResponse
What could I possibly be doing wrong? I see the callback in my server log. This is baffling.
It seems like in the response from the above url one parameter is missing which is "L_SHIPPINGOPTIONLABEL0=somenamehere" .
Try updating your callback script to send the above variable also in the response to the PayPal and see if that works for you .
For everyone interested, here is the documentation of the "Callback Response Message". I was also searching for the documentation because of a missing parameter.
https://developer.paypal.com/docs/classic/api/merchant/Callback_API_Operation_NVP/

How to set up facebook callback url?

How do I setup a Canvas payments callback url? I only need to set up for static pricing at this time within my app. Facebook requires a Payments Object under "Realtime Updates" heading. I have been searching everywhere for a simple straight example on how to do the complete process but have not been able to find one. I have been working through the Unity3d Friendsmash example project.
I haven't found much information on the callback, but since I don't really use it, I just used this code inside a PHP script to just make it work:
$hub_mode = $_GET['hub_mode'];
$hub_challenge = $_GET['hub_challenge'];
$hub_verify_token = $_GET['hub_verify_token'];
if ($hub_verify_token =='YourToken')
{
echo $hub_challenge;
}
I found the problem! I was using Parse which does not host php pages. I put my file on my bluehost account and it now works! My app can now show the pay dialog on Facebook using the callback url I gave it.

Display users's email after purchase with Paypal Website Payments Standard

I have a simple button created with Paypal's Website Payments Standard, and I'm using the feature "Take customers to this URL when they finish checkout".
On that page which users are being redirected to when the purchase is successful (on my site) I'd like to simply display the email associated with their paypal purchase, telling them something like "an invoice will be sent to this email address: xxx".
Is that possible without using the API or IPN (which I'd rather avoid because it seems like I can't set different IPN urls for deifferent buttons/products.)
Ended up using PDT, there's a great example of how to simply do this here:
http://www.geekality.net/2010/10/19/php-tutorial-paypal-payment-data-transfers-pdt/
Thanks PP_MTS_Chad, I wouldn't have found it if it wasn't for you pointing out that option.
You could use 1 of 2 ways to get information back to your return URL, without having to use IPN or an API. You could use PDT to return information back to your site, or you could use the return method which uses the variable "rm". You can find more out about IPN here, and there are also some sample scripts you can use on that site as well.
If you want to use the return method, this is a little different from PDT. With the return method you do not have to post the information back to PayPal to verify it. If you wanted PayPal to post the information over to your return page you would just simply enable auto return in your account under your profile. Then you would just include the following lines of code in your button code.
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="http://www.mysite.com/return.php">
The variable "rm", controls how you want the information sent back to you. You can set it to be a GET or a POST.
Allowable values are:
0 – all shopping cart payments use the GET method
1 – the buyer's browser is redirected to the return URL by using the GET method, but no payment variables are included
2 – the buyer's browser is redirected to the return URL by using the POST method, and all payment variables are included
The default is 0.
Note: The rm variable takes effect only if the return variable is set.