Esempio n. 1
0
// send transaction details (call func based on op_code).
// success: SUCCESS
// failure: ERRNO_MP_INVALID_OPCODE
int transaction_send_details(transaction_t * tr) {
	// get op_code to determine type of transaction
	switch(tr->op_code) {
		case PURCHASE :
			transaction_send_purchase(tr->details);
			break;
		case RECHARGE :
			transaction_send_recharge(tr->details);
			break;
		case BALANCE :
			transaction_send_balance(tr->details);
			break;
		case HISTORY :
			transaction_send_history(tr->details);
			break;
		case ISSUE :
			transaction_send_issue(tr->details);
			break;
		case REFUND :
			transaction_send_refund(tr->details);
			break;
		default :
			return ERRNO_MP_INVALID_OPCODE;
	}
	return SUCCESS;
}
Esempio n. 2
0
// send transaction details (call func based on op_code).
// success: SUCCESS
// failure: ERRNO_MP_INVALID_OPCODE
int transaction_send_details(transaction_t * tr) {

#ifdef PATCHED
	// VULNERABLE CODE: the transaction does not have details in the AUTH phase
	if (tr->state == AUTH) {
		return SUCCESS;
	}
#endif
	// get op_code to determine type of transaction
	switch(tr->op_code) {
		case PURCHASE :
			transaction_send_purchase(tr->details);
			break;
		case RECHARGE :
			transaction_send_recharge(tr->details);
			break;
		case BALANCE :
			transaction_send_balance(tr->details);
			break;
		case HISTORY :
			transaction_send_history(tr->details);
			break;
		case ISSUE :
			transaction_send_issue(tr->details);
			break;
		case REFUND :
			transaction_send_refund(tr->details);
			break;
		default :
			return ERRNO_MP_INVALID_OPCODE;
	}
	return SUCCESS;
}