class PayPal::SDK::REST::DataTypes::CreditCard

Public Class Methods

find(resource_id) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 339
def find(resource_id)
  raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
  path = "v1/vault/credit-cards/#{resource_id}"
  self.new(api.get(path))
end
load_members() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 311
def self.load_members
  object_of :id, String
  object_of :number, String
  object_of :type, String
  object_of :expire_month, Integer
  object_of :expire_year, Integer
  object_of :cvv2, String
  object_of :first_name, String
  object_of :last_name, String
  object_of :billing_address, Address
  object_of :external_customer_id, String
  object_of :state, String
  object_of :valid_until, String
  object_of :create_time, String
  object_of :update_time, String
  array_of :links, Links
end

Public Instance Methods

create() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 331
def create()
  path = "v1/vault/credit-cards"
  response = api.post(path, self.to_hash, http_header)
  self.merge!(response)
  success?
end
delete() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 346
def delete()
  path = "v1/vault/credit-cards/#{self.id}"
  response = api.delete(path, {})
  self.merge!(response)
  success?
end
update(patch_requests) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 353
def update(patch_requests)
  patch_request_array = []
  patch_requests.each do |patch_request|
    patch_request = Patch.new(patch_request) unless patch_request.is_a? Patch
    patch_request_array << patch_request.to_hash
  end
  path = "v1/vault/credit-cards/#{self.id}"
  response = api.patch(path, patch_request_array, http_header)
  self.merge!(response)
  success?
end