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-
AuthorPosts
-
November 6, 2017 at 3:59 pm #742
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,
KonstantinosNovember 6, 2017 at 7:41 pm #743Hello,
Do you have the latest WPI Stripe installed? Please provide wp-admin details and we will take a look.
Thanks,
Stiofan
November 6, 2017 at 8:20 pm #744This reply has been marked as private.November 7, 2017 at 7:57 am #745Hi 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=stripeLet us know.
Thanks,
KiranNovember 13, 2017 at 7:19 pm #793Thank 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,
KonstantinosNovember 14, 2017 at 4:26 am #794Hi Konstantinos,
The snippet is provided for customization on your request, so this will be not in future update.
Kiran
November 14, 2017 at 2:47 pm #796Thank you Kiran, I appreciate your help.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket