Reconcile



Stripe and Xero reconcile

Stripe and Xero reconcile


Stripe Payouts

On an individual payout screen run the following to output a list of Stripe transactions with the associated fees.

fees = jQuery('tr.Table-row.DataTable-row:nth-child(1) td:nth-child(4)').text();
stripe_transactions = [];
jQuery('.bs-ObjectList-group a').each(function() {
    transaction = jQuery(this).attr('href').replace("/payments/", "");
    stripe_transactions.push(transaction);
    console.log(transaction);
});
console.log( "Fees: "+ fees );
console.log( "stripe_transactions = "); stripe_transactions

This makes matching the transactions within Xero a simple copy/paste and search. For bulk transactions you can bring over the stripe_transactions variable and run through this to automate Xero reconcile.

total_transactions = stripe_transactions.length;
current_transation = 0;
var checkExist = setInterval(function() {
  document.querySelector('.newsearchcol input#searchNameText').value = stripe_transactions[current_transation];
   // Results more then 2 so trigger go button
   if ( document.querySelectorAll('div#availableTransactionList .transaction-row div.checkbox input').length > 2 ) {
       document.querySelector('.newsearchcol a.xbtn.blue').click();
   }
   if ( document.querySelectorAll('div#availableTransactionList .transaction-row div.checkbox input').length == 1 ) {
      document.querySelector('div#availableTransactionList .transaction-row div.checkbox input').click();
      if (document.querySelectorAll('#selectedTransactionList div.transaction-row').length == current_transation ) { 
      document.querySelector('.newsearchcol a.xbtn.blue').click();
      console.log(current_transation);
      current_transation = current_transation + 1;
      }
      if ( current_transation == total_transactions ) {
         clearInterval(checkExist); // final transation processed so stop
      }
   }
}, 400); // check every 100ms