Skip to content

Commit

Permalink
Merge pull request #93 from tungleduyxyz/issue_89_sync_with_killbill_api
Browse files Browse the repository at this point in the history
Add CustomFields to PaymentMethod and Transactions
  • Loading branch information
tungleduyxyz authored Feb 27, 2024
2 parents 52466ac + 9e7d21a commit e4e1b3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/killbill_client/models/payment_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module KillBillClient
module Model
class PaymentMethod < PaymentMethodAttributes

include KillBillClient::Model::CustomFieldHelper
include KillBillClient::Model::AuditLogWithHistoryHelper

KILLBILL_API_PAYMENT_METHODS_PREFIX = "#{KILLBILL_API_PREFIX}/paymentMethods"
Expand All @@ -10,6 +11,7 @@ class PaymentMethod < PaymentMethodAttributes
has_many :audit_logs, KillBillClient::Model::AuditLog

has_audit_logs_with_history KILLBILL_API_PAYMENT_METHODS_PREFIX, :payment_method_id
has_custom_fields KILLBILL_API_PAYMENT_METHODS_PREFIX, :payment_method_id

class << self
def find_by_id(payment_method_id, with_plugin_info = false, options = {})
Expand Down
2 changes: 2 additions & 0 deletions lib/killbill_client/models/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module KillBillClient
module Model
class Transaction < PaymentTransactionAttributes

include KillBillClient::Model::CustomFieldHelper
include KillBillClient::Model::AuditLogWithHistoryHelper

KILLBILL_API_TRANSACTIONS_PREFIX = "#{KILLBILL_API_PREFIX}/paymentTransactions"
Expand All @@ -12,6 +13,7 @@ class Transaction < PaymentTransactionAttributes
has_many :audit_logs, KillBillClient::Model::AuditLog

has_audit_logs_with_history KILLBILL_API_TRANSACTIONS_PREFIX, :transaction_id
has_custom_fields KILLBILL_API_TRANSACTIONS_PREFIX, :transaction_id

def auth(account_id, payment_method_id = nil, user = nil, reason = nil, comment = nil, options = {}, refresh_options = nil)
@transaction_type = 'AUTHORIZE'
Expand Down

0 comments on commit e4e1b3b

Please sign in to comment.