class Promisepay::Item

Manage Items

Public Instance Methods

acknowledge_paypal(options = {}) click to toggle source

.

@see docs.promisepay.com/v2.2/docs/itemsidacknowledge_paypal

@return [Boolean]

# File lib/promisepay/models/item.rb, line 174
def acknowledge_paypal(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_paypal", options).body)
  @attributes = response['items']
  true
end
acknowledge_wire(options = {}) click to toggle source

Acknowledge that funds are being wired for payment.

@see reference.promisepay.com/#acknowledge-wire-transfer

@return [Boolean]

# File lib/promisepay/models/item.rb, line 163
def acknowledge_wire(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/acknowledge_wire", options).body)
  @attributes = response['items']
  true
end
batch_transactions(options = {}) click to toggle source

Get historical batch_transactions for the item.

@see reference.promisepay.com/#list-item-batch-transactions

@param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 transactions. default: 10 @option options [Integer] :offset Pagination help. default: 0

@return [Array<Promisepay::BatchTransaction>]

# File lib/promisepay/models/item.rb, line 86
def batch_transactions(options = {})
  response = JSON.parse(@client.get("items/#{send(:id)}/batch_transactions", options).body)
  batch_transactions = response.key?('batch_transactions') ? response['batch_transactions'] : []
  batch_transactions.map { |attributes| Promisepay::BatchTransaction.new(@client, attributes) }
end
bpay_details() click to toggle source

Show the bpay details details for payment.

@see reference.promisepay.com/#show-item-bpay-details

@return [Hash]

# File lib/promisepay/models/item.rb, line 107
def bpay_details
  response = JSON.parse(@client.get("items/#{send(:id)}/bpay_details").body)
  response['items']['bpay_details']
end
buyer() click to toggle source

Show the buyer detail for a single item for a marketplace.

@see reference.promisepay.com/#show-item-buyer

@return [Promisepay::User]

# File lib/promisepay/models/item.rb, line 32
def buyer
  response = JSON.parse(@client.get("items/#{send(:id)}/buyers").body)
  Promisepay::User.new(@client, response['users'])
end
cancel() click to toggle source

Cancel an Item.

@see reference.promisepay.com/#cancel

@return [Boolean]

# File lib/promisepay/models/item.rb, line 273
def cancel
  response = JSON.parse(@client.patch("items/#{id}/cancel").body)
  @attributes = response['items']
  true
end
decline_refund() click to toggle source

Decline a refund request for an Item.

@see reference.promisepay.com/#decline-refund

@return [Boolean]

# File lib/promisepay/models/item.rb, line 207
def decline_refund
  response = JSON.parse(@client.patch("items/#{send(:id)}/decline_refund").body)
  @attributes = response['items']
  true
end
escalate_dispute() click to toggle source

Escalate a dispute raised against an Item.

@see reference.promisepay.com/#escalate-dispute

@return [Boolean]

# File lib/promisepay/models/item.rb, line 262
def escalate_dispute
  response = JSON.parse(@client.patch("items/#{send(:id)}/escalate_dispute").body)
  @attributes = response['items']
  true
end
fees(options = {}) click to toggle source

Get fees associated to the item.

@see reference.promisepay.com/#show-item-fees

@param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 fees. default: 10 @option options [Integer] :offset Pagination help. default: 0

@return [Array<Promisepay::Fee>]

# File lib/promisepay/models/item.rb, line 56
def fees(options = {})
  response = JSON.parse(@client.get("items/#{send(:id)}/fees", options).body)
  fees = response.key?('fees') ? response['fees'] : []
  fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }
end
make_payment(options = {}) click to toggle source

Make a payment for an Item.

@see reference.promisepay.com/#make-payment

@return [Boolean]

# File lib/promisepay/models/item.rb, line 117
def make_payment(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/make_payment", options).body)
  @attributes = response['items']
  true
end
raise_dispute(options = {}) click to toggle source

Raise a dispute for the Item.

@see reference.promisepay.com/#raise-dispute

@return [Boolean]

# File lib/promisepay/models/item.rb, line 229
def raise_dispute(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/raise_dispute", options).body)
  @attributes = response['items']
  true
end
refund(options = {}) click to toggle source

Refund an Item’s funds held in escrow.

@see reference.promisepay.com/#refund

@return [Boolean]

# File lib/promisepay/models/item.rb, line 218
def refund(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/refund", options).body)
  @attributes = response['items']
  true
end
release_payment(options = {}) click to toggle source

Release funds held in escrow from an Item with an Escrow or Escrow Partial Release payment type.

@see reference.promisepay.com/#release-payment

@return [Boolean]

# File lib/promisepay/models/item.rb, line 140
def release_payment(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/release_payment", options).body)
  @attributes = response['items']
  true
end
request_payment(options = {}) click to toggle source

Request payment for an Item.

@see reference.promisepay.com/#request-payment

@return [Boolean]

# File lib/promisepay/models/item.rb, line 128
def request_payment(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/request_payment", options).body)
  @attributes = response['items']
  true
end
request_refund(options = {}) click to toggle source

Request a refund for an Item.

@see reference.promisepay.com/#request-refund

@return [Boolean]

# File lib/promisepay/models/item.rb, line 196
def request_refund(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/request_refund", options).body)
  @attributes = response['items']
  true
end
request_release(options = {}) click to toggle source

Request release of funds held in escrow, from an Item with an Escrow or Escrow Partial Release payment type.

@see reference.promisepay.com/#request-release

@return [Boolean]

# File lib/promisepay/models/item.rb, line 152
def request_release(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/request_release", options).body)
  @attributes = response['items']
  true
end
request_resolve_dispute() click to toggle source

Request that the dispute be resolved.

@see reference.promisepay.com/#request-dispute-resolution

@return [Boolean]

# File lib/promisepay/models/item.rb, line 240
def request_resolve_dispute
  response = JSON.parse(@client.patch("items/#{send(:id)}/request_resolve_dispute").body)
  @attributes = response['items']
  true
end
request_tax_invoice() click to toggle source

Request a Tax Invoice be sent to the Users associated with an Item.

@see reference.promisepay.com/#request-tax-invoice

@return [Boolean]

# File lib/promisepay/models/item.rb, line 295
def request_tax_invoice
  response = JSON.parse(@client.patch("items/#{send(:id)}/request_tax_invoice").body)
  @attributes = response['items']
  true
end
resolve_dispute() click to toggle source

Resolve a dispute.

@see reference.promisepay.com/#resolve-dispute

@return [Boolean]

# File lib/promisepay/models/item.rb, line 251
def resolve_dispute
  response = JSON.parse(@client.patch("items/#{send(:id)}/resolve_dispute").body)
  @attributes = response['items']
  true
end
revert_wire(options = {}) click to toggle source

Revert an acknowledge wire Item Action.

@see reference.promisepay.com/#revert-wire-transfer

@return [Boolean]

# File lib/promisepay/models/item.rb, line 185
def revert_wire(options = {})
  response = JSON.parse(@client.patch("items/#{send(:id)}/revert_wire", options).body)
  @attributes = response['items']
  true
end
seller() click to toggle source

Show the seller detail for a single item for a marketplace.

@see reference.promisepay.com/#show-item-seller

@return [Promisepay::User]

# File lib/promisepay/models/item.rb, line 42
def seller
  response = JSON.parse(@client.get("items/#{send(:id)}/sellers").body)
  Promisepay::User.new(@client, response['users'])
end
send_tax_invoice() click to toggle source

Email a Tax Invoice to the Users associated with the Item.

@see reference.promisepay.com/#send-tax-invoice

@return [Boolean]

# File lib/promisepay/models/item.rb, line 284
def send_tax_invoice
  response = JSON.parse(@client.patch("items/#{send(:id)}/send_tax_invoice").body)
  @attributes = response['items']
  true
end
status() click to toggle source

Show the item status for a marketplace.

@see reference.promisepay.com/#show-item-status

@return [Hash]

# File lib/promisepay/models/item.rb, line 22
def status
  response = JSON.parse(@client.get("items/#{send(:id)}/status").body)
  response['items']
end
transactions(options = {}) click to toggle source

Get historical transactions for the item.

@see reference.promisepay.com/#list-item-transactions

@param options [Hash] Optional options. @option options [Integer] :limit Can ask for up to 200 transactions. default: 10 @option options [Integer] :offset Pagination help. default: 0

@return [Array<Promisepay::Transaction>]

# File lib/promisepay/models/item.rb, line 71
def transactions(options = {})
  response = JSON.parse(@client.get("items/#{send(:id)}/transactions", options).body)
  transactions = response.key?('transactions') ? response['transactions'] : []
  transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }
end
update(attributes) click to toggle source

Update the attributes of an item.

@see reference.promisepay.com/#update-item

@param attributes [Hash] Item's attributes to be updated.

@return [self]

# File lib/promisepay/models/item.rb, line 11
def update(attributes)
  response = JSON.parse(@client.patch("items/#{send(:id)}", attributes).body)
  @attributes = response['items']
  self
end
wire_details() click to toggle source

Show the wire details for payment.

@see reference.promisepay.com/#show-item-wire-details

@return [Hash]

# File lib/promisepay/models/item.rb, line 97
def wire_details
  response = JSON.parse(@client.get("items/#{send(:id)}/wire_details").body)
  response['items']['wire_details']
end