· 4 years ago · May 08, 2021, 03:52 PM
1def show
2 secret_key = Rails.application.credentials.development[:SECRET_KEY]
3 billId = 'cc96asas1e8d-d4d6-4f02-b789-2297e51fb48e'
4 endpoint = "https://api.qiwi.com/partner/bill/v1/bills/#{billId}"
5 life_time = Time.now + 3.days
6 data = {
7 "amount": {
8 "currency": "RUB",
9 "value": "1.00"
10 },
11 "comment": 'User email: ',
12 "expirationDateTime": "#{life_time.iso8601}"
13 }
14 headers = {
15 "Content-Type": 'application/json',
16 'Authorization': "Bearer #{secret_key}",
17 'Accept': 'application/json'
18 }
19 @response = HTTParty.put(endpoint, { "data": data, "headers": headers })
20
21 end