Skip to content

Commit ee434c2

Browse files
Merge pull request #43 from nguyenvanhuan243/Integrate-payments
Integrate payment crypto
2 parents 30fe0cc + 13ea392 commit ee434c2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

app/api/entities/v1/payment.rb

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class API::Entities::V1::Payment < API::Entities::V1::Base
2+
expose :id, documentation: { type: 'Integer', desc: 'Order ID.' }
3+
expose :created_at, documentation: { type: 'Datetime', desc: 'Created Of User.' }
4+
expose :user_id, documentation: { type: 'Integer', desc: 'User ID' }
5+
expose :payment_type, documentation: { type: 'Integer', desc: 'Command role' }
6+
expose :value, documentation: { type: 'Float', desc: 'Value' }
7+
expose :transaction_hash, documentation: { type: 'String', desc: 'Value' }
8+
expose :status, documentation: { type: 'Integer', desc: 'status' }
9+
expose :chain, documentation: { type: 'String', desc: 'Chain' }
10+
11+
def created_at
12+
object.created_at.strftime('%Y-%m-%d %H:%M:%S')
13+
end
14+
15+
def transaction_hash
16+
object.transaction_hash
17+
end
18+
19+
def chain
20+
if object.payment_type == "deposit"
21+
return "BEP20"
22+
end
23+
"NAN"
24+
end
25+
end

0 commit comments

Comments
 (0)