class Paycargo::TransactionsResource

Public Instance Methods

approve(id) click to toggle source

PUT Approve a Transaction

# File lib/paycargo/resources/transactions.rb, line 41
def approve(id)
  Transaction.new put_request("transaction/pay/#{id}").body
end
batch_approve(**attributes) click to toggle source

Batch Approves a list of transactions, for the same Vendor. Available payment methods: OVERNIGHT, PREPAID. BODY

  • batchPaymentType: OVERNIGHT

  • transactionIds: 515168,515169

# File lib/paycargo/resources/transactions.rb, line 49
def batch_approve(**attributes)
  Transaction.new put_request("transactions/batch/pay", body: attributes).body
end
by_number(**params) click to toggle source

GETs a transaction by number (must update token) PARAMS

  • number

  • vendorId

# File lib/paycargo/resources/transactions.rb, line 63
def by_number(**params)
  Transaction.new get_request("transaction/number/", params: params).body
end
create(**attributes) click to toggle source

POSTing a new transaction BODY

  • payerId: 281302

  • vendorId: 279546

  • type: Other

  • subcategory: I-432188

  • number: 929-83294551

  • departureDate: 2018-04-01

  • arrivalDate: 2018-04-24

  • total: 100

  • notes: This is a test for paycargo credit new flow

  • userId: 778042

  • direction: Outbound

  • parent: dsgfdg

  • paymentDueDate: 2018-04-24

  • hasArrived: Y

  • customerRefNumber: 63045050500000

  • shipperRefNumber: tdfgfdgfd

  • paymentType: PAYCARGO_CREDIT

# File lib/paycargo/resources/transactions.rb, line 36
def create(**attributes)
  Transaction.new post_request("transaction", body: attributes).body
end
fees(**params) click to toggle source

Get Fees for transaction. paymentType and transactionId OR paymentType and vendorId and payerId are required to getFees PARAMS

  • paymentType: ‘OVERNIGHT’,

  • transactionId: 123456,

  • numberOfTransactions: 2,

  • payerId: 123456,

  • vendorId: 123456,

  • total: 70

# File lib/paycargo/resources/transactions.rb, line 81
def fees(**params)
  Transaction.new get_request("transaction/fees", params: params).body
end
history(id, **params) click to toggle source

GETing a transaction’s history

# File lib/paycargo/resources/transactions.rb, line 68
def history(id, **params)
  get_request("transaction/history/#{id}", params: params).body
end
list(**params) click to toggle source

GET all Transactions for a client. PARAMS

  • page

  • count

# File lib/paycargo/resources/transactions.rb, line 8
def list(**params)
  Collection.from_response get_request("transactions", params: params), type: Transaction
end
proof(id) click to toggle source

Proof Transaction PUTing a transaction to ‘proof’

# File lib/paycargo/resources/transactions.rb, line 55
def proof(id)
  Transaction.new put_request("transaction/proof/#{id}").body
end
retreive(id, **params) click to toggle source

GET a transaction by id (must update token)

# File lib/paycargo/resources/transactions.rb, line 13
def retreive(id, **params)
  Transaction.new get_request("transaction/#{id}", params: params).body
end
void(id, **params) click to toggle source

Void transaction

# File lib/paycargo/resources/transactions.rb, line 86
def void(id, **params)
  Transaction.new put_request("transaction/void/#{id}", params: params).body
end