class Paycargo::TransactionsResource
Public Instance Methods
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 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
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
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
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
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
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 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
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 transaction
# File lib/paycargo/resources/transactions.rb, line 86 def void(id, **params) Transaction.new put_request("transaction/void/#{id}", params: params).body end