Class: Payfast::PaymentBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/payfast/payment_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ PaymentBuilder

Returns a new instance of PaymentBuilder.



9
10
11
# File 'lib/payfast/payment_builder.rb', line 9

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/payfast/payment_builder.rb', line 3

def params
  @params
end

Class Method Details

.build(params) ⇒ Object



5
6
7
# File 'lib/payfast/payment_builder.rb', line 5

def self.build(params)
  new(params).build
end

Instance Method Details

#buildObject



13
14
15
# File 'lib/payfast/payment_builder.rb', line 13

def build
  merchant_details.merge(customer_details, transaction_details, payment_methods).compact
end