Subversion Repositories SmartDukaan

Rev

Rev 17350 | Rev 17357 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17350 Rev 17356
Line 84... Line 84...
84
                        resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
84
                        resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
85
                    else:
85
                    else:
86
                        raise
86
                        raise
87
                except:
87
                except:
88
                    try:
88
                    try:
89
                        if soup.h1.text.strip() in ['This is a duplicate order', 'There was a problem with your payment.', 'Your Orders', 'Your Shopping Cart is empty.', 'Select a payment method', 'Edit quantities'] or "Saved for later" in soup.h1.text.strip():
89
                        if soup.find("h1").text.strip() in ['This is a duplicate order', 'There was a problem with your payment.', 'Your Orders', 'Your Shopping Cart is empty.', 'Select a payment method', 'Edit quantities'] or "Saved for later" in soup.find("h1").text.strip():
90
                            resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
90
                            resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
91
                        else:
91
                        else:
92
                            raise
92
                            raise
93
                    except:
93
                    except:
94
                        try:
94
                        try:
95
                            if soup.h2.text.strip() in ['Web page not available','Webpage not available', 'Do you have an Amazon password?']:
95
                            if soup.find("h2").text.strip() in ['Web page not available','Webpage not available', 'Do you have an Amazon password?']:
96
                                resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
96
                                resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
97
                            else:
97
                            else:
98
                                raise
98
                                raise
99
                        except:
99
                        except:
100
                            try:
100
                            try:
Line 134... Line 134...
134
                            try:
134
                            try:
135
                                self.parseCancelled(merchantOrder, soup)
135
                                self.parseCancelled(merchantOrder, soup)
136
                                resp['result'] = 'ORDER_CANCELLED'
136
                                resp['result'] = 'ORDER_CANCELLED'
137
                            except:
137
                            except:
138
                                try:
138
                                try:
139
                                    if soup.h1.text.strip() in ["Your Account"] or soup.h1.span.text=="Account":
139
                                    if soup.find("h1").text.strip() in ["Your Account"] or soup.find("h1").span.text=="Account":
140
                                        resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
140
                                        resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
141
                                    else:
141
                                    else:
142
                                        raise
142
                                        raise
143
                                except:
143
                                except:
144
                                    if soup.find(id="ap_signin_pagelet_title").h1.text.strip()=="Sign In":
144
                                    if soup.find(id="ap_signin_pagelet_title").find("h1").text.strip()=="Sign In":
145
                                        resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
145
                                        resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
146
                                    else:
146
                                    else:
147
                                        raise
147
                                        raise
148
            except:
148
            except:
149
                order = self.db.merchantOrder.find_one({"orderId":orderId})
149
                order = self.db.merchantOrder.find_one({"orderId":orderId})