Subversion Repositories SmartDukaan

Rev

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

Rev 4141 Rev 4421
Line 15... Line 15...
15
	INIT,
15
	INIT,
16
	PENDING,
16
	PENDING,
17
	SUCCESS,	// HDFC Status: CAPTURED; EBS Status: Captured
17
	SUCCESS,	// HDFC Status: CAPTURED; EBS Status: Captured
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
-
 
22
	PROVISIONALLY_CAPTURED // In case payment is not getting 
21
}
23
}
22
 
24
 
23
// If new paymethod is added here, sales database for pentaho must also be updated.
25
// If new paymethod is added here, sales database for pentaho must also be updated.
24
const map<string,string> PAYMENT_METHOD = {
26
const map<string,string> PAYMENT_METHOD = {
25
	'1001' : 'EBS-TEST Payment'
27
	'1001' : 'EBS-TEST Payment'
Line 93... Line 95...
93
	15:string gatewayTxnDate,
95
	15:string gatewayTxnDate,
94
	16:list<Attribute> attributes,  	// list of all attributes received from PG
96
	16:list<Attribute> attributes,  	// list of all attributes received from PG
95
	17:i64 initTimestamp,			//statring the payment processing timestamp
97
	17:i64 initTimestamp,			//statring the payment processing timestamp
96
	18:i64 successTimestamp,		//timestamp when payment is captured
98
	18:i64 successTimestamp,		//timestamp when payment is captured
97
	19:i64 errorTimestamp,			// in case, error is received from PG
99
	19:i64 errorTimestamp,			// in case, error is received from PG
-
 
100
	20:i64 provisionalCaptureTimestamp // in case, error is received from PG
98
}
101
}
99
 
102
 
100
struct Refund{
103
struct Refund{
101
	1:i64 id,
104
	1:i64 id,
102
	2:i64 paymentId,
105
	2:i64 paymentId,
Line 114... Line 117...
114
	1:i64 error_code,
117
	1:i64 error_code,
115
	2:string message
118
	2:string message
116
}
119
}
117
 
120
 
118
enum ExtraPaymentProcessingType {
121
enum ExtraPaymentProcessingType {
119
    FAILED_PAYMENTS
122
    FAILED_PAYMENTS,
-
 
123
    PENDING_CAPTURE
120
}
124
}
121
 
125
 
122
service PaymentService extends GenericService.GenericService{
126
service PaymentService extends GenericService.GenericService{
123
	/**
127
	/**
124
	create a new payment and return payment id, throws an exception if gateway is not active
128
	create a new payment and return payment id, throws an exception if gateway is not active
Line 192... Line 196...
192
	*/	
196
	*/	
193
	i64 createRefund(1:i64 orderId, 2:i64 merchantTxnId, 3:double amount) throws (1:PaymentException pe),
197
	i64 createRefund(1:i64 orderId, 2:i64 merchantTxnId, 3:double amount) throws (1:PaymentException pe),
194
	
198
	
195
	/**
199
	/**
196
	Capture the payment for the given merchant transaction id. It processes the last payment for the given
200
	Capture the payment for the given merchant transaction id. It processes the last payment for the given
197
	transaction. If the capture attempt failed, the payment is marked as failed.
201
	transaction. If the capture attempt failed, the payment is marked as failed. PaymentException with error 
-
 
202
	code 104 is	thrown in case no payments are found for the transaction id passed.
-
 
203
	PaymentException is also thrown with error code 106 in case capture was not possible due to connection
-
 
204
	issue. Here, we	payment also gets updated to CAPTURE_INPROCESS state
198
	*/
205
	*/
199
	bool capturePayment(1:i64 merchantTxnId) throws (1:PaymentException pe),
206
	bool capturePayment(1:i64 merchantTxnId) throws (1:PaymentException pe),
200
	
207
	
201
	/**
208
	/**
202
	Adds the given amount to the captured amount of a COD payment.
209
	Adds the given amount to the captured amount of a COD payment.