Class: SatMx::DownloadRequestReceivedBody Private

Inherits:
Object
  • Object
show all
Includes:
Body
Defined in:
lib/sat_mx/download_request_received_body.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Constant Summary collapse

REQUEST_TYPES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

{
  cfdi: "CFDI",
  metadata: "Metadata"
}.freeze
DOCUMENT_STATUS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

%w[
  Todos
  Cancelado
  Vigente
].freeze
COMPLEMENT_TYPES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

%w[
  acreditamientoieps10
  aerolineas
  certificadodedestruccion
  cfdiregistrofiscal
  comercioexterior10
  comercioexterior11
  comprobante
  consumodecombustibles
  consumodecombustibles11
  detallista
  divisas
  donat11
  ecc11
  ecc12
  gastoshidrocarbonos10
  iedu
  implocal
  ine11
  ingresoshidrocarbonos
  leyendasfisc
  nomina11
  nomina12
  notariospublicos
  obrasarteantiguedades
  pagoenespecie
  pagos10
  pfic
  renovacionysustitucionvehiculos
  servicioparcialconstruccion
  spei
  terceros11
  turistapasajeroextranjero
  valesdedespensa
  vehiculousado
  ventavehiculos11
].freeze

Constants included from Body

Body::DES, Body::DS, Body::ENVELOPE_ATTRS, Body::NAMESPACE, Body::S11, Body::XMLNS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_date:, end_date:, request_type:, recipient_rfc:, requester_rfc:, certificate:, issuing_rfc: nil, complement: nil, document_status: nil) ⇒ DownloadRequestReceivedBody

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DownloadRequestReceivedBody.

API:

  • private



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/sat_mx/download_request_received_body.rb', line 57

def initialize(
  start_date:,
  end_date:,
  request_type:,
  recipient_rfc:,
  requester_rfc:,
  certificate:,
  issuing_rfc: nil,
  complement: nil,
  document_status: nil
)
  @start_date = start_date
  @end_date = end_date
  @request_type = request_type
  @recipient_rfc = recipient_rfc
  @requester_rfc = requester_rfc
  @certificate = certificate
  @issuing_rfc = issuing_rfc
  @complement = complement
  @document_status = document_status
end

Instance Attribute Details

#complementObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



100
101
102
# File 'lib/sat_mx/download_request_received_body.rb', line 100

def complement
  @complement
end

#document_statusObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



100
101
102
# File 'lib/sat_mx/download_request_received_body.rb', line 100

def document_status
  @document_status
end

Instance Method Details

#generateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/sat_mx/download_request_received_body.rb', line 79

def generate
  envelope do |xml|
    xml[Body::DES].SolicitaDescargaRecibidos do
      attrs = {
        "FechaInicial" => start_date,
        "FechaFinal" => end_date,
        "TipoSolicitud" => request_type,
        "RfcReceptor" => recipient_rfc
      }
      attrs["RfcEmisor"] = issuing_rfc if issuing_rfc
      attrs["RfcSolicitante"] = requester_rfc if requester_rfc
      attrs["Complemento"] = complement if complement
      attrs["EstadoComprobante"] = document_status if document_status

      xml[Body::DES].solicitud(attrs) do
        signature(xml)
      end
    end
  end
end