Comments (6)
Dan,
I don't think it's a bug. It's more of a legacy feature we're working with. Please check the result for an "errors" array and you should see the "missing" messages. We did that for a few reasons. I agree that the 200 for a failed login is inappropriate, but it works really well with frameworks like backbone.js when you have views keying off changes in the cart.errors property.
Thanks,
Perry
from responsive_checkout.
Ah, sorry. I obviously didn't communicate myself well enough. I'm not getting any errors back at all. It's not the 200 that I'm suggesting is inappropriate (I think that's perfectly fine given what you're trying to accomplish with this api call). The issue is that the errors array inside the result is equal to null when I send a request that has empty values for email and password.
I get appropriate errors passed back to me (within the result's errors array) if either the email or the password are blank, but it comes back errorless if both the email and password are blank.
from responsive_checkout.
Hmmm, I've reviewed the code. Are you passing in nulls or empty string? Perchance you could post me the snippet of your call?
from responsive_checkout.
Empty strings. I've checked the cart object prior to sending the request to verify this. Here's my code:
app.data.cart.set({
'email' : jQuery.trim(jQuery('#email').val())
});
app.data.cart.set({
'password' : jQuery.trim(jQuery('#myMemberAccountPassword').val())
});
jQuery.ajax({
url : '/rest/cart/login',
type : 'POST', // Notice
async : false,
headers : {
"cache-control" : "no-cache"
},
contentType : 'application/json; charset=UTF-8',
data : JSON.stringify(app.data.cart),
dataType : 'json'
}).done(function(loggedInCart) {
if(loggedInCart.errors && loggedInCart.errors.length) { // Log-in errors
app.commonFunctions.displayCheckoutErrors(loggedInCart.errors);
console.log(loggedInCart.errors);
} else { // Customer logged in successfully
app.data.cart.set(loggedInCart, {silent: true});
app.data.cart.trigger('sync');
}
});
from responsive_checkout.
Dan,
The code was checking for nulls, not empty strings. ProdSupport pushed a fix to check for both. Would you kindly run your test again and report the results?
Thanks.
from responsive_checkout.
Bingo. :) Thanks.
from responsive_checkout.
Related Issues (20)
- Checkout Registration HOT 2
- Microsoft Edge HOT 3
- Turn Off Billing City / Zip Validation HOT 1
- CC Hosted Fields Iframes - Loads slow in some systems HOT 13
- Custom Receipt Page HOT 7
- Testing Credit Card Failed Attempt Limit Feature HOT 2
- Missing Hosted Fields (CC Number and CVV) HOT 10
- Order ID / Authorize Transaction ID Passed Back to Cart HOT 3
- Payment Declined but Receipt is generated in Ultracart HOT 2
- Using the new rest_proxy.php script with legacy catalog-structured merchant accounts HOT 3
- responsive_checkout HOT 13
- item.html
- I cant run commands giving error HOT 10
- Checkout is not working HOT 8
- upsell custom page setFinalizeAfter HOT 1
- How do I get the value of the credit card type HOT 3
- Load additional states/provinces when the country changes
- International Orders Outside US, Canada, Australia or Manual State/Province Method Needed HOT 2
- Delete Coupons Function
- credit card field values are missing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from responsive_checkout.