# frozen_string_literal: true module WellsFargo module Endpoints class Wires < Base SCOPE = 'Wires-Payments-Template Wires-Payments Wires-Payments-Status' def create_payment(payload) client.execute( :post, 'wires/v1/payments', headers: headers.merge('Content-Type' => 'application/json'), body: payload ) end def check_status(payment_id) client.execute( :get, "wires/v1/payments/#{payment_id}", headers: headers, query: { detail: :no } ) end private def headers { 'Authorization' => "Bearer #{client.token.generate(SCOPE)}", 'client-request-id' => SecureRandom.uuid, 'gateway-entity-id' => client.credentials[:gateway_entity_id] } end end end end