Invoice renewal payment issue

This topic contains 6 replies, has 3 voices, and was last updated by  Konstantinos 7 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #742

    Konstantinos
    Free User
    Post count: 61

    Hello and thank you for all the new updates and work you ve made. Its really a big improvement.

    I ve installed all the latest updates for wpgeodirectory, wpinvoicing and wpusers and i am performing some live payments tests before i make the website live. I ve set up a recurring plan and created 2 listings. One was paid through paypal and the other through stripe. Here is what i ve noticed:

    Paypal creates an invoice for each renewal and all these invoices can be viewed thought the initial invoice or individually. This is really nice. The issue with it, is that it takes the listing to pending status after each renewal. I ve set the Paid Listing Status option on the payment manager of geodirectory to Pending review, because i would like to review the listings before making them live. However, it seems that because a new invoice is being created at each renewal, then the listing is getting the pending status again. Is there a way to make the listing get the pending status only at the first payment?

    On Stripe, each time you create a listing you get one invoice and thats it. You dont get additional invoices for each renewal. This means that you dont have the issue with the pending status but you dont get to see the additional payments that have been made and the Times Billed section of the invoice always says : 1

    Thank you in advance,
    Konstantinos

    #743

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    Do you have the latest WPI Stripe installed? Please provide wp-admin details and we will take a look.

    Thanks,

    Stiofan

    #744

    Konstantinos
    Free User
    Post count: 61
    This reply has been marked as private.
    #745

    Kiran
    Moderator
    Post count: 7069

    Hi Konstantinos,

    Is there a way to make the listing get the pending status only at the first payment?

    Use following code snippet. This will set published status for the listing on renewal payments.

    
    
    function _wpi_custom_payment_set_status_for_renewal( $status ) {
        global $_wpi_custom_renewal_invoice;
    
        if ( $_wpi_custom_renewal_invoice ) {
            $_wpi_custom_renewal_invoice = false;
            $status = 'publish';
        }
    
        return $status;
    }
    add_filter( 'geodir_payment_paid_listing_status', '_wpi_custom_payment_set_status_for_renewal', 10, 1 );
    
    function _wpi_custom_payment_set_global_renewal( $invoice_id, $old_status ) {
        global $_wpi_custom_renewal_invoice;
    
        $invoice = wpinv_get_invoice( $invoice_id );
    
        if ( !empty( $invoice->ID ) && $invoice->is_renewal() ) {
            $_wpi_custom_renewal_invoice = true;
        } else {
            $_wpi_custom_renewal_invoice = false;
        }
    }
    add_action( 'wpinv_status_publish', '_wpi_custom_payment_set_global_renewal', 10, 2 );
    add_action( 'wpinv_status_wpi-renewal', '_wpi_custom_payment_set_global_renewal', 10, 2 );

    On Stripe, each time you create a listing you get one invoice and thats it. You dont get additional invoices for each renewal. This means that you dont have the issue with the pending status but you dont get to see the additional payments that have been made and the Times Billed section of the invoice always says : 1

    It seems you have not added a webhook url at your Stripe Account Settings. Please add a Webhook URL for your site in your Stripe Dashboard > API > Webhooks > Add ednpoint and select all events.
    The URL should be like:
    https://WWW.YOUSITE.COM/index.php?wpi-listener=IPN&wpi-gateway=stripe

    Let us know.

    Thanks,
    Kiran

    #793

    Konstantinos
    Free User
    Post count: 61

    Thank you Kiran, that function did the trick. You were also correct about the missing webhook. It seems it was removed by either an update i made in stripe’s api or by moving from test to live mode.

    One questions regarding the function. Is this something you are going to include in a future update?

    Thank you again,
    Konstantinos

    #794

    Kiran
    Moderator
    Post count: 7069

    Hi Konstantinos,

    The snippet is provided for customization on your request, so this will be not in future update.

    Kiran

    #796

    Konstantinos
    Free User
    Post count: 61

    Thank you Kiran, I appreciate your help.

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket