Class: PaymentMethod::BcashMethod

Inherits:
PaymentMethod
  • Object
show all
Defined in:
app/models/spree/payment_method/bcash_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#order_idObject

Returns the value of attribute order_id.



6
7
8
# File 'app/models/spree/payment_method/bcash_method.rb', line 6

def order_id
  @order_id
end

Instance Method Details

#actionsObject



17
18
19
# File 'app/models/spree/payment_method/bcash_method.rb', line 17

def actions
	%w{capture void}
end

#can_capture?(payment) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/spree/payment_method/bcash_method.rb', line 21

def can_capture?(payment)
	['checkout', 'pending'].include?(payment.state)
end

#can_void?(payment) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/models/spree/payment_method/bcash_method.rb', line 25

def can_void?(payment)
	payment.state != 'void'
end

#capture(*args) ⇒ Object



29
30
31
# File 'app/models/spree/payment_method/bcash_method.rb', line 29

def capture(*args)
	ActiveMerchant::Billing::Response.new(true, "", {}, {})
end

#package(payment) ⇒ Object



37
38
39
40
# File 'app/models/spree/payment_method/bcash_method.rb', line 37

def package(payment)
     bcash_payment = Spree::BcashPayment.new
     bcash_payment.process!(payment)
end

#payment_source_classObject



9
10
11
# File 'app/models/spree/payment_method/bcash_method.rb', line 9

def payment_source_class
	self.class
end

#source_required?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/spree/payment_method/bcash_method.rb', line 13

def source_required?
	false
end

#void(*args) ⇒ Object



33
34
35
# File 'app/models/spree/payment_method/bcash_method.rb', line 33

def void(*args)
	ActiveMerchant::Billing::Response.new(true, "", {}, {})
end