Yes !! If you are testing your service ... The token from service one ... Gets reused on the rest of the services and must be manually placed in there for testing
Yes !! If you are testing your service ... The token from service one ... Gets reused on the rest of the services and must be manually placed in there for testing
However ( not at my desk ) ... Keep in mind that the second service cannot be tested in test mode ( tried to state that in the tutorial ) you have to write the code and test in from your code ( remember you are manually importing the response etc )
I'll try that and update you on my progress, thank you!
Update...my authorization is working now.. but now I am getting this internal service error (500) Here is what is coming up!
Here is my response and javascript...
Am I writing something wrong for the response...or the javascript...I assume (i'm not sure) that the request url is wrong? I'm sorry if I am pestering, this for my senior design project and this is the last part of it!
Kat,
No worries - I'll help as much as possible. I believe the additional information I need to help more is as follows:
In Image 1 - please show me what's on the preview tab.
In terms of the service_paypal_payment - your error is in the information you are sending - the whole challenge with getting the response is a different matter. So - from Service_paypal_payment - please show the mapping that's in the before send event.
Your console log would also be helpful. But - I noticed you have not added the logging to that I suggested in the tutorial to any of the events. Please do that - it's almost essential in terms of debugging these problems. (put logging in ALL the service events - before, success, error and complete).
Put error logging in your error event where the error you are getting is logged to the console. (Select Error - Add Javascript and then add code there something like this:):
console.log('error in service_paypal_payment'); // or whatever the service name is....
try {
console.log(JSON.parse(jqXHR.responseText).description + " " + textStatus);
alert(JSON.parse(jqXHR.responseText).description);
}
catch (e) {
alert( cMessage );
}
In terms of BEST practices =
better yet put a call to a function in the error event where you pass the parameters from the error event - to a Javascript that is NOT in the the service call (Create new (green button) Javascript - and then add that code above - in that file, and call it from your error method.
What that lets you do - is set a breakpoint - when the error occurs - and you can see through your Chrome browser - variable status's etc. It's the only way to fly to debug these sorts of issues.
Add the logging, provide the screen prints requested above, set a breakpoint in your new error service so when the error 500 raises - you can via the console talk to the application and see what the variables and error conditions really are - and then we can take the next step.
Best,
Bruce
Kat, for clarity - on the error topic - in your service, error event, click down arrow, add Javascript - and in that javascript put this code:
flog_error(jqXHR, textStatus, errorThrown, "Error in service_paypal_payment" );
In a separate JS file - that you create by doing this:
Put this code:
function flog_error(jqXHR, textStatus, errorThrown, cMessage ){
console.log('you ended up in the generic flog_error');
try {
console.log(JSON.parse(jqXHR.responseText).description + " " + textStatus);
alert(JSON.parse(jqXHR.responseText).description);
}
catch (e) {
alert( cMessage );
}
}
and then set a breakpoint - prior to execution of the service_paypal_payment method - on line 2 above ( console.log.... line)
so - still more questions - but - one thing that I can't make heads or tails of here - is that your service requests seem to have an additional character in them .... please look at the UI that you provided above - and can you tell me what the character is at the end of each of the variables in the service request?
The variable for intent should be just like it's this "sale" - but it looks like you have an extraneous 'new-line' or "carriage return" symbol at the end of each?
That's also troubling because your console log shows that the value of the authorization token is "Bearer and then on a totally new line - I see the authorization token - when it should look like this:
Bearer A015eX6xw....PNy08
all on one line - or wrapped.....
So - please show the Javascript behind the blue button on the Authorization on the request side (right) above in your next response.
Also -
Perhaps that's nothing - can you also possibly show me your version of this screen (its the service called "PayPalPayment" - the request tab
as well as your PayPalSettings Service - the tab with the variables and the defaults .
Best,
Bruce
Also - there are a number of posts on the PayPal site - that complain about getting this error - when the descrption exceeds 127 characters. How long is the variable in that field? (show the JS there as well - and the JS for the currency. )
While you are at it - tell me what you are passing as 'Total" - is it a numeric value - or does it have a $ in it??
Best,
Bruce