This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| # MIT license, do whatever you want with it | |
| # | |
| # This is my invoice.php page which I use to make invoices that customers want, | |
| # with their address on it and which are easily printable. I love Stripe but | |
| # their invoices and receipts were too wild for my customers on Remote OK | |
| # | |
| require_once(__DIR__.'/../vendor/autoload.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var braintreeButton = document.querySelector('#submit-button'); | |
| braintree.dropin.create({ | |
| authorization: clientToken, | |
| container: '#dropin-container' | |
| }, function (createErr, instance) { | |
| braintreeButton.addEventListener('click', function () { | |
| $(this).prop('disabled', true).text('Verifying credit card details...'); | |
| $('.braintree-large-button[data-braintree-id="toggle"]').hide(); | |
| instance.requestPaymentMethod(function (requestPaymentMethodErr, payload) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="dropin-wrapper"> | |
| <div id="checkout-message"></div> | |
| <div id="dropin-container"></div> | |
| <button id="submit-button">Continue</button> | |
| </div> | |
| <!--Load the braintree JS SDK and our custom JS code which gets payment_method_nonce and tries--> | |
| <!--to verify and add credit card. client_token is passed as a variable from controller to JS--> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Spree | |
| module ImageDecorator | |
| def find_dimensions | |
| return unless valid? | |
| super | |
| end | |
| ::Spree::Image.prepend self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def check_source_level(collection_class, com) | |
| ac_ids = collection_class.upsert_processor.where(company_id: com.id).ids | |
| ac_id_hashes = ac_ids.map { |x| BaseMongoObject.hash_string(x.to_s) } | |
| chunk_id_hashes = DailyShardingStrategy.date_range_to_chunk_hashes(Date.current - 30.months, Date.current) | |
| res = {} | |
| chunk_id_hashes.each do |chunk_id_hash| | |
| filter = { collection_class.upsert_processor.ad_account_field.to_s =>{"$in"=>ac_ids}, | |
| collection_class.upsert_processor.ad_account_id_hash_field => { "$in" => ac_id_hashes }, | |
| "chunk_id_hash": { "$in" => [chunk_id_hash]}, | |
| "custom_tags.Account.source": { "$exists" => true }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| D = cts.split("\n") # To create(spot level) | |
| C = saleshouse.split("\n") # spot level | |
| B = tv_channels.split("\n") # campaign level | |
| A = account_ids.split("\n") #account level | |
| values = A.zip(B, C, D) | |
| # values = [['A', 'B', 'C', 'D'], ['A2', 'B2', 'C2', 'D2'],.....] | |
| keys = ["account_id", "channel", "saleshouse", "Correct TV Saleshouse"] |