effective_qb_online 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/app/models/effective/qb_api.rb +5 -3
 - data/app/models/effective/qb_receipt.rb +1 -1
 - data/lib/effective_qb_online/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 60fdcd8157727cfd504ec92e04d3dcc17c3c3c7770cebe0fccf7c042fed980de
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 742af23812a9674802099bcffe6554c4676cc71fb75eeda9c7c5b459dd32d778
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: fc3d3a310e3bc779cd11b100f080100da3950d034dc2cd1febaa77cf11d712463c9b2a3ce16eb86a66e7a5c9b226fd132a355784d10c78bd9ec703a93eb0403c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b424854296faa6483c7058c8addaff7854e24f30b95bfed012a0f333a3c5c5225218a6793ddd45226cb0e48fc67f0fad327dd1bee5ba72e104948b11a12f22ae
         
     | 
| 
         @@ -110,7 +110,7 @@ module Effective 
     | 
|
| 
       110 
110 
     | 
    
         | 
| 
       111 
111 
     | 
    
         
             
                    # Find by given name and family name
         
     | 
| 
       112 
112 
     | 
    
         
             
                    customer ||= if user.respond_to?(:first_name) && user.respond_to?(:last_name)
         
     | 
| 
       113 
     | 
    
         
            -
                      service.query("SELECT * FROM Customer WHERE GivenName LIKE '#{scrub(user.first_name)}' AND FamilyName LIKE '#{scrub(user.last_name)}'")&.first
         
     | 
| 
      
 113 
     | 
    
         
            +
                      service.query("SELECT * FROM Customer WHERE GivenName LIKE '#{scrub(user.first_name, sql: true)}' AND FamilyName LIKE '#{scrub(user.last_name, sql: true)}'")&.first
         
     | 
| 
       114 
114 
     | 
    
         
             
                    end
         
     | 
| 
       115 
115 
     | 
    
         | 
| 
       116 
116 
     | 
    
         
             
                    # Find by display name
         
     | 
| 
         @@ -217,9 +217,11 @@ module Effective 
     | 
|
| 
       217 
217 
     | 
    
         
             
                  end
         
     | 
| 
       218 
218 
     | 
    
         
             
                end
         
     | 
| 
       219 
219 
     | 
    
         | 
| 
       220 
     | 
    
         
            -
                def scrub(value)
         
     | 
| 
      
 220 
     | 
    
         
            +
                def scrub(value, sql: false)
         
     | 
| 
       221 
221 
     | 
    
         
             
                  return nil unless value.present?
         
     | 
| 
       222 
     | 
    
         
            -
                  value.gsub(':', '')
         
     | 
| 
      
 222 
     | 
    
         
            +
                  value = value.gsub(':', '')
         
     | 
| 
      
 223 
     | 
    
         
            +
                  value = value.gsub("'", "\\'") if sql
         
     | 
| 
      
 224 
     | 
    
         
            +
                  value
         
     | 
| 
       223 
225 
     | 
    
         
             
                end
         
     | 
| 
       224 
226 
     | 
    
         | 
| 
       225 
227 
     | 
    
         
             
              end
         
     | 
| 
         @@ -74,7 +74,7 @@ module Effective 
     | 
|
| 
       74 
74 
     | 
    
         
             
                    assign_attributes(result: 'completed successfully', sales_receipt_id: sales_receipt.id)
         
     | 
| 
       75 
75 
     | 
    
         
             
                    complete!
         
     | 
| 
       76 
76 
     | 
    
         
             
                  rescue => e
         
     | 
| 
       77 
     | 
    
         
            -
                    result = [e.message, *("(intuit_tid: #{e.intuit_tid})" if e.try(:intuit_tid).present?)].join(' ')
         
     | 
| 
      
 77 
     | 
    
         
            +
                    result = [e.message, *("(intuit_tid: #{e.intuit_tid})" if e.try(:intuit_tid).present?), e.backtrace.last(5).join("\n\n")].join(' ')
         
     | 
| 
       78 
78 
     | 
    
         
             
                    assign_attributes(result: result)
         
     | 
| 
       79 
79 
     | 
    
         
             
                    error!
         
     | 
| 
       80 
80 
     | 
    
         
             
                  end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: effective_qb_online
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Code and Effect
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-05-23 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     |