Subversion Repositories SmartDukaan

Rev

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

Rev 17782 Rev 18577
Line 18... Line 18...
18
	FAILED,		// HDFC status: NOT CAPTURED, DENIED BY RISK, HOST TIMEOUT, CANCELLED
18
	FAILED,		// HDFC status: NOT CAPTURED, DENIED BY RISK, HOST TIMEOUT, CANCELLED
19
	AUTHORIZED,  // EBS Status: Pending, HDFC Status: APPROVED
19
	AUTHORIZED,  // EBS Status: Pending, HDFC Status: APPROVED
20
	PARTIALLY_CAPTURED, //In case of COD
20
	PARTIALLY_CAPTURED, //In case of COD
21
	CAPTURE_IN_PROCESS, // In case first few attempts to capture failed due to transient connections issues
21
	CAPTURE_IN_PROCESS, // In case first few attempts to capture failed due to transient connections issues
22
	PROVISIONALLY_CAPTURED, // In case payment is not getting
22
	PROVISIONALLY_CAPTURED, // In case payment is not getting
23
	REFUNDED 
23
	REFUNDED,
-
 
24
	PENDING_APPROVAL 
24
}
25
}
25
 
26
 
26
// If new paymethod is added here, sales database for pentaho must also be updated.
27
// If new paymethod is added here, sales database for pentaho must also be updated.
27
const map<string,string> PAYMENT_METHOD = {
28
const map<string,string> PAYMENT_METHOD = {
28
	'1001' : 'EBS-TEST Payment'
29
	'1001' : 'EBS-TEST Payment'
Line 77... Line 78...
77
	'2008' : 'HDFC-VISA'
78
	'2008' : 'HDFC-VISA'
78
	'2017' : 'HDFC-MasterCard Credit Card'
79
	'2017' : 'HDFC-MasterCard Credit Card'
79
	'2018' : 'HDFC-MasterCard Debit Card'
80
	'2018' : 'HDFC-MasterCard Debit Card'
80
	'3000' : 'COD'
81
	'3000' : 'COD'
81
	'3001' : 'Coupon'
82
	'3001' : 'Coupon'
-
 
83
	'3500' : 'CapitalCredit'
82
	'2001' : 'Cheque'
84
	'2001' : 'Cheque'
83
	'1026' : 'EBS-ICICI Bank Debit Card'
85
	'1026' : 'EBS-ICICI Bank Debit Card'
84
    '1027' : 'EBS-SBI Debit Card'
86
    '1027' : 'EBS-SBI Debit Card'
85
    '2020' : 'HDFC Credit Card 3-month EMI'
87
    '2020' : 'HDFC Credit Card 3-month EMI'
86
    '5001' : 'HDFC Credit Card 3-month EMI'
88
    '5001' : 'HDFC Credit Card 3-month EMI'
Line 196... Line 198...
196
enum ExtraPaymentProcessingType {
198
enum ExtraPaymentProcessingType {
197
    FAILED_PAYMENTS,
199
    FAILED_PAYMENTS,
198
    PENDING_CAPTURE
200
    PENDING_CAPTURE
199
}
201
}
200
 
202
 
-
 
203
struct Creditor{
-
 
204
	1:i64 id,
-
 
205
	2:string name,
-
 
206
	3:bool active, 
-
 
207
	4:i64 created,
-
 
208
	5:i64 updated
-
 
209
}
-
 
210
 
-
 
211
struct UserSanction{
-
 
212
	1:i64 user_id, 
-
 
213
	2:i64 creditor_id, 
-
 
214
	3:string user_ref_id,
-
 
215
	4:double credit_limit, 
-
 
216
	5:double credit_blocked, 
-
 
217
	6:double loan, 
-
 
218
	7:bool active, 
-
 
219
	8:i64 created, 
-
 
220
	9:i64 updated
-
 
221
}
-
 
222
 
-
 
223
enum CreditTxnType{
-
 
224
	BLOCKED,
-
 
225
	BLOCK_REVERSED,
-
 
226
	LOAN,
-
 
227
	PAID
-
 
228
}
-
 
229
 
-
 
230
struct CreditHistory{
-
 
231
	1:i64 user_id,
-
 
232
	2:i64 creditor_id,
-
 
233
	3:i64 payment_id, 
-
 
234
	4:double  amount,
-
 
235
	5:CreditTxnType credittype, 
-
 
236
	6:i64 created, 
-
 
237
	7:i64 updated,  
-
 
238
	8:string loan_id, 
-
 
239
	9:string shipping_id,
-
 
240
	10:i64 dueDate
-
 
241
}
-
 
242
 
201
service PaymentService extends GenericService.GenericService{
243
service PaymentService extends GenericService.GenericService{
202
	/**
244
	/**
203
	create a new payment and return payment id, throws an exception if gateway is not active
245
	create a new payment and return payment id, throws an exception if gateway is not active
204
	*/
246
	*/
205
	i64 createPayment(1:i64 userId, 2:double amount, 3:i64 gatewayId, 4:i64 txnId, 5:bool isDigital) throws (1:PaymentException pe),
247
	i64 createPayment(1:i64 userId, 2:double amount, 3:i64 gatewayId, 4:i64 txnId, 5:bool isDigital) throws (1:PaymentException pe),
Line 333... Line 375...
333
     * category. This is currently used by CRM application.
375
     * category. This is currently used by CRM application.
334
     */
376
     */
335
    void markPaymentAsProcessed(1:i64 paymentId, 2:ExtraPaymentProcessingType category),
377
    void markPaymentAsProcessed(1:i64 paymentId, 2:ExtraPaymentProcessingType category),
336
    
378
    
337
    PaymentStatus getPaymentStatusAtGateway(1:i64 merchantTxnId, 2:double amount, 3:bool isDigital) throws (1:PaymentException pe)
379
    PaymentStatus getPaymentStatusAtGateway(1:i64 merchantTxnId, 2:double amount, 3:bool isDigital) throws (1:PaymentException pe)
-
 
380
    
-
 
381
    Creditor getCreditorInfo(1:i64 id, 2:string name)
-
 
382
    
-
 
383
    bool updateCreditorInfo(1:Creditor creditor) 
-
 
384
    
-
 
385
    list<UserSanction> getUserSanctionDetails(1:i64 userId)
-
 
386
    
-
 
387
    UserSanction getUserSanctionDetailsForCreditor(1:i64 userId, i64 creditorId)
-
 
388
    
-
 
389
    bool updateUserSanction(1:UserSanction userSanaction) throws (1:PaymentException pe)
-
 
390
    
-
 
391
    list<CreditHistory> getCreditHistoryRecordsForTransaction(1:i64 paymentId, 2:i64 creditorId, 3:string creditTxnType)
-
 
392
    
-
 
393
    list<CreditHistory> getCreditHistoryRecordsForUserAndCreditor(1:i64 userId, 2:string creditTxnType)
-
 
394
    
-
 
395
    bool processCreditTransaction(1:i64 paymentId, 2:list<CreditHistory> creditTxns) throws (1:PaymentException pe)
-
 
396
    
-
 
397
    list<CreditHistory> getLoanPayableForUserToCreditor(1:i64 userId, 2:i64 creditorId, 3:i64 dueDate)
338
}
398
}
339
399