Skip to content
Munir Wanis edited this page Feb 10, 2016 · 2 revisions

Query by OrderKey

require 'stone_ecommerce'

# variable with merchant key
merchantKey = '85328786-8BA6-420F-9948-5352F5A183EB'

# instantiate class with request methods
# :sandbox for sandbox ambient 
# :production for production ambient
gateway = Gateway::Gateway.new(:sandbox, merchantKey)

# creates request object for transaction
querySaleRequest = Gateway::QuerySaleRequest.new

# fill with order key from the transaction you wish to seek
querySaleRequest.OrderKey = 'Your OrderKey'

# the request must be made using the enumerator Gateway::QuerySaleRequest.QuerySaleRequestEnum[:OrderKey]
# make the request and returns a response hash
responseQuery = gateway.Query(Gateway::QuerySaleRequest.QuerySaleRequestEnum[:OrderKey], querySaleRequest.OrderKey)

Query by OrderReference

require 'stone_ecommerce'

# variable with merchant key
merchantKey = '85328786-8BA6-420F-9948-5352F5A183EB'

# instantiate class with request methods
# :sandbox for sandbox ambient 
# :production for production ambient
gateway = Gateway::Gateway.new(:sandbox, merchantKey)

# creates request object for transaction
querySaleRequest = Gateway::QuerySaleRequest.new

# fill with order key from the transaction you wish to seek
querySaleRequest.OrderKey = 'Your OrderReference'

# the request must be made using the enumerator Gateway::QuerySaleRequest.QuerySaleRequestEnum[:OrderReference]
# make the request and returns a response hash
responseQuery = gateway.Query(Gateway::QuerySaleRequest.QuerySaleRequestEnum[:OrderReference], querySaleRequest.OrderReference)