Class: PaycorpRails
- Inherits:
-
Object
- Object
- PaycorpRails
- Defined in:
- lib/paycorp_rails.rb,
lib/paycorp_rails/version.rb
Overview
Paycorp internet payment gateway
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Method Summary collapse
-
#complete_payment(payment_options) ⇒ Object
Send the payment confirmation to Paycorp to complete the transaction.
-
#initialize(options) ⇒ PaycorpRails
constructor
Get the credentials and store them in the memory.
-
#initiate_payment(payment_options) ⇒ Object
Talk to Paycorp and initiate the payment.
Constructor Details
#initialize(options) ⇒ PaycorpRails
Get the credentials and store them in the memory
6 7 8 |
# File 'lib/paycorp_rails.rb', line 6 def initialize() = end |
Instance Method Details
#complete_payment(payment_options) ⇒ Object
Send the payment confirmation to Paycorp to complete the transaction
19 20 21 22 23 24 |
# File 'lib/paycorp_rails.rb', line 19 def complete_payment() json = (create_complete_params()).to_json hash = gen_hash(json, [:hmac]) response = set_request_url([:auth_token], hash, json) JSON.parse(response.read_body) end |
#initiate_payment(payment_options) ⇒ Object
Talk to Paycorp and initiate the payment
11 12 13 14 15 16 |
# File 'lib/paycorp_rails.rb', line 11 def initiate_payment() json = (create_init_params()).to_json hash = gen_hash(json, [:hmac]) response = set_request_url([:auth_token], hash, json) JSON.parse(response.read_body) end |