Subversion Repositories SmartDukaan

Rev

Rev 9783 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7935 manish.sha 1
package in.shop2020.utils;
2
 
3
import in.shop2020.config.ConfigException;
9338 manish.sha 4
import in.shop2020.model.v1.inventory.WarehouseLocation;
7935 manish.sha 5
import in.shop2020.thrift.clients.config.ConfigClient;
6
 
7
import com.fedex.ship.stub.ClientDetail;
8
import com.fedex.ship.stub.WebAuthenticationCredential;
9
import com.fedex.ship.stub.WebAuthenticationDetail;
10
 
11
public class FedExShipAccountInfo {
12
	private ClientDetail clientDetail;
13
	private WebAuthenticationDetail wad;
14
	private String endPointAddress;
15
 
16
	public FedExShipAccountInfo(){
17
		clientDetail = new ClientDetail();
18
		wad = new WebAuthenticationDetail();
19
		endPointAddress = new String();
20
	}
19422 manish.sha 21
	public static FedExShipAccountInfo getFedExInfo(){
7935 manish.sha 22
		FedExShipAccountInfo fedexAccountInfo = new FedExShipAccountInfo();
23
		ClientDetail cd= new ClientDetail();
24
		String accountNumber ="";
25
        String meterNumber ="";
9783 manish.sha 26
        String key="";
27
        String password="";
7935 manish.sha 28
		try {
19422 manish.sha 29
			accountNumber = ConfigClient.getClient().get("fedex_account_number");
30
			meterNumber = ConfigClient.getClient().get("fedex_meter_number");
31
			key = ConfigClient.getClient().get("fedex_authenication_key");
32
			password = ConfigClient.getClient().get("fedex_authenication_password");
9774 manish.sha 33
			System.out.println("accountNumber .... "+accountNumber);
34
			System.out.println("meterNumber .... "+meterNumber);
7935 manish.sha 35
		} catch (ConfigException e) {
36
			e.printStackTrace();
37
		}
38
		cd.setAccountNumber(accountNumber);
39
		cd.setMeterNumber(meterNumber);
40
		WebAuthenticationCredential wac = new WebAuthenticationCredential();
9783 manish.sha 41
 
7935 manish.sha 42
        wac.setKey(key);
43
        wac.setPassword(password);
44
        WebAuthenticationDetail wa_details= new WebAuthenticationDetail(wac);
45
        String endPoint="";
46
		try {
9783 manish.sha 47
			endPoint = ConfigClient.getClient().get("fedex_endpoint_address_ship");
7935 manish.sha 48
		} catch (ConfigException e) {
49
			e.printStackTrace();
50
		}
51
		fedexAccountInfo.setClientDetail(cd);
52
		fedexAccountInfo.setWad(wa_details);
53
		fedexAccountInfo.setEndPointAddress(endPoint);
54
		return fedexAccountInfo;
55
	}
56
 
57
	public ClientDetail getClientDetail() {
58
		return clientDetail;
59
	}
60
 
61
	public void setClientDetail(ClientDetail clientDetail) {
62
		this.clientDetail = clientDetail;
63
	}
64
 
65
	public WebAuthenticationDetail getWad() {
66
		return wad;
67
	}
68
 
69
	public void setWad(WebAuthenticationDetail wad) {
70
		this.wad = wad;
71
	}
72
 
73
	public String getEndPointAddress() {
74
		return endPointAddress;
75
	}
76
 
77
	public void setEndPointAddress(String endPointAddress) {
78
		this.endPointAddress = endPointAddress;
79
	}
80
}