Paypal NVP and classic asp - paypal

i have used the paypal nvp (name value pair) in sandbox. all worked. when the client approved to go live. i have changed the url, username, password... all seems fine.
but...
adding to cart on the site and sending to paypal with server side MSXML2.ServerXMLHTTP with method "SetExpressCheckou" work. i get the token. than getting back from paypal and executing "GetExpressCheckoutDetails" works. on same page load i then need to execute "DoExpressCheckoutPayment" but i get "opetation time out "
i have tried "WinHttp.WinHttpRequest.5.1" and tried setting timeout for the process or for the page or for the website in the IIS - nothing work stable as it should!
Set paypalHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
paypalHTTP.Open "POST", requestURL, False
paypalHTTP.Send requestPARMS
paypalHTTP.waitForResponse 5
what can be done here?

Related

Docusign Embedded Signing returnUrl issue

I am displaying an Embedded Signing view in an iFrame. I am able to get the embedded signing view to display correctly using templates. I am calling an internal service (server-side) from the client (browser) and the internal service calls the Post Recipient View endpoint in the Docusign API.
In order to redirect the user to the correct view in my web app after the Signing view redirects to the returnUrl, I need to have query string parameters on the returnUrl. Here is an example of the returnUrl:
{
...
"returnUrl": "http://localhost:5000/#/my/path/redirect?sname=MY_VALUE&debug=foo,baz"
}
I am using the sname query parameter to hold the value for a string I will use to route to a view once the user is redirected from the Docusign Signing view.
The Problem:
When the iframe is redirected to the returnUrl after the Signing view is complete, the query string in the returnUrl is cutoff and the url of the iframe is:
http://localhost:5000/#/my/path/redirect?sname
when it should be
http://localhost:5000/#/my/path/redirect?sname=MY_VALUE&debug=foo,baz
I also read in the api documentation that an event parameter should also be present in the query string when redirecting, but that is not there either.
Is there a step that I am missing or is this a bug in the api?
I've tried a few tests using Postman and the resulting returnUrl is working for me. I even tried using yours directly (even though I obviously won't be able to connect to it) and it came up correctly as
http://localhost:5000/#/my/path/redirect?sname=MY_VALUE&debug=foo,baz&event=signing_complete
I even tried using an iframe for the signing session like you, still seems to be using the right URL when it redirects. So I've not been able to replicate your problem.
Are you attempting this in the demo environment?

Which URL made the request to my Google Apps Script?

How can I determine the source URL of a GET or POST request sent to a Google Apps Script web application?
I am making a (PayPal IPN) listener script and would like to be able to distinguish weather the request came from a the test environment (sandbox) or from the live environment.
The origin of the request to the listener determines the response from the script. The listener has to send a response back to PayPal and depending on which environment the request came from, the response needs to go back either to the sandbox server or to the live server.
I am hoping to distinguish between requests from sandbox.paypal.com or www.paypal.com, in my Google Apps Script.
To work around this requirement, I have set it manually for now:
if (PPRunMode == 'test') {//in testmode send response to sandbox site
PPUrlBase = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
else {//url for live website
PPUrlBase = "https://www.paypal.com/cgi-bin/webscr";
}
But was wondering if this can be determined automatically.
Unfortunately, no request-source information is provided to your Google Apps Script web application, so there is no direct way to determine where a request came from.
You do have the ability to provide parameters to your web app, though, so you could have the code in the sandboxed environment use that to indicate a test condition.
For example, this URL could be used by the sandboxed code for a GET request:
https://script.google.com/macros/s/---SCRIPT-ID---/exec?test=true
^^^^^^^^^^
In the doGet(e) function, you would handle the parameter like this:
function doGet(e) {
if (e.parameter.test) { //in testmode send response to sandbox site
PPUrlBase = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
else {//url for live website
PPUrlBase = "https://www.paypal.com/cgi-bin/webscr";
}
...
}
For a POST request, the solution is similar. See URL parameters in the Web Apps and Google Sites Gadgets guide for details.
If you publish your Google App Script you get two urls :
https://script.google.com/macros/s/AKfycbxsCNyssA0dzMMmsNip3DW66hiJ62ks_F1yYUn0SDu073S2dOw/exec
https://script.google.com/macros/s/AKfycbxzpvZ9e9_vzs3d6Q0ky_RHLoYDruCl-6Xm8D6YmI4/dev
You can notice the difference, not sure if that is what you are pointing to

Has anybody gotten PAYMENTREQUEST_0_DESC to work in the PayPal API?

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).

Connecting to Paypal Rest Api to obtain users consent

I am trying to connect to Paypal to get a users consent to access their paypal payment history. The end goal would be to download payments received at the end of the day and take the info and dump it into a local database.
https://developer.paypal.com/webapps/developer/docs/api/#obtain-users-consent
<Cfset returnlink="http://www.xxxxxx.com/paypal/paypalreturn.cfm">
<cfset paypalLink="https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize">
<Cfset paypallink="#paypallink#?client_id=#settingsLive.clientid#">
<Cfset paypallink="#paypallink#&redirect_uri=#urlencodedformat(returnlink)#">
<Cfset paypallink="#paypallink#&response_type=code">
<Cfset paypallink="#paypallink#&scope=profile+email+address+phone+https%3A%2F%2Furi.paypal.com%2Fservices%2Fpaypalattributes">
<cfset paypalLink="#paypallink#&nonce=#createUUID()#">
<cfset paypalLink="#paypallink#&state=create">
Login with paypal
Clicking on the link below returns:
Relying Party Validation error: redirect_uri provided in the request
does not match with the registered redirect_uri. Please check the
request.
I have logged into the Rest API, modified my app and made sure the redirect uri's for the test and live return link match that listed above. I have also made sure that the accept logins options are checked.
I have also tried the same code against their sandbox URL:
https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize
and instead of receiving the validation error, I get a page cannot be displayed.
I've tried every combination of things that I could think of
1) removing 1 cfset statement at a time to isolate a bad variable
2) making sure the return uri was a https vs http
3) switching to sandbox mode url and back
I've connected to other oauth2 api's in the past, but can't figure this one out.
This has changed a bit, and will presumably change again soon... but here's how you do this now.
Log into developer.paypal.com
Click on Dashboard (https://developer.paypal.com/developer/applications)
Click your app name under "Rest API Apps"
Scroll to the box at the bottom of the screen labeled "Sandbox (or Live) App Settings
Set the Return URL (Where users will be redirected after test transactions)
Click save
NOTE
This Return URL must exactly match the redirect_uri that you pass in via querystring (so it's confusing as to why you'd need to pass it in in the first place)
GOTCHA
At this point in time, the Return URL can seemingly never be updated. In my recent experience, if you don't type it correctly the first time you save it, you will have to create a new app.
The only time I have seen this error is when your redirect_uri does not match the one set in your applications profile.
You need to set this value inside of your app on the developer website.
Log into developer.paypal.com
Click Applications
Under My Rest Apps click your App name
Click Edit next to App redirect URLs
Set the return URLs for live or test
Save
I am also unable to get sandbox to work for my Log In with PayPal tests so it is not just you.
As of now (October 2015), the Dashboard Return URL should correspond to the redirect_uri. You can obtain the redirect_uri parameter in Firefox, by downloading the HTTPFox browser plugin. Then you start HTTPFox, point your browser to the OmniAuth login link, and view the scParams in the query string in the bottom-most link in the HTTPFox history to obtain the redirect_uri.
You have to literally make sure the Return URL is the exact same sequence of characters as the input redirect_uri. For example, if one points to "localhost" and the other to "127.0.0.1", it won't recognize the redirect_uri value as the same. It also won't recognize redirect_uri if only one of the redirect_uri values has a final slash.
Yes, the return URL was able to be updated in my experience.

Payment validation got VERIFIED for web_accept transaction type but not for subscr_signup

We have been using "Post to return page" (rm = 2) as the way of receiving payment data for regular one time purchase (web_accept) and we have been getting "VERIFIED" fine when doing the validation. Recently we want to add a subscription-based product so I have been testing in the paypal sandbox and I am really baffled about what I did wrong for always getting INVALID when validating subscriptions (subscr_signup). The regular purchases returned VERIFIED in the sandbox just fine but not the subscriptions. It is the exact same piece of code for posting the validation, the same merchant/buyer combination...etc. Did I miss anything? Below is the common classic ASP code snippets which I have used. Please advise. Thanks
' read post from PayPal system and add 'cmd'
str = Request.Form & "&cmd=_notify-validate"
' post back to PayPal system to validate
'set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "https://www.sandbox.paypal.com/cgi-bin/webscr", false
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.Send str
There are some IPN issues that are currently effecting the live site. This issue that you are reporting sounds like it may be related to the issues. I would suggest opening up a ticket with PayPal's Merchant Technical Support team. This way we can look into the issue further and also notify you once the issue is resolved.