Subversion Repositories SmartDukaan

Rev

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

Rev 8267 Rev 8269
Line 39... Line 39...
39
	public static void main(String... args){
39
	public static void main(String... args){
40
		/************************************************************************
40
		/************************************************************************
41
		 * Access Key ID and Secret Access Key ID, obtained from:
41
		 * Access Key ID and Secret Access Key ID, obtained from:
42
		 * http://aws.amazon.com
42
		 * http://aws.amazon.com
43
		 ***********************************************************************/
43
		 ***********************************************************************/
44
		/*final String accessKeyId = "AKIAII3SGRXBJDPCHSGQ";
44
		final String accessKeyId = "AKIAII3SGRXBJDPCHSGQ";
45
		final String secretAccessKey = "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";
45
		final String secretAccessKey = "B92xTbNBTYygbGs98w01nFQUhbec1pNCkCsKVfpg";
46
 
46
 
47
		final String appName = "Test";
47
		final String appName = "Test";
48
		final String appVersion = "1.0";
48
		final String appVersion = "1.0";
49
		final String merchantId = "AF6E3O0VE0X4D";
49
		final String merchantId = "AF6E3O0VE0X4D";
50
 
50
 
51
		MarketplaceWebServiceConfig config = new MarketplaceWebServiceConfig();
51
		MarketplaceWebServiceConfig config = new MarketplaceWebServiceConfig();
52
 
52
 
53
		*//************************************************************************
53
		/************************************************************************
54
		 * Uncomment to set the appropriate MWS endpoint.
54
		 * Uncomment to set the appropriate MWS endpoint.
55
		 ************************************************************************//*
55
		 ************************************************************************/
56
		// US
56
		// US
57
		// config.setServiceURL("https://mws.amazonservices.com");
57
		// config.setServiceURL("https://mws.amazonservices.com");
58
		// UK
58
		// UK
59
		// config.setServiceURL("https://mws.amazonservices.co.uk");
59
		// config.setServiceURL("https://mws.amazonservices.co.uk");
60
		// Germany
60
		// Germany
Line 70... Line 70...
70
		// Canada
70
		// Canada
71
		// config.setServiceURL("https://mws.amazonservices.ca");
71
		// config.setServiceURL("https://mws.amazonservices.ca");
72
		// India
72
		// India
73
		config.setServiceURL("https://mws.amazonservices.in");
73
		config.setServiceURL("https://mws.amazonservices.in");
74
 
74
 
75
		*//************************************************************************
75
		/************************************************************************
76
		 * You can also try advanced configuration options. Available options are:
76
		 * You can also try advanced configuration options. Available options are:
77
		 *
77
		 *
78
		 *  - Signature Version
78
		 *  - Signature Version
79
		 *  - Proxy Host and Proxy Port
79
		 *  - Proxy Host and Proxy Port
80
		 *  - User Agent String to be sent to Marketplace Web Service
80
		 *  - User Agent String to be sent to Marketplace Web Service
81
		 *
81
		 *
82
		 ***********************************************************************//*
82
		 ***********************************************************************/
83
 
83
 
84
		*//************************************************************************
84
		/************************************************************************
85
		 * Instantiate Http Client Implementation of Marketplace Web Service        
85
		 * Instantiate Http Client Implementation of Marketplace Web Service        
86
		 ***********************************************************************//*
86
		 ***********************************************************************/
87
 
87
 
88
		MarketplaceWebService service = new MarketplaceWebServiceClient(
88
		MarketplaceWebService service = new MarketplaceWebServiceClient(
89
				accessKeyId, secretAccessKey, appName, appVersion, config);
89
				accessKeyId, secretAccessKey, appName, appVersion, config);
90
 
90
 
91
		*//************************************************************************
91
		/************************************************************************
92
		 * Uncomment to try out Mock Service that simulates Marketplace Web Service 
92
		 * Uncomment to try out Mock Service that simulates Marketplace Web Service 
93
		 * responses without calling Marketplace Web Service  service.
93
		 * responses without calling Marketplace Web Service  service.
94
		 *
94
		 *
95
		 * Responses are loaded from local XML files. You can tweak XML files to
95
		 * Responses are loaded from local XML files. You can tweak XML files to
96
		 * experiment with various outputs during development
96
		 * experiment with various outputs during development
97
		 *
97
		 *
98
		 * XML files available under com/amazonaws/mws/mock tree
98
		 * XML files available under com/amazonaws/mws/mock tree
99
		 *
99
		 *
100
		 ***********************************************************************//*
100
		 ***********************************************************************/
101
		// MarketplaceWebService service = new MarketplaceWebServiceMock();
101
		// MarketplaceWebService service = new MarketplaceWebServiceMock();
102
 
102
 
103
		*//************************************************************************
103
		/************************************************************************
104
		 * Setup request parameters and uncomment invoke to try out 
104
		 * Setup request parameters and uncomment invoke to try out 
105
		 * sample for Request Report 
105
		 * sample for Request Report 
106
		 ***********************************************************************//*
106
		 ***********************************************************************/
107
 
107
 
108
		*//************************************************************************
108
		/************************************************************************
109
		 * Marketplace and Merchant IDs are required parameters for all 
109
		 * Marketplace and Merchant IDs are required parameters for all 
110
		 * Marketplace Web Service calls.
110
		 * Marketplace Web Service calls.
111
		 ***********************************************************************//*
111
		 ***********************************************************************/
112
		// marketplaces from which data should be included in the report; look at the
112
		// marketplaces from which data should be included in the report; look at the
113
		// API reference document on the MWS website to see which marketplaces are
113
		// API reference document on the MWS website to see which marketplaces are
114
		// included if you do not specify the list yourself
114
		// included if you do not specify the list yourself
115
		final IdList marketplaces = new IdList(Arrays.asList(
115
		final IdList marketplaces = new IdList(Arrays.asList(
116
		"A21TJRUUN4KGV"));        
116
		"A21TJRUUN4KGV"));        
Line 154... Line 154...
154
		returnsReportRequest.setStartDate(startDate);
154
		returnsReportRequest.setStartDate(startDate);
155
		returnsReportRequest.setEndDate(endDate2);
155
		returnsReportRequest.setEndDate(endDate2);
156
 
156
 
157
		Map<String,String> requestIdReturnsReportIdmap;
157
		Map<String,String> requestIdReturnsReportIdmap;
158
 
158
 
159
		List<String> fbaCustomersEmails  = new ArrayList<String>();*/
159
		List<String> fbaCustomersEmails  = new ArrayList<String>();
160
		///Request report
160
		///Request report
161
 
161
 
162
		String emailBody= "Dear Customer, <br><br>" +
162
		String emailBody= "Dear Customer, <br><br>" +
163
		"Thank you very much for shopping with Saholic at Amazon.in .<br><br>"+
163
		"Thank you very much for shopping with Saholic at Amazon.in .<br><br>"+
164
		"We hope that you are happy with your purchase and if you are, please spare some time to leave positive feedback for us.<br><br>" +
164
		"We hope that you are happy with your purchase and if you are, please spare some time to leave positive feedback for us.<br><br>" +
Line 170... Line 170...
170
		"Please do not leave any negative feedback. If you have any problems or concerns about your recent purchase, please get in touch with our customer service as soon as possible and we will do everything we can to help.<br><br>" +
170
		"Please do not leave any negative feedback. If you have any problems or concerns about your recent purchase, please get in touch with our customer service as soon as possible and we will do everything we can to help.<br><br>" +
171
		"Yours Sincerely,<br>" +
171
		"Yours Sincerely,<br>" +
172
		"Saholic Team<br>";
172
		"Saholic Team<br>";
173
 
173
 
174
		String emailIdFrom= "help@saholic.com";
174
		String emailIdFrom= "help@saholic.com";
175
				
175
		
176
		/*
176
		
-
 
177
 
177
		String shipmentReportRequestId = RequestReportSample.invokeRequestReport(service, fullfilledShipmentReportRequest);
178
		String shipmentReportRequestId = RequestReportSample.invokeRequestReport(service, fullfilledShipmentReportRequest);
178
		String returnsReportRequestId = RequestReportSample.invokeRequestReport(service, returnsReportRequest);
179
		String returnsReportRequestId = RequestReportSample.invokeRequestReport(service, returnsReportRequest);
179
		while(true){
180
		while(true){
180
			GetReportListRequest requestShipmentReportList = new GetReportListRequest();
181
			GetReportListRequest requestShipmentReportList = new GetReportListRequest();
181
			requestShipmentReportList.setMerchant( merchantId );
182
			requestShipmentReportList.setMerchant( merchantId );
Line 280... Line 281...
280
					Thread.sleep(5*60*1000);
281
					Thread.sleep(5*60*1000);
281
				} catch (InterruptedException e) {
282
				} catch (InterruptedException e) {
282
					log.error("Error During getting Response :- ", e);
283
					log.error("Error During getting Response :- ", e);
283
				}
284
				}
284
			}
285
			}
285
		}*/
286
		}
286
 
287
 
287
		HelperClient helperServiceClient;
288
		HelperClient helperServiceClient;
288
		try {
289
		try {
289
			helperServiceClient = new HelperClient();
290
			helperServiceClient = new HelperClient();
290
			in.shop2020.utils.HelperService.Client client = helperServiceClient.getClient();
291
			in.shop2020.utils.HelperService.Client client = helperServiceClient.getClient();
291
			System.out.print("Email Id List: \n");
292
			System.out.print("Email Id List: \n");
292
			//for(int i=0; i<fbaCustomersEmails.size();i++){
293
			for(int i=0; i<fbaCustomersEmails.size();i++){
293
				//System.out.print(fbaCustomersEmails.get(i)+"\n");
294
				System.out.print(fbaCustomersEmails.get(i)+"\n");
294
				client.saveUserEmailForSending(Arrays.asList(new String[] {"manish.sharma@shop2020.in"}), emailIdFrom, "Feedback Request", emailBody, "AmazonMFN", "AmazonFeedback", Arrays.asList(new String[] {" "}), Arrays.asList(new String[] {"manish.sharma@shop2020.in"}), 1);
295
				client.saveUserEmailForSending(Arrays.asList(new String[] {fbaCustomersEmails.get(i)}), emailIdFrom, "Feedback Request", emailBody, "AmazonMFN", "AmazonFeedback", null, Arrays.asList(new String[] {"amit.sirohi@shop2020.in"}), 1);
295
			//}
296
			}
296
		} catch (Exception e) {
297
		} catch (Exception e) {
297
			log.error("Error Getting Helper Client :- ", e);
298
			log.error("Error Getting Helper Client :- ", e);
298
		}
299
		}
299
 
300
 
300
 
301