lib/billfixers/partner/client.rb in billfixers-partner-1.0.0 vs lib/billfixers/partner/client.rb in billfixers-partner-1.1.0
- old
+ new
@@ -101,12 +101,13 @@
raise Error, result.errors.join(' ') unless result.success
result.customer
end
- def create_bill(params)
+ def create_bill(customer_id, params)
response = @gql.query(CREATE_BILL_MUTATION, {
+ customer_id: customer_id,
bill: camelize(params)
})
result = response.data.create_bill
raise Error, result.errors.join(' ') unless result.success
@@ -131,12 +132,28 @@
def reject_offer(offer_id)
response = @gql.query(REJECT_OFFER_MUTATION, { id: offer_id })
result = response.data.reject_offer
+ # binding.pry
raise Error, result.errors.join(' ') unless result.success
result.offer
+ end
+
+ def respond_to_information_request(information_request_id, params)
+ response = @gql.query(
+ RESPOND_TO_INFORMATION_REQUEST,
+ {
+ id: information_request_id,
+ information_request: camelize(params)
+ }
+ )
+
+ result = response.data.respond_to_information_request
+ raise Error, result.errors.join(' ') unless result.success
+
+ result.information_request
end
private
def camelize(hsh)