class PinPays::Charges
Constants
- PATH
Public Class Methods
capture(charge_token)
click to toggle source
Captures a previously authorized charge
# File lib/pin_pays/charges.rb, line 17 def capture(charge_token) api_response(api_put("#{PATH}/#{charge_token}/capture")) end
create(options)
click to toggle source
Create a charge for a customer or card Options (hash) containing:
(mandatory) email, description, amount, and remote_ip (mandatory, one of) customer_token, card_token, or card (a hash of card details) (optional) currency, capture
# File lib/pin_pays/charges.rb, line 12 def create(options) api_response(api_post(PATH, options)) end
list(page = nil)
click to toggle source
Lists all charges Page - the page number to return (optional)
# File lib/pin_pays/charges.rb, line 23 def list(page = nil) options = (page.nil? ? nil : { page: page }) api_paginated_response(api_get(PATH, options)) end
search(criteria)
click to toggle source
Search for charges that match one or more criteria Criteria - a hash of search criteria
# File lib/pin_pays/charges.rb, line 30 def search(criteria) api_paginated_response(api_get("#{PATH}/search", criteria)) end
show(charge_token)
click to toggle source
Retrieve details of a specific charge
# File lib/pin_pays/charges.rb, line 35 def show(charge_token) api_response(api_get("#{PATH}/#{charge_token}")) end