-
Notifications
You must be signed in to change notification settings - Fork 0
/
Transaction.cs
78 lines (72 loc) · 2.32 KB
/
Transaction.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace HowMuchTo.Models
{
public enum TransactionType
{
Unknown,
AddFundsToCustomerBalance,
RemoveFundsFromCustomerBalance
}
public enum TransactionReason
{
Unknown,
CustomerAddedFunds,
CustomerPaidBounty,
CustomerAwardedBounty,
CustomerRequestedRefund,
CustomerChargeback,
Other,
CustomerWithdraw
}
public enum TransactionSource
{
Unknown,
FundedFromBillingProcessor,
FundedFromBalance,
Other
}
public enum TransactionState
{
Unknown,
Successful,
PendingFunds,
PendingInternalTransfer,
ProcessorRetry,
ProcessorDecline
}
public class TransactionGroup
{
public string UniqueID { get; set; }
public long ChallengeID { get; set; }
public string ChallengeStatusID { get; set; }
public decimal TotalAmount { get; set; }
}
/*
* When a transaction is processed, if the debit account is at $0,
* we automatically try to fund it from their funding source and
* put the transaction into Pending until it clears.
*
* If they had the money in their balance, we clear it automatically
* and put a null ForeignTransactionID.
* */
public class Transaction
{
public long ID { get; set; }
public string TransactionBatchID { get; set; }
public long DebitCustomerID { get; set; } // who are we getting the money from?
public long CreditCustomerID { get; set; } // who are we giving the money to?
public TransactionType Type { get; set; }
public decimal Amount { get; set; }
public TransactionReason Reason { get; set; }
public TransactionSource Source { get; set; }
public long AgentID { get; set; }
public string Comment { get; set; }
public TransactionState State { get; set; }
public string ForeignTransactionID { get; set; } // ie Stripe Transaction ID, merchant auth code
public int BillingProcessorType { get; set; } // ie Stripe, PayPal
public long BidID { get; set; }
}
}