Class: KillBillClient::Model::InvoicePayment
Constant Summary
collapse
- KILLBILL_API_INVOICE_PAYMENTS_PREFIX =
"#{KILLBILL_API_PREFIX}/invoicePayments"
Constants included
from TagHelper
TagHelper::AUTO_INVOICING_OFF_ID, TagHelper::AUTO_PAY_OFF_ID, TagHelper::MANUAL_PAY_ID, TagHelper::OVERDUE_ENFORCEMENT_OFF_ID, TagHelper::TEST_ID, TagHelper::WRITTEN_OFF_ID
Class Method Summary
collapse
-
.chargeback(payment_id, amount, currency, effective_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
-
.chargeback_reversal(payment_id, transaction_external_key, effective_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
-
.find_by_id(payment_id, with_plugin_info = false, with_attempts = false, options = {}) ⇒ Object
-
.refund(payment_id, amount, adjustments = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Instance Method Summary
collapse
Methods included from TagHelper
#add_tag, #add_tag_from_definition_id, #control_tag?, included, #remove_tag, #remove_tag_from_definition_id, #set_tags
included
Class Method Details
.chargeback(payment_id, amount, currency, effective_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/killbill_client/models/invoice_payment.rb', line 45
def chargeback(payment_id, amount, currency, effective_date = nil, user = nil, reason = nil, = nil, options = {})
payload = InvoicePaymentTransactionAttributes.new
payload.amount = amount
payload.currency = currency
payload.effective_date = effective_date
invoice_payment = post "#{KILLBILL_API_INVOICE_PAYMENTS_PREFIX}/#{payment_id}/chargebacks",
payload.to_json,
{},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
invoice_payment.refresh(options)
end
|
.chargeback_reversal(payment_id, transaction_external_key, effective_date = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/killbill_client/models/invoice_payment.rb', line 62
def chargeback_reversal(payment_id, transaction_external_key, effective_date = nil, user = nil, reason = nil, = nil, options = {})
payload = InvoicePaymentTransactionAttributes.new
payload.transaction_external_key = transaction_external_key
payload.effective_date = effective_date
invoice_payment = post "#{KILLBILL_API_INVOICE_PAYMENTS_PREFIX}/#{payment_id}/chargebackReversals",
payload.to_json,
{},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
invoice_payment.refresh(options)
end
|
.find_by_id(payment_id, with_plugin_info = false, with_attempts = false, options = {}) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/killbill_client/models/invoice_payment.rb', line 18
def find_by_id(payment_id, with_plugin_info = false, with_attempts = false, options = {})
get "#{KILLBILL_API_INVOICE_PAYMENTS_PREFIX}/#{payment_id}",
{
:withAttempts => with_attempts,
:withPluginInfo => with_plugin_info
},
options
end
|
.refund(payment_id, amount, adjustments = nil, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/killbill_client/models/invoice_payment.rb', line 27
def refund(payment_id, amount, adjustments = nil, user = nil, reason = nil, = nil, options = {})
payload = InvoicePaymentTransactionAttributes.new
payload.amount = amount
payload.is_adjusted = !adjustments.nil?
payload.adjustments = adjustments
invoice_payment = post "#{KILLBILL_API_INVOICE_PAYMENTS_PREFIX}/#{payment_id}/refunds",
payload.to_json,
{},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
invoice_payment.refresh(options)
end
|
Instance Method Details
#bulk_create(external_payment = false, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/killbill_client/models/invoice_payment.rb', line 93
def bulk_create(external_payment = false, user = nil, reason = nil, = nil, options = {})
self.class.post "#{Account::KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/invoicePayments",
{},
{
:externalPayment => external_payment,
:paymentAmount => purchased_amount
},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
end
|
#create(external_payment = false, user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/killbill_client/models/invoice_payment.rb', line 79
def create(external_payment = false, user = nil, reason = nil, = nil, options = {})
created_invoice_payment = self.class.post "#{Invoice::KILLBILL_API_INVOICES_PREFIX}/#{target_invoice_id}/payments",
to_json,
{
:externalPayment => external_payment
},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
created_invoice_payment.refresh(options)
end
|