forked from PoundPay/poundpay-ruby
/
payments.rb
49 lines (45 loc) · 1.62 KB
/
payments.rb
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
module Poundpay
module PaymentFixture
def created_payment_attributes
{
"amount" => 20000,
"payer_fee_amount" => 0,
"payer_email_address" => "goliath@example.com",
"recipient_fee_amount" => 500,
"recipient_email_address" => "david@example.com",
"description" => "Beats by Dr. Dre",
"sid" => "PY1d82752a361211e0bce31231400042c7",
"state" => "CREATED",
"amount_to_credit_developer" => 550,
"updated_at" => "2011-02-11T19:07:05.332356Z",
"recipient_sid" => nil,
"payer_sid" => nil,
"developer_sid" => "DV8539761e250011e0a81d1231400042c7",
"poundpay_fee_amount" => 450,
"created_at" => "2011-02-11T19:07:05.332356Z",
"amount_to_credit_recipient" => 19500,
"amount_to_charge_payer" => 20000,
}
end
def authorized_payment_attributes
@attributes = created_payment_attributes
@attributes["state"] = "AUTHORIZED"
@attributes
end
def escrowed_payment_attributes
@attributes = created_payment_attributes
@attributes["state"] = "ESCROWED"
@attributes
end
def released_payment_attributes
@attributes = created_payment_attributes
@attributes["state"] = "RELEASED"
@attributes
end
def canceled_payment_attributes
@attributes = created_payment_attributes
@attributes["state"] = "CANCELED"
@attributes
end
end
end