Subversion Repositories SmartDukaan

Rev

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

Rev 6442 Rev 6806
Line 36... Line 36...
36
 
36
 
37
	private static Logger log = Logger.getLogger(Class.class);
37
	private static Logger log = Logger.getLogger(Class.class);
38
	
38
	
39
	private static String accountId;
39
	private static String accountId;
40
	
40
	
41
	private static String returnUrl = "http://www.shop2020.in/innoviti-pay-response";
41
	private static String returnUrl;
42
	
42
	
43
	private static String salt;
43
	private static String salt;
44
	
44
	
-
 
45
	private static String gatewayUrl;
-
 
46
	
-
 
47
	private static String subAccountId;
-
 
48
	
45
	static{
49
	static{
46
		try {
50
		try {
47
			accountId = ConfigClient.getClient().get("innoviti_account_id");
51
			accountId = ConfigClient.getClient().get("innoviti_account_id");
48
			returnUrl = ConfigClient.getClient().get("innoviti_return_url");
52
			returnUrl = ConfigClient.getClient().get("innoviti_return_url");
49
			salt = ConfigClient.getClient().get("innoviti_secret_key");
53
			salt = ConfigClient.getClient().get("innoviti_secret_key");
-
 
54
			subAccountId = ConfigClient.getClient().get("innoviti_sub_account_id");
-
 
55
			returnUrl = ConfigClient.getClient().get("innoviti_gateway_url");
50
		} catch (ConfigException e) {
56
		} catch (ConfigException e) {
51
			log.error("Unable to get Innoviti payment configuration.");
57
			log.error("Unable to get Innoviti payment configuration.");
52
		}
58
		}
53
	}
59
	}
54
	
60
	
Line 148... Line 154...
148
 
154
 
149
	public String getAccountId() {
155
	public String getAccountId() {
150
		return accountId;
156
		return accountId;
151
	}
157
	}
152
 
158
 
-
 
159
	public String getSubAccountId() {
-
 
160
		return subAccountId;
-
 
161
	}
-
 
162
 
153
	public static String getReturnUrl() {
163
	public static String getReturnUrl() {
154
		return returnUrl;
164
		return returnUrl;
155
	}
165
	}
156
 
166
 
-
 
167
	public String getGatewayUrl(){
-
 
168
		return gatewayUrl;
-
 
169
	}
-
 
170
 
157
	public double getAmount() {
171
	public double getAmount() {
158
		return amount;
172
		return amount;
159
	}
173
	}
160
 
174
 
161
	public void setPaymentOption(Payment payment) {
175
	public void setPaymentOption(Payment payment) {
Line 190... Line 204...
190
		return ProceedToPayController.getInterestRate(Long.parseLong(paymentOption));
204
		return ProceedToPayController.getInterestRate(Long.parseLong(paymentOption));
191
	}
205
	}
192
	
206
	
193
	public String getSecureHash() throws NoSuchAlgorithmException{
207
	public String getSecureHash() throws NoSuchAlgorithmException{
194
//		MD5(orderId "|" merchantId "|" subMerchantId "|" amt "|" cur "|" proSku "|" Cname "|" mobile "|" emailId "|" redirUrl "|" 123^~abc%) (Salt Value Decide by Merchant and uniPAY-Net))
208
//		MD5(orderId "|" merchantId "|" subMerchantId "|" amt "|" cur "|" proSku "|" Cname "|" mobile "|" emailId "|" redirUrl "|" 123^~abc%) (Salt Value Decide by Merchant and uniPAY-Net))
195
		String pass = id + "|" + accountId + "|" +  "3001"  + "|" + amount  + "|" +  "INR" + "|" + getDescription() + "|" +  billingDetails.getName() + "|" + billingDetails.getPhone() + "|" + billingDetails.getEmail() + "|" + returnUrl + "|" + salt;
209
		String pass = id + "|" + accountId + "|" +  subAccountId  + "|" + amount  + "|" +  "INR" + "|" + getDescription() + "|" +  billingDetails.getName() + "|" + billingDetails.getPhone() + "|" + billingDetails.getEmail() + "|" + returnUrl + "|" + salt;
196
		System.out.println(pass);
210
		System.out.println(pass);
197
		MessageDigest md = MessageDigest.getInstance("MD5");
211
		MessageDigest md = MessageDigest.getInstance("MD5");
198
		md.update(pass.getBytes(), 0, pass.getBytes().length);
212
		md.update(pass.getBytes(), 0, pass.getBytes().length);
199
		byte[] mdbytes = md.digest();
213
		byte[] mdbytes = md.digest();
200
		//	convert the byte to hex format method
214
		//	convert the byte to hex format method
Line 207... Line 221...
207
	
221
	
208
	public ContactDetails getBillingDetails() {
222
	public ContactDetails getBillingDetails() {
209
		return billingDetails;
223
		return billingDetails;
210
	}
224
	}
211
	
225
	
-
 
226
		
212
	public static void main(String[] args) throws NoSuchAlgorithmException {
227
	public static void main(String[] args) throws NoSuchAlgorithmException {
213
		//String pass = "410|1234567800|uniPAY|5985|INR|||||RedirectUrl|123^~abc%)";
228
		//String pass = "410|1234567800|uniPAY|5985|INR|||||RedirectUrl|123^~abc%)";
214
		//String pass = "113724|544433321212272|3001|3586|INR|Micromax Smarty A25 Black|Rajveer|1111111111|rajveer.singh@shop2020.in|http://www.shop2020.in/innoviti-pay-response|123^~uni%";
229
		//String pass = "113724|544433321212272|3001|3586|INR|Micromax Smarty A25 Black|Rajveer|1111111111|rajveer.singh@shop2020.in|http://www.shop2020.in/innoviti-pay-response|123^~uni%";
215
		String pass = "113734|544433321212272|3001|3586|INR|Micromax Smarty A25 Black|Rajveer|1111111111|rajveer.singh@shop2020.in|http://www.shop2020.in/innoviti-pay-response|123^~uni%";
230
		String pass = "113734|544433321212272|3001|3586|INR|Micromax Smarty A25 Black|Rajveer|1111111111|rajveer.singh@shop2020.in|http://www.shop2020.in/innoviti-pay-response|123^~uni%";
216
		//5fc923e520bce47ff14b3aa1a5245287
231
		//5fc923e520bce47ff14b3aa1a5245287