Class: Celery::Order

Inherits:
Base
  • Object
show all
Extended by:
EndpointMethods::ClassMethods
Includes:
EndpointMethods::InstanceMethods
Defined in:
lib/celery/order.rb

Constant Summary collapse

ENDPOINT_RESOURCE =
"orders"
ENDPOINT_RESOURCE_SINGULAR =
"order"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EndpointMethods::ClassMethods

all, build_collection, create, endpoint_path, endpoint_resource, get, object_root, options

Methods included from EndpointMethods::InstanceMethods

#destroy, #update

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Celery::Base

Instance Attribute Details

#_idObject

Returns the value of attribute _id.



11
12
13
# File 'lib/celery/order.rb', line 11

def _id
  @_id
end

#auto_chargeObject

Returns the value of attribute auto_charge.



11
12
13
# File 'lib/celery/order.rb', line 11

def auto_charge
  @auto_charge
end

#balanceObject

Returns the value of attribute balance.



11
12
13
# File 'lib/celery/order.rb', line 11

def balance
  @balance
end

#buyerObject

Returns the value of attribute buyer.



11
12
13
# File 'lib/celery/order.rb', line 11

def buyer
  @buyer
end

#cardObject

Returns the value of attribute card.



11
12
13
# File 'lib/celery/order.rb', line 11

def card
  @card
end

#celery_payment_tokenObject

Returns the value of attribute celery_payment_token.



11
12
13
# File 'lib/celery/order.rb', line 11

def celery_payment_token
  @celery_payment_token
end

#confirmation_urlObject

Returns the value of attribute confirmation_url.



11
12
13
# File 'lib/celery/order.rb', line 11

def confirmation_url
  @confirmation_url
end

#couponObject

Returns the value of attribute coupon.



11
12
13
# File 'lib/celery/order.rb', line 11

def coupon
  @coupon
end

#createdObject

Returns the value of attribute created.



11
12
13
# File 'lib/celery/order.rb', line 11

def created
  @created
end

#created_dateObject

Returns the value of attribute created_date.



11
12
13
# File 'lib/celery/order.rb', line 11

def created_date
  @created_date
end

#currencyObject

Returns the value of attribute currency.



11
12
13
# File 'lib/celery/order.rb', line 11

def currency
  @currency
end

#depositObject

Returns the value of attribute deposit.



11
12
13
# File 'lib/celery/order.rb', line 11

def deposit
  @deposit
end

#discountObject

Returns the value of attribute discount.



11
12
13
# File 'lib/celery/order.rb', line 11

def discount
  @discount
end

#flagsObject

Returns the value of attribute flags.



11
12
13
# File 'lib/celery/order.rb', line 11

def flags
  @flags
end

#fulfillmentObject

Returns the value of attribute fulfillment.



11
12
13
# File 'lib/celery/order.rb', line 11

def fulfillment
  @fulfillment
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/celery/order.rb', line 11

def id
  @id
end

#imageObject

Returns the value of attribute image.



11
12
13
# File 'lib/celery/order.rb', line 11

def image
  @image
end

#metadataObject

Returns the value of attribute metadata.



11
12
13
# File 'lib/celery/order.rb', line 11

def 
  @metadata
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/celery/order.rb', line 11

def name
  @name
end

#notesObject

Returns the value of attribute notes.



11
12
13
# File 'lib/celery/order.rb', line 11

def notes
  @notes
end

#paymentObject

Returns the value of attribute payment.



11
12
13
# File 'lib/celery/order.rb', line 11

def payment
  @payment
end

#productsObject

Returns the value of attribute products.



11
12
13
# File 'lib/celery/order.rb', line 11

def products
  @products
end

#sellerObject

Returns the value of attribute seller.



11
12
13
# File 'lib/celery/order.rb', line 11

def seller
  @seller
end

#shippingObject

Returns the value of attribute shipping.



11
12
13
# File 'lib/celery/order.rb', line 11

def shipping
  @shipping
end

#slugObject

Returns the value of attribute slug.



11
12
13
# File 'lib/celery/order.rb', line 11

def slug
  @slug
end

#statusObject

Returns the value of attribute status.



11
12
13
# File 'lib/celery/order.rb', line 11

def status
  @status
end

#subtotalObject

Returns the value of attribute subtotal.



11
12
13
# File 'lib/celery/order.rb', line 11

def subtotal
  @subtotal
end

#taxesObject

Returns the value of attribute taxes.



11
12
13
# File 'lib/celery/order.rb', line 11

def taxes
  @taxes
end

#totalObject

Returns the value of attribute total.



11
12
13
# File 'lib/celery/order.rb', line 11

def total
  @total
end

#trackingObject

Returns the value of attribute tracking.



11
12
13
# File 'lib/celery/order.rb', line 11

def tracking
  @tracking
end

#updatedObject

Returns the value of attribute updated.



11
12
13
# File 'lib/celery/order.rb', line 11

def updated
  @updated
end

#updated_dateObject

Returns the value of attribute updated_date.



11
12
13
# File 'lib/celery/order.rb', line 11

def updated_date
  @updated_date
end

Class Method Details

.decode(encoded_string) ⇒ Object



53
54
55
56
# File 'lib/celery/order.rb', line 53

def decode(encoded_string)
  decoded_string = Base64.decode64(encoded_string)
  Celery::Order.new(JSON.parse(decoded_string))
end

Instance Method Details

#cancelObject



41
42
43
44
# File 'lib/celery/order.rb', line 41

def cancel
  response = endpoint_call(:get, "cancel")
  return true if response[self.class.object_root]
end

#charge_depositObject



46
47
48
49
# File 'lib/celery/order.rb', line 46

def charge_deposit
  response = endpoint_call(:post, "charge_deposit")
  return true if response[self.class.object_root]
end