class ActiveWepay::Checkout
Public Class Methods
create(options)
click to toggle source
# File lib/activewepay.rb, line 110 def self.create(options) checkout = self.new(options) checkout.call('/checkout/create', checkout.oauth_token, { account_id: checkout.account_id, amount: checkout.amount, short_description: 'Payment', type: 'DONATION', mode: 'iframe', app_fee: checkout.amount * 0.021, redirect_uri: checkout.redirect_uri, callback_uri: checkout.callback_uri }) end
find(options)
click to toggle source
# File lib/activewepay.rb, line 124 def self.find(options) checkout = self.new(options) checkout.information end
Public Instance Methods
cancel()
click to toggle source
# File lib/activewepay.rb, line 137 def cancel validates_presence_of :id self.call('/checkout/cancel/', @oauth_token, { checkout_id: @id, cancel_reason: 'Refund' }) end
information()
click to toggle source
# File lib/activewepay.rb, line 129 def information validates_presence_of :id call('/checkout/', @oauth_token, { checkout_id: @id }) end
refund()
click to toggle source
# File lib/activewepay.rb, line 146 def refund validates_presence_of :id call('/checkout/refund', @oauth_token, { checkout_id: @id, refund_reason: 'Refunded' }) end