Class: Mollie::Ideal
Class Attribute Summary collapse
-
.testmode ⇒ Object
Returns the value of attribute testmode.
Class Method Summary collapse
- .banklist ⇒ Object
- .check_order(transaction_id) ⇒ Object
- .prepare_payment(bank_id, amount, description, return_url, callback_url) ⇒ Object
- .send_command(options) ⇒ Object
Class Attribute Details
.testmode ⇒ Object
Returns the value of attribute testmode.
9 10 11 |
# File 'lib/mollie/ideal.rb', line 9 def testmode @testmode end |
Class Method Details
.banklist ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mollie/ideal.rb', line 11 def banklist = {:a => "banklist"} .merge!({:testmode=>true}) if testmode payload = send_command().payload if payload.bank.class.name == "Mash" #in testmode there is only 1 bank. This is not wrapped in an Array. return [payload.bank] elsif payload.bank.class.name == "Array" #in production mode the list is an Array. payload.bank end end |
.check_order(transaction_id) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/mollie/ideal.rb', line 43 def check_order(transaction_id) = { :a => "check", :partnerid=>Mollie.partner_id, :transaction_id => transaction_id } .merge!({:testmode=>true}) if testmode send_command().payload.order end |
.prepare_payment(bank_id, amount, description, return_url, callback_url) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/mollie/ideal.rb', line 25 def prepare_payment(bank_id,amount,description,return_url,callback_url) #callback_url is being called by mollie in the background. They add an GET parameter :transaction_id #return_url is used after the payment is done. The redirection also adds the :transaction_id as an GET parameter = { :a => "fetch", :bank_id=>bank_id, :description=>description, :amount=>amount, :reporturl=>callback_url, :returnurl=>return_url, :partnerid=>Mollie.partner_id } .merge!({:testmode=>true}) if testmode send_command().payload.order end |
.send_command(options) ⇒ Object
54 55 56 |
# File 'lib/mollie/ideal.rb', line 54 def send_command() IdealResponse.new(Mash.new( get("/xml/ideal", :query=> , :format=>:xml) )) end |