The ajax processing message in Direct Stripe is filtered by the filter hook ‘direct_stripe_processing_transaction_spinner’.

Five parameters are passed :

  1. The whole html content
  2. The first html line
    <div id="loadingDS" style="display:none;">
  3. The last html line
  4. The html line with text (Processing animated)
    <h2 class="loadingDS" data-text="' . __('Processing', 'direct-stripe') . '">' . __('Processing', 'direct-stripe') . '</h2>
  5. The html line with svg image (dots)
    <img src="' . DSCORE_URL . '/assets/images/three-dots.svg" width="60" alt="">

The next example returns a custom image that will show when transaction is processing.

function ds_change_spinnner_image( $html, $begin, $end ) {
  $html = $begin;
  $html .= '<img src="my-custom-svg-or-gif-uri" alt="" width="60" />'; 
  $html .= $end; 
   return $html; 
add_filter('direct_stripe_processing_transaction_spinner', 'ds_change_spinnner_image', 10, 3 );

The ‘my-custom-svg-or-gif-uri’ is to be replaced by the custom uri of the spinner image!

Leave a Reply

Your email address will not be published. Required fields are marked *