class PayuPayments::Client

Public Class Methods

new(params={}) click to toggle source

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Client attributes from Payu documentation xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

id ullName emai creditCards subscriptions

Calls superclass method PayuPayments::Caller::new
# File lib/payu_payments/client.rb, line 14
def initialize(params={})
    super
    @resource = "customers"
end

Public Instance Methods

add_credit_card(params) click to toggle source
# File lib/payu_payments/client.rb, line 19
def add_credit_card(params)
    cc = CreditCard.new(params)
    cc.attr.customerId = self.base.id
    cc.save
end
credit_cards() click to toggle source
# File lib/payu_payments/client.rb, line 33
def credit_cards
    self.base.creditCards.each.map do |sub|
        cc =  CreditCard.new
        cc.base.marshal_load(sub)
        cc
    end
end
subscriptions() click to toggle source
# File lib/payu_payments/client.rb, line 25
def subscriptions
    self.base.subscriptions.map do |sub|
        subscription =  Subscription.new
        subscription.base.marshal_load(sub)
        subscription
    end
end