payola-payments 1.0.0 → 1.0.1
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
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                MWQxYzZkNGE4NzJmZjc0NjRjMTA4NjNiZmQyODNhNjhiODZlZTRlMw==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                ZjFhMDA0ZGMzMjJjYWVjMDcxNDQxM2ZiMDZlODJkZDIwNGZhMDI4Zg==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                OGY5MjhiZWZjOTQyNDgyYjMyNDVhMDA5MDUyZTJmMThmOTE4ZmExZjQwY2Yx
         
     | 
| 
      
 10 
     | 
    
         
            +
                M2JmYWI5MTU3MzFjZjMwZDMxZTJiOGQ3NzE5YmU5YjliZWIzZTFhMTg5Njc0
         
     | 
| 
      
 11 
     | 
    
         
            +
                ZDczYTk2NGQyNWU0MzJhYmFhZGMwM2Y4OGI2YTdiOGQxOTUwZTc=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                MTc5ZWI0MjUyODdjMzMxNDFjOGMyNDIzYzc2MTM3M2JkMGNjYjg4ZDRlOGIx
         
     | 
| 
      
 14 
     | 
    
         
            +
                MTE0MzZmNTJhNjY2NTU3YWQwYzU1YzMxY2RiMjgzOTdiYzY2OWZhNDM0YThh
         
     | 
| 
      
 15 
     | 
    
         
            +
                ODM2ZmM3ZWMxYmM4ZGZkOGY2NTkxZDg1OGNlZjBmOWE4MzA5ZDE=
         
     | 
| 
         @@ -38,15 +38,18 @@ var Payola = { 
     | 
|
| 
       38 
38 
     | 
    
         
             
                },
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                showError: function(error, error_div_id) {
         
     | 
| 
      
 41 
     | 
    
         
            +
                    console.log(error);
         
     | 
| 
      
 42 
     | 
    
         
            +
                    console.log(error_div_id);
         
     | 
| 
       41 
43 
     | 
    
         
             
                    var error_div = $("#" + error_div_id);
         
     | 
| 
       42 
     | 
    
         
            -
                    error_div.toggle();
         
     | 
| 
       43 
44 
     | 
    
         
             
                    error_div.html(error);
         
     | 
| 
      
 45 
     | 
    
         
            +
                    error_div.show();
         
     | 
| 
       44 
46 
     | 
    
         
             
                    $(".payola-checkout-button").prop("disabled", false);
         
     | 
| 
       45 
47 
     | 
    
         
             
                    $(".payola-checkout-button-spinner").hide();
         
     | 
| 
       46 
48 
     | 
    
         
             
                    $(".payola-checkout-button-text").show();
         
     | 
| 
       47 
49 
     | 
    
         
             
                },
         
     | 
| 
       48 
50 
     | 
    
         | 
| 
       49 
51 
     | 
    
         
             
                poll: function(guid, num_retries_left, error_div_id) {
         
     | 
| 
      
 52 
     | 
    
         
            +
                    console.log(error_div_id);
         
     | 
| 
       50 
53 
     | 
    
         
             
                    if (num_retries_left == 0) {
         
     | 
| 
       51 
54 
     | 
    
         
             
                        Payola.showError("This seems to be taking too long. Please contact support and give them transaction ID: " + guid, error_div_id);
         
     | 
| 
       52 
55 
     | 
    
         
             
                        return;
         
     | 
| 
         @@ -58,7 +61,7 @@ var Payola = { 
     | 
|
| 
       58 
61 
     | 
    
         
             
                        } else if (data.status === "errored") {
         
     | 
| 
       59 
62 
     | 
    
         
             
                            Payola.showError(data.error, error_div_id);
         
     | 
| 
       60 
63 
     | 
    
         
             
                        } else {
         
     | 
| 
       61 
     | 
    
         
            -
                            setTimeout(function() { Payola.poll(guid, num_retries_left - 1) }, 500);
         
     | 
| 
      
 64 
     | 
    
         
            +
                            setTimeout(function() { Payola.poll(guid, num_retries_left - 1, error_div_id) }, 500);
         
     | 
| 
       62 
65 
     | 
    
         
             
                        }
         
     | 
| 
       63 
66 
     | 
    
         
             
                    });
         
     | 
| 
       64 
67 
     | 
    
         
             
                }
         
     | 
| 
         @@ -9,10 +9,19 @@ 
     | 
|
| 
       9 
9 
     | 
    
         
             
              allow_remember_me = local_assigns.fetch :allow_remember_me, true
         
     | 
| 
       10 
10 
     | 
    
         
             
              email = local_assigns.fetch :email, ''
         
     | 
| 
       11 
11 
     | 
    
         
             
              verify_zip_code = local_assigns.fetch :verify_zip_code, false
         
     | 
| 
      
 12 
     | 
    
         
            +
                
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
       13 
14 
     | 
    
         
             
              button_id = "payola-button-#{sale.product.product_class}-#{sale.product.permalink}"
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
       15 
16 
     | 
    
         
             
              form_id = "#{button_id}-form"
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              error_div_id = local_assigns.fetch :error_div_id, ''
         
     | 
| 
      
 19 
     | 
    
         
            +
              if error_div_id.present?
         
     | 
| 
      
 20 
     | 
    
         
            +
                show_default_error_div = false
         
     | 
| 
      
 21 
     | 
    
         
            +
              else
         
     | 
| 
      
 22 
     | 
    
         
            +
                error_div_id = "#{button_id}-errors"
         
     | 
| 
      
 23 
     | 
    
         
            +
                show_default_error_div = true
         
     | 
| 
      
 24 
     | 
    
         
            +
              end
         
     | 
| 
       16 
25 
     | 
    
         
             
            %>
         
     | 
| 
       17 
26 
     | 
    
         | 
| 
       18 
27 
     | 
    
         
             
            <script src="https://checkout.stripe.com/checkout.js"></script>
         
     | 
| 
         @@ -23,7 +32,9 @@ 
     | 
|
| 
       23 
32 
     | 
    
         
             
                <span class="payola-checkout-button-text" style="display: block; <%= button_inner_style %>"><%= button_text %></span>
         
     | 
| 
       24 
33 
     | 
    
         
             
                <span class="payola-checkout-button-spinner" style="display: none; <%= button_inner_style %>">Please wait...</span>
         
     | 
| 
       25 
34 
     | 
    
         
             
              </button>
         
     | 
| 
       26 
     | 
    
         
            -
               
     | 
| 
      
 35 
     | 
    
         
            +
              <% if show_default_error_div %>
         
     | 
| 
      
 36 
     | 
    
         
            +
                <div class="payola-error-target" style="display:none", id="<%= error_div_id %>"></div>
         
     | 
| 
      
 37 
     | 
    
         
            +
              <% end %>
         
     | 
| 
       27 
38 
     | 
    
         
             
            <% end %>
         
     | 
| 
       28 
39 
     | 
    
         
             
            <script type="text/javascript">
         
     | 
| 
       29 
40 
     | 
    
         
             
              Payola.setUpStripeCheckoutButton({
         
     | 
    
        data/lib/payola/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: payola-payments
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Pete Keen
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-10-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     |