Class: Nihaopay::Merchant
- Inherits:
-
Object
- Object
- Nihaopay::Merchant
- Defined in:
- lib/nihaopay/merchant.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #ali_pay(amount, currency, options = {}) ⇒ Object
- #authorize(amount, credit_card, options = {}) ⇒ Object
- #capture(transaction_id, amount, currency, options = {}) ⇒ Object
-
#initialize(token) ⇒ Merchant
constructor
A new instance of Merchant.
- #purchase(amount, credit_card, options = {}) ⇒ Object
- #refund(transaction_id, amount, currency, options = {}) ⇒ Object
- #release(transaction_id, options = {}) ⇒ Object
- #union_pay(amount, currency, options = {}) ⇒ Object
- #wechat_pay(amount, currency, options = {}) ⇒ Object
Constructor Details
#initialize(token) ⇒ Merchant
Returns a new instance of Merchant.
5 6 7 |
# File 'lib/nihaopay/merchant.rb', line 5 def initialize(token) self.token = token end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/nihaopay/merchant.rb', line 3 def token @token end |
Instance Method Details
#ali_pay(amount, currency, options = {}) ⇒ Object
14 15 16 17 |
# File 'lib/nihaopay/merchant.rb', line 14 def ali_pay(amount, currency, = {}) [:token] = token Nihaopay::SecurePay::AliPay.start(amount, currency, ) end |
#authorize(amount, credit_card, options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/nihaopay/merchant.rb', line 24 def (amount, credit_card, = {}) [:token] = token Nihaopay::Transactions::Authorize.start(amount, credit_card, ) end |
#capture(transaction_id, amount, currency, options = {}) ⇒ Object
29 30 31 32 |
# File 'lib/nihaopay/merchant.rb', line 29 def capture(transaction_id, amount, currency, = {}) [:token] = token Nihaopay::Transactions::Capture.start(transaction_id, amount, currency, ) end |
#purchase(amount, credit_card, options = {}) ⇒ Object
34 35 36 37 |
# File 'lib/nihaopay/merchant.rb', line 34 def purchase(amount, credit_card, = {}) [:token] = token Nihaopay::Transactions::Purchase.start(amount, credit_card, ) end |
#refund(transaction_id, amount, currency, options = {}) ⇒ Object
44 45 46 47 |
# File 'lib/nihaopay/merchant.rb', line 44 def refund(transaction_id, amount, currency, = {}) [:token] = token Nihaopay::Transactions::Refund.start(transaction_id, amount, currency, ) end |
#release(transaction_id, options = {}) ⇒ Object
39 40 41 42 |
# File 'lib/nihaopay/merchant.rb', line 39 def release(transaction_id, = {}) [:token] = token Nihaopay::Transactions::Release.start(transaction_id, ) end |