Subversion Repositories SmartDukaan

Rev

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

Rev 20650 Rev 20665
Line 1... Line 1...
1
package com.aramex.impl;
1
package com.aramex.impl;
2
 
2
 
3
import in.shop2020.model.v1.order.Order;
3
import in.shop2020.model.v1.order.Order;
4
import in.shop2020.model.v1.order.TransactionService.Client;
-
 
5
 
4
 
6
import java.util.Calendar;
5
import java.util.Calendar;
7
import java.util.List;
6
import java.util.List;
8
 
7
 
9
import com.aramex.stub.Address;
8
import com.aramex.stub.Address;
Line 105... Line 104...
105
		
104
		
106
		LabelInfo labelInfo = new LabelInfo();
105
		LabelInfo labelInfo = new LabelInfo();
107
		labelInfo.setReportID(9729);
106
		labelInfo.setReportID(9729);
108
		labelInfo.setReportType("URL");
107
		labelInfo.setReportType("URL");
109
		parameters.setLabelInfo(labelInfo);
108
		parameters.setLabelInfo(labelInfo);
110
		parameters.setClientInfo(getTestClientInfo());
109
		parameters.setClientInfo(getLiveClientInfo());
111
		parameters.setShipments(shipments);
110
		parameters.setShipments(shipments);
112
		
111
		
113
		
112
		
114
		ShipmentCreationResponse scr = service.createShipments(parameters);
113
		ShipmentCreationResponse scr = service.createShipments(parameters);
115
		if(scr.getHasErrors()){
114
		if(scr.getHasErrors()){
Line 124... Line 123...
124
		}
123
		}
125
		ProcessedShipment ps = scr.getShipments().getProcessedShipment(0);
124
		ProcessedShipment ps = scr.getShipments().getProcessedShipment(0);
126
		return ps.getID();
125
		return ps.getID();
127
	}
126
	}
128
	
127
	
129
	private static ClientInfo getTestClientInfo() {
128
	private static ClientInfo getLiveClientInfo() {
130
		ClientInfo clientInfo = new ClientInfo();
129
		ClientInfo clientInfo = new ClientInfo();
131
		clientInfo.setAccountCountryCode("IN");
130
		clientInfo.setAccountCountryCode("IN");
132
		clientInfo.setAccountNumber("DELTST002");
131
		clientInfo.setAccountNumber("50615758");
133
		clientInfo.setVersion("v1.0");	
132
		clientInfo.setVersion("v1.0");	
134
		clientInfo.setAccountEntity("DEL");
133
		clientInfo.setAccountEntity("DEL");
135
		clientInfo.setUserName("testingapi@aramex.com");
134
		clientInfo.setUserName("adonismobitrade@yahoo.com");
136
		clientInfo.setPassword("R123456789$r");
135
		clientInfo.setPassword("Adonis@12345");
137
		clientInfo.setAccountPin("231164");
136
		clientInfo.setAccountPin("321321");
138
		return clientInfo;
137
		return clientInfo;
139
	}
138
	}
140
	
139
	
-
 
140
	/*private static ClientInfo getTestClientInfo() {
-
 
141
		ClientInfo clientInfo = new ClientInfo();
-
 
142
		clientInfo.setAccountCountryCode("IN");
-
 
143
		clientInfo.setAccountNumber("50615758");
-
 
144
		clientInfo.setVersion("v1.0");	
-
 
145
		clientInfo.setAccountEntity("DEL");
-
 
146
		clientInfo.setUserName("adonismobitrade@yahoo.com");
-
 
147
		clientInfo.setPassword("Adonis@12345");
-
 
148
		clientInfo.setAccountPin("231164");
-
 
149
		return clientInfo;
-
 
150
	}*/
-
 
151
	
141
	private Party getTestShipper() {
152
	private Party getTestShipper() {
142
		Party shipper = new Party();
153
		Party shipper = new Party();
143
		shipper.setAccountNumber("DELTST002");
154
		shipper.setAccountNumber("50615758");
144
		Contact sc = new Contact();
155
		Contact sc = new Contact();
145
		sc.setEmailAddress("testingapi@aramex.com");
156
		sc.setEmailAddress("adonismobitrade@yahoo.com");
146
		sc.setCellPhone("9990381569");
157
		sc.setCellPhone("9311608716");
147
		sc.setCompanyName("TEST");
158
		sc.setCompanyName("Adonis Mobitrade Pvt Ltd");
148
		sc.setPersonName("Test");
159
		sc.setPersonName("Deenanath Gupta");
149
		sc.setPhoneNumber1("1234567890");
160
		sc.setPhoneNumber1("9311608716");
150
		shipper.setContact(sc);
161
		shipper.setContact(sc);
151
		Address shipperAddress = new Address();
162
		Address shipperAddress = new Address();
152
		shipperAddress.setLine1("Test");
163
		shipperAddress.setLine1("Plot No. 485, Udyog Vihar Phase V");
153
		shipperAddress.setCity("Ggn");
164
		shipperAddress.setCity("Gurgoan");
154
		shipperAddress.setCountryCode("IN");
165
		shipperAddress.setCountryCode("IN");
155
		shipperAddress.setPostCode("110001");
166
		shipperAddress.setPostCode("122016");
156
		shipper.setPartyAddress(shipperAddress);
167
		shipper.setPartyAddress(shipperAddress);
157
		return shipper;
168
		return shipper;
158
	}
169
	}
159
	
170
	
160
}
171
}