Subversion Repositories SmartDukaan

Rev

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

Rev 194 Rev 304
Line 41... Line 41...
41
        except:
41
        except:
42
            raise ConfigException(101, 'unable to load the client')
42
            raise ConfigException(101, 'unable to load the client')
43
    
43
    
44
    def createTransaction(self, transaction):
44
    def createTransaction(self, transaction):
45
        self.client.createTransaction(transaction)
45
        self.client.createTransaction(transaction)
-
 
46
        
-
 
47
    def createAlert(self, transaction_id, type, comment):
-
 
48
        self.client.setAlert(transaction_id, False, type, comment)
-
 
49
    
-
 
50
    def get_client(self):
-
 
51
        return self.client
46
    
52
    
47
if __name__ == '__main__':
53
if __name__ == '__main__':
48
    transaction_client = TransactionClient()
54
    transaction_client = TransactionClient()
49
    
55
    
50
    transaction = Transaction()
56
    transaction = Transaction()
Line 84... Line 90...
84
    shipment.weight = 2.42
90
    shipment.weight = 2.42
85
    shipment.lineitems = order_info.lineitems;
91
    shipment.lineitems = order_info.lineitems;
86
    shipment.insurance = 2;
92
    shipment.insurance = 2;
87
    shipment.value = 2.40
93
    shipment.value = 2.40
88
    shipment.status = ShipmentStatus.YET_TO_SHIP
94
    shipment.status = ShipmentStatus.YET_TO_SHIP
-
 
95
    shipment.address = "Ashish\nD-15-15,Ardee City,\nSector-52\nGurgaon\nHaryana\n122003"
89
    shipping_info.shipments.append(shipment)
96
    shipping_info.shipments.append(shipment)
90
    transaction.shipmentInfo = shipping_info
97
    transaction.shipmentInfo = shipping_info
91
    
98
    
92
    transaction_client.createTransaction(transaction)
99
    transaction_client.createTransaction(transaction)
93
    
100
    
-
 
101
    transaction_client.createAlert(2, 1, "Not yet shipped")
-
 
102
    
-
 
103
    transaction_client.get_client().setExtraInfo(2, 3, "E 71", "Black", "Nokia")
94
    
104
    
95
105