• Resolved ttoaster

    (@ttoaster)


    Hi,

    I don’t want to use the “official” Woocommerce Stripe plugin as it is very buggy/glitchy, I’d much rather use yours.

    However, you don’t appear to capture the same data as the “official” stripe plugin, such as:

    – Stripe Net (Net value after fees deducted)
    – Stripe Fee charged

    On the “official” plugin this data is captured and shown on the order record for admin, and can be exported via csv, etc. which is great when trying to do my sales figures.

    It would also be useful if you could also capture the converted currency value, e.g customer pays in US Dollars, and Stripe converts that to my base currency, British Pounds.

    Any chance you can add these, please?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @ttoaster,

    However, you don’t appear to capture the same data as the “official” stripe plugin, such as:

    Yes, no two plugins are exactly alike and we have determined what data to capture and what not to capture for many reasons, one of which is performance. Just because one plugin does something doesn’t mean the other must.

    It would also be useful if you could also capture the converted currency value, e.g customer pays in US Dollars, and Stripe converts that to my base currency, British Pounds.

    Every additional piece of data that is stored in the WordPress database has a performance impact that must be weighed. I can take a look at adding these options but I can’t make any guarantees. Any change I make to the plugin impacts all of its users and not everyone cares about having the same fields available.

    This is why we have made this plugin very customizable. You can actually add all of these items you’re requesting using some very basic code and the provided filters.

    Here is a link to our API docs: https://docs.paymentplugins.com/wc-stripe/api/

    I can provide the filter names that would most likely be used to add the fields you’re requesting.

    Kind Regards,

    Thread Starter ttoaster

    (@ttoaster)

    Hi,

    Thanks for your response, yes I am aware that not all plugins are the same, or have the same functionality. I have been using computers for over 40 years and the Internet since it became available in the early 90s here in the UK. ??

    I understand that not everyone wants or needs those features (and the potential overhead/impact on the database), but it would be useful if you could kindly supply some code that shows how those filters/functions/hooks can be used to achieve this (rather than adding the function directly to the plugin).

    Suspect that this code would go in the functions.php file, or elsewhere?

    Thank you for any assistance you can give.

    Regards,
    Martin

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @ttoaster,

    Suspect that this code would go in the functions.php file, or elsewhere?

    Yes, the functions.php file of your child theme will do the trick.

    https://docs.paymentplugins.com/wc-stripe/api/source-class-WC_Payment_Gateway_Stripe.html#466

    Example (test before using):

    add_action('wc_stripe_save_order_meta', function($order, $payment_method, $charge){
        $client = $payment_method->payment_object->get_gateway()
        $balance = $client->balanceTransactions->retrieve($charge->balance_transaction);
        if(!is_wp_error($balance)){
            $order->update_meta('_stripe_fee', $balance->fee);
        }
    }, 10, 3);

    Kind Regards,

    Thread Starter ttoaster

    (@ttoaster)

    Hi,

    Thank you for that.

    I tried that code in my functions.php and WordPress threw a critical error:

    Error Details
    =============
    An error of type E_PARSE was caused in line 64 of the file /var/www/my-site/wp-content/plugins/my-custom-functions/inc/php/functional.php(103) : eval()’d code. Error message: syntax error, unexpected ‘$balance’ (T_VARIABLE)

    So obviously there is some error in the code snippet?

    • This reply was modified 3 years, 1 month ago by ttoaster.
    Plugin Author Payment Plugins

    (@mrclayton)

    @ttoaster ya a missing semicolon on line 2.

    Thread Starter ttoaster

    (@ttoaster)

    Thank you, that now doesn’t cause a Critical Error. I am testing this live now, and will let you know if it works as expected.

    UPDATE: No it didn’t work, no extra fields in the order page (for admin)…

    Regards,
    Martin

    • This reply was modified 3 years, 1 month ago by ttoaster.
    Carmin

    (@carminb)

    Hi @ttoaster,

    UPDATE: No it didn’t work, no extra fields in the order page (for admin)…

    In addition to saving that value to the postmeta table, you also need to expose it in the Admin order page.

    You could use the filter woocommerce_admin_order_items_after_fees to output the fee.

    Kind Regards,

    jorelia

    (@jorelia)

    Hello,
    Is there a possibility to retrieve stripe fee without currency conversion?

    Carmin

    (@carminb)

    Hi @jorelia,

    In the next release of the plugin the Stripe Fee and Stripe Payout will be offered as a setting. Stripe provides the fee and payout in the currency of the Stripe account. We are considering adding an option where you can show this fee and payout in the currency of the order instead of your Stripe account.

    Is that what you’re referring to?

    Kind regards,

    jorelia

    (@jorelia)

    @carminb this is exactly what I need – fee in the currency of the order. This is great news that it will be offered in the next release, but is it possible at the moment to get such an effect by using the actions or filters from your API?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @jorelia,

    but is it possible at the moment to get such an effect by using the actions or filters from your API?

    I wouldn’t recommend you go that route given it requires custom development. It’s better to wait until we release the next version.

    If you can’t wait then this thread goes over a basic example of how to extract that fee.

    Kind Regards,

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Can you please add the following?’ is closed to new replies.