Subversion Repositories SmartDukaan

Rev

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

Rev 7935 Rev 9338
Line 1... Line 1...
1
package in.shop2020.utils;
1
package in.shop2020.utils;
2
 
2
 
3
import in.shop2020.config.ConfigException;
3
import in.shop2020.config.ConfigException;
-
 
4
import in.shop2020.model.v1.inventory.WarehouseLocation;
4
import in.shop2020.thrift.clients.config.ConfigClient;
5
import in.shop2020.thrift.clients.config.ConfigClient;
5
 
6
 
6
import com.fedex.ship.stub.ClientDetail;
7
import com.fedex.ship.stub.ClientDetail;
7
import com.fedex.ship.stub.WebAuthenticationCredential;
8
import com.fedex.ship.stub.WebAuthenticationCredential;
8
import com.fedex.ship.stub.WebAuthenticationDetail;
9
import com.fedex.ship.stub.WebAuthenticationDetail;
Line 15... Line 16...
15
	public FedExShipAccountInfo(){
16
	public FedExShipAccountInfo(){
16
		clientDetail = new ClientDetail();
17
		clientDetail = new ClientDetail();
17
		wad = new WebAuthenticationDetail();
18
		wad = new WebAuthenticationDetail();
18
		endPointAddress = new String();
19
		endPointAddress = new String();
19
	}
20
	}
20
	public static FedExShipAccountInfo getFedExInfo(){
21
	public static FedExShipAccountInfo getFedExInfo(WarehouseLocation location){
21
		FedExShipAccountInfo fedexAccountInfo = new FedExShipAccountInfo();
22
		FedExShipAccountInfo fedexAccountInfo = new FedExShipAccountInfo();
22
		ClientDetail cd= new ClientDetail();
23
		ClientDetail cd= new ClientDetail();
23
		String accountNumber ="";
24
		String accountNumber ="";
24
        String meterNumber ="";
25
        String meterNumber ="";
25
		try {
26
		try {
-
 
27
			if(WarehouseLocation.Mumbai==location){
-
 
28
				accountNumber = ConfigClient.getClient().get("fedex_account_number_mumbai");
-
 
29
			}
-
 
30
			else{
26
			accountNumber = ConfigClient.getClient().get("fedex_account_number");
31
				accountNumber = ConfigClient.getClient().get("fedex_account_number");
-
 
32
			}
27
			meterNumber = ConfigClient.getClient().get("fedex_meter_number");
33
			meterNumber = ConfigClient.getClient().get("fedex_meter_number");
28
		} catch (ConfigException e) {
34
		} catch (ConfigException e) {
29
			e.printStackTrace();
35
			e.printStackTrace();
30
		}
36
		}
31
		cd.setAccountNumber(accountNumber);
37
		cd.setAccountNumber(accountNumber);