Skip to content

Latest commit

 

History

History
203 lines (134 loc) · 5.85 KB

transactions.md

File metadata and controls

203 lines (134 loc) · 5.85 KB

Transactions

transactions_api = client.transactions

Class Name

TransactionsApi

Methods

List Transactions

This endpoint is deprecated.

Lists transactions for a particular location.

Transactions include payment information from sales and exchanges and refund information from returns and exchanges.

Max results per page: 50

def list_transactions(location_id:,
                      begin_time: nil,
                      end_time: nil,
                      sort_order: nil,
                      cursor: nil)

Parameters

Parameter Type Tags Description
location_id String Template, Required The ID of the location to list transactions for.
begin_time String Query, Optional The beginning of the requested reporting period, in RFC 3339 format.

See Date ranges for details on date inclusivity/exclusivity.

Default value: The current time minus one year.
end_time String Query, Optional The end of the requested reporting period, in RFC 3339 format.

See Date ranges for details on date inclusivity/exclusivity.

Default value: The current time.
sort_order String (Sort Order) Query, Optional The order in which results are listed in the response (ASC for
oldest first, DESC for newest first).

Default value: DESC
cursor String Query, Optional A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See Paginating results for more information.

Response Type

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type List Transactions Response Hash.

Example Usage

location_id = 'location_id4'


result = transactions_api.list_transactions(location_id: location_id)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Retrieve Transaction

This endpoint is deprecated.

Retrieves details for a single transaction.

def retrieve_transaction(location_id:,
                         transaction_id:)

Parameters

Parameter Type Tags Description
location_id String Template, Required The ID of the transaction's associated location.
transaction_id String Template, Required The ID of the transaction to retrieve.

Response Type

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Transaction Response Hash.

Example Usage

location_id = 'location_id4'

transaction_id = 'transaction_id8'


result = transactions_api.retrieve_transaction(
  location_id: location_id,
  transaction_id: transaction_id
)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Capture Transaction

This endpoint is deprecated.

Captures a transaction that was created with the Charge endpoint with a delay_capture value of true.

See Delayed capture transactions for more information.

def capture_transaction(location_id:,
                        transaction_id:)

Parameters

Parameter Type Tags Description
location_id String Template, Required -
transaction_id String Template, Required -

Response Type

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Capture Transaction Response Hash.

Example Usage

location_id = 'location_id4'

transaction_id = 'transaction_id8'


result = transactions_api.capture_transaction(
  location_id: location_id,
  transaction_id: transaction_id
)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Void Transaction

This endpoint is deprecated.

Cancels a transaction that was created with the Charge endpoint with a delay_capture value of true.

See Delayed capture transactions for more information.

def void_transaction(location_id:,
                     transaction_id:)

Parameters

Parameter Type Tags Description
location_id String Template, Required -
transaction_id String Template, Required -

Response Type

This method returns a \ApiResponse instance. The data property in this instance returns the response data which is of type Void Transaction Response Hash.

Example Usage

location_id = 'location_id4'

transaction_id = 'transaction_id8'


result = transactions_api.void_transaction(
  location_id: location_id,
  transaction_id: transaction_id
)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end