class Promisepay::Item
Manage Items
Public Instance Methods
.
@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 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
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
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
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 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 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 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
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 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 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 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 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 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 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 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 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 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 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 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
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
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
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
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 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
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