-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcommerce_funds.info.inc
179 lines (155 loc) · 6.04 KB
/
commerce_funds.info.inc
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/**
* @file
* Provides metadata for the commerce funds account and transaction entities.
*/
/**
* Implements hook_entity_property_info().
*/
function commerce_funds_entity_property_info() {
$info = array();
// Add meta-data about the basic commerce_product properties.
$account_properties = &$info['commerce_funds_account']['properties'];
$account_properties['id'] = array(
'label' => t('Commerce funds account ID'),
'description' => t('The internal numeric ID of the commerce funds account.'),
'type' => 'integer',
'schema field' => 'account_id',
);
$account_properties['uid'] = array(
'label' => t('Creator ID'),
'type' => 'user',
'description' => t('The unique ID of the commerce recurring entity creator.'),
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer commerce_funds entities',
'schema field' => 'uid',
);
$account_properties['currency_code'] = array(
'label' => t('Currency'),
'description' => t('The currency of the account.'),
'type' => 'text',
'schema field' => 'currency_code',
);
// Add meta-data about the basic commerce_product properties.
$transaction_properties = &$info['commerce_funds_transaction']['properties'];
$transaction_properties['id'] = array(
'label' => t('Commerce funds transaction ID'),
'description' => t('The internal numeric ID of the commerce funds transaction.'),
'type' => 'integer',
'schema field' => 'transaction_id',
);
$transaction_properties['uid'] = array(
'label' => t('Creator ID'),
'type' => 'user',
'description' => t('The unique ID of the commerce recurring entity creator.'),
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer commerce_funds entities',
'schema field' => 'uid',
);
$transaction_properties['account_id'] = array(
'label' => t('Commerce funds account ID'),
'description' => t('The internal numeric ID of the commerce funds account.'),
'type' => 'commerce_funds_account',
'schema field' => 'account_id',
);
$properties['type'] = array(
'label' => t('Type'),
'description' => t('The type of the commerce funds transaction.'),
'type' => 'token',
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer commerce_recurring entities',
'required' => TRUE,
'schema field' => 'type',
);
$transaction_properties['reference'] = array(
'label' => t('Reference data'),
'description' => t('In case of a transfer transaction this field will hold the user id of the destination user, same for escrow payment transactions.'),
'type' => 'text',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'schema field' => 'reference',
);
$transaction_properties['created'] = array(
'label' => t('Created'),
'description' => t('Time of creation.'),
'type' => 'date',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer commerce_recurring entities',
'schema field' => 'created',
);
$transaction_properties['currency_code'] = array(
'label' => t('Currency'),
'description' => t('The currency of the account.'),
'type' => 'text',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'schema field' => 'currency_code',
);
$transaction_properties['notes'] = array(
'label' => t('Notes'),
'description' => t('Comments.'),
'type' => 'text',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'schema field' => 'notes',
);
// Add meta-data about the basic commerce_funds_withdraw properties.
$withdraw_properties = &$info['commerce_funds_withdraw_requests']['properties'];
$withdraw_properties['request_id'] = array(
'label' => t('Commerce funds withdraw ID'),
'description' => t('The internal numeric ID of the commerce funds withdraws.'),
'type' => 'integer',
'schema field' => 'request_id',
);
$withdraw_properties['uid'] = array(
'label' => t('Creator ID'),
'type' => 'user',
'description' => t('The unique ID of the commerce recurring entity creator.'),
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer commerce_funds entities',
'schema field' => 'uid',
);
$withdraw_properties['created'] = array(
'label' => t('Created'),
'description' => t('Time of creation.'),
'type' => 'date',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer commerce_recurring entities',
'schema field' => 'created',
);
$withdraw_properties['method'] = array(
'label' => t('Payment Method'),
'description' => t('The currency of the account.'),
'type' => 'text',
'schema field' => 'method',
);
$withdraw_properties['currency_code'] = array(
'label' => t('Currency'),
'description' => t('The currency of the account.'),
'type' => 'text',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'schema field' => 'currency_code',
);
$withdraw_properties['status'] = array(
'label' => t('Status'),
'description' => t('The status of the withdraw request.'),
'options list' => 'commerce_funds_withdraw_requests',
'type' => 'text',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'options list' => 'commerce_funds_withdraw_status_options',
'schema field' => 'status',
);
$withdraw_properties['notes'] = array(
'label' => t('Notes'),
'description' => t('Notes for the withdraw request.'),
'type' => 'text',
'getter callback' => 'entity_property_verbatim_get',
'setter callback' => 'entity_property_verbatim_set',
'schema field' => 'notes',
);
return $info;
}