Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
BluePay-Sample-Code/Ruby/samples/Get_Data/Retrieve_Settlement_Data.rb
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
31 lines (26 sloc)
937 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# BluePay Ruby Sample code. | |
# | |
# This code sample runs a report that grabs data from the | |
# BluePay gateway based on certain criteria. This will ONLY return | |
# transactions that have already settled. See comments below | |
# on the details of the report. | |
# If using TEST mode, only TEST transactions will be returned. | |
require_relative "../../lib/bluepay.rb" | |
ACCOUNT_ID = "Merchant's Account ID Here" | |
SECRET_KEY = "Merchant's Secret Key Here" | |
MODE = "TEST" | |
report = BluePay.new( | |
account_id: ACCOUNT_ID, | |
secret_key: SECRET_KEY, | |
mode: MODE | |
) | |
report.get_settled_transaction_report( | |
report_start_date: '2015-01-01', # YYYY-MM-DD | |
report_end_date: '2015-04-30', # YYYY-MM-DD | |
query_by_hierarchy: '1', # Also search subaccounts? Yes | |
do_not_escape: '1', # Output response without commas? Yes | |
exclude_errors: '1' # Do not include errored transactions? Yes | |
) | |
# Makes the API request with BluePay and returns response | |
puts report.process |