VimUnDo:SLR$1[gïe9MMMMa_a=c b5_   Va@ : expect(retrieve_order_response.data.id).to eq order_id C retrieve_order_response = Patch::Order.retrieve_order(order_id)  , order_id = create_order_response.data.id B create_order_response = Patch::Order.create_order(mass_g: 100)5_Va@> end- orders += retrieve_orders_response.data9 next_page = retrieve_orders_response.meta.next_pageN retrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)4 while !next_page.nil? && next_page <= page_limit orders = [] next_page = 1 page_limit = 15_ VaE # end/ # orders += retrieve_orders_response.data; # next_page = retrieve_orders_response.meta.next_pageP # retrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)6 # while !next_page.nil? && next_page <= page_limit # # orders = [] # next_page = 1 # page_limit = 1  < # expect(retrieve_order_response.data.id).to eq order_id E # retrieve_order_response = Patch::Order.retrieve_order(order_id)  # . # order_id = create_order_response.data.id D # create_order_response = Patch::Order.create_order(mass_g: 100)5_  VaJ require "pry"; binding.pry5_  Vab before do5_ Va before do Patch.configure do |config|2 config.access_token = ENV['SANDBOX_API_KEY'] end end5_1V1a\5_1V1a)]]5_1V1ap; it 'supports create, place, cancel, retrieve and list' do5_)Va% it 'queries orders via metadata' doB create_order_response = Patch::Order.create_order(mass_g: 100), order_id = create_order_response.data.idC retrieve_order_response = Patch::Order.retrieve_order(order_id): expect(retrieve_order_response.data.id).to eq order_id page_limit = 1 next_page = 1 orders = []4 while !next_page.nil? && next_page <= page_limitN retrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)9 next_page = retrieve_orders_response.meta.next_page- orders += retrieve_orders_response.data end( expect(orders.length).not_to be_zero end5_DVaCE\' it 'supports create with metadata' do5_DVaCE\9 it 'supports creation and querying by with metadata' do5_D-VaCE\> it 'supports creation with and querying by with metadata' do5_D-VaCE\< it 'supports creation with and querying by x metadata' do5_D-VaCE\; it 'supports creation with and querying by metadata' do5_D-Va CE\: it 'supports creation with and querying by metadata' do5_GVa FH create_order_response = FI\V create_order_response = Patch::Order.create_order(mass_g: 100, metadata: metadata)5_MVaMO]5_NVaNQ^NO^5_OVaNQ`N retrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)9 next_page = retrieve_orders_response.meta.next_page5_NVaNP`NO`5_ PVaORaL retrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)5_# Q3Va PRb3 Patch::Order.retrieve_orders(page: next_page)5_ $!#Q3Va.PRb8 Patch::Order.retrieve_orders(page: next_page).data5_#%$PVa. OQ retrieve_orders_response = 5_$&%RVa/QR7 next_page = retrieve_orders_response.meta.next_page5_%'&OVa2NPaWPatch::Order.retrieve_orders(page: page, query_params: { metadata: { key: 'value' } })5_&('OVa3NOY Patch::Order.retrieve_orders(page: page, query_params: { metadata: { key: 'value' } })5_')(OVa4OQ`OP`5_(*)PVa5OQaY Patch::Order.retrieve_orders(page: page, query_params: { metadata: { key: 'value' } })5_)+*PVa5OQa[ Patch::Order.retrieve_orders(page: page, query_params: { metadata: { key: 'value' } })5_*,+QVa6PQ3 Patch::Order.retrieve_orders(page: next_page)5_+-,OVa@NP` retrieve_orders_response =] Patch::Order.retrieve_orders(page: page, query_params: { metadata: { key: 'value' } })5_,.-O<VaANQ_v retrieve_orders_response = Patch::Order.retrieve_orders(page: page, query_params: { metadata: { key: 'value' } })5_-/.P?VaCOR`@ page: page, query_params: { metadata: { key: 'value' } })5_.0/P.VaIOQa? page: page, query_params: { metadata: { key: 'value' } }5_/10P5VaLOQa@ page: page, query_params: { metadata: { user: 'value' } }5_021QVa[QTaQRa5_132R Va\QSc4 expect(create_order_response.success).to eq true5_243S&VabRTc7 expect(create_order_response.data.id).not_to be_nil5_354S S SvamRTc: expect(create_order_response.data.count).not_to be_nilSTc5_465S0S S"varRTc= expect(retrieve_orders_response.data.count).not_to be_nil5_576S4S S"vaRTc4 expect(retrieve_orders_response.data.count).to b5_687P S S"vaOQc? page: page, query_params: { metadata: { user: 'john' } }5_798QS S"vaQSd QSc5_8:9RT T"vaQR require "pry"; binding.pry5_9;:PS S"vaOQc< page: 1, query_params: { metadata: { user: 'john' } }5_:<;PS S"vaOQc0 page: 1, : { metadata: { user: 'john' } }5_;=<PS S"vaOQc/ page: 1, { metadata: { user: 'john' } }5_<>=PS S"vaOQc. page: 1, { metadata: { user: 'john' } }PQc5_=?>P(S S"vaOQc* page: 1, metadata: { user: 'john' }5_>@?QS S"vaQSd QSc5_?A@T T T"vaTVdTUd5_@BAU)T T"vaTVe: expect(retrieve_orders_response.data.count).to be >= 15_ACBU(T T"vaTVe5 expect(retrieve_orders_response.data.).to be >= 15_BDCU(T T"vaTVe4 expect(retrieve_orders_response.data).to be >= 15_CEDU-T T"va(TVe9 expect(retrieve_orders_response.data.map.).to be >= 15_DFEU=T T"va7TVeD expect(retrieve_orders_response.data.map(&:metadata)).to be >= 15_EGFU-T T"vamTVeB expect(retrieve_orders_response.data.map(&:metadata)).to all()5_FHGU@T T"vapTVeB expect(retrieve_orders_response.data.map(&:metadata)).to all()UVe5_GIHUIT T"vaqTVeJ expect(retrieve_orders_response.data.map(&:metadata)).to all(have_key)5_HKIUKT T"vaTVeM expect(retrieve_orders_response.data.map(&:metadata)).to all(have_key(:))5_ILJKU9T T"vaTWeQ expect(retrieve_orders_response.data.map(&:metadata)).to all(have_key(:user))5_KMLRT T"vaQR require "pry"; binding.pry5_LMS S"vae&RSpec.describe 'Orders Integration' do; it 'supports create, place, cancel, retrieve and list' doB create_order_response = Patch::Order.create_order(mass_g: 100), order_id = create_order_response.data.idC retrieve_order_response = Patch::Order.retrieve_order(order_id): expect(retrieve_order_response.data.id).to eq order_id page_limit = 1 next_page = 1 orders = []4 while !next_page.nil? && next_page <= page_limitN retrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)9 next_page = retrieve_orders_response.meta.next_page- orders += retrieve_orders_response.data end( expect(orders.length).not_to be_zero end+ it 'supports create with a project-id' do@ retrieve_project_response = Patch::Project.retrieve_project(( Constants::BIOMASS_TEST_PROJECT_ID )2 project_id = retrieve_project_response.data.idh average_price_per_tonne_cents_usd = retrieve_project_response.data.average_price_per_tonne_cents_usd order_mass_g = 100_000 tonne_per_gram = 1_000_000] expected_price = (average_price_per_tonne_cents_usd.to_f / tonne_per_gram) * order_mass_gc create_order_response = Patch::Order.create_order(mass_g: order_mass_g, project_id: project_id)& order = create_order_response.data4 expect(create_order_response.success).to eq true" expect(order.id).not_to be_nil, expect(order.mass_g).to eq(order_mass_g)W expect(order.price_cents_usd).to be_between(expected_price - 2, expected_price + 2)< expect(order.patch_fee_cents_usd).to be_kind_of(Integer). expect(order.registry_url).not_to be_empty end, it 'supports create with a total price' do@ retrieve_project_response = Patch::Project.retrieve_project(( Constants::BIOMASS_TEST_PROJECT_ID )2 project_id = retrieve_project_response.data.id! total_price_cents_usd = 50_006 create_order_response = Patch::Order.create_order(3 total_price_cents_usd: total_price_cents_usd, project_id: project_id )4 expect(create_order_response.success).to eq true& order = create_order_response.data" expect(order.id).not_to be_nilY expect(order.price_cents_usd + order.patch_fee_cents_usd).to eq total_price_cents_usd. expect(order.registry_url).not_to be_empty end9 it 'supports creation with and querying by metadata' do# metadata = { user: 'john doe' } create_order_response =@ Patch::Order.create_order(mass_g: 100, metadata: metadata)4 expect(create_order_response.success).to eq true7 expect(create_order_response.data.id).not_to be_nil8 expect(create_order_response.data.mass_g).to eq(100)? expect(create_order_response.data.metadata).to eq(metadata)< retrieve_orders_response = Patch::Order.retrieve_orders() page: 1, metadata: { user: 'john' } )7 expect(retrieve_orders_response.success).to eq true: expect(retrieve_orders_response.data.count).to be >= 19 expect(retrieve_orders_response.data.map(&:metadata)) .to all(have_key(:user)) endF it 'supports place and cancel for orders created via an estimate' doY create_estimate_to_place_response = Patch::Estimate.create_mass_estimate(mass_g: 100)G order_to_place_id = create_estimate_to_place_response.data.order.idF place_order_response = Patch::Order.place_order(order_to_place_id): expect(place_order_response.data.state).to eq 'placed'Z create_estimate_to_cancel_response = Patch::Estimate.create_mass_estimate(mass_g: 100)I order_to_cancel_id = create_estimate_to_cancel_response.data.order.idI cancel_order_response = Patch::Order.cancel_order(order_to_cancel_id)> expect(cancel_order_response.data.state).to eq 'cancelled' endend5_IKJU:T T"vaTVe: expect(retrieve_orders_response.data.map(&:metadata)). to all(have_key(:user))5_ "#!PVa%OQb retrieve_orders_data = 5_!"PVa( OQ retrieve_orders_data =5_PVaOQHretrieve_orders_response = Patch::Order.retrieve_orders(page: next_page)5_ Va