By Rasmus Bech - Opdag Verden on Wednesday, 07 February 2018
Posted in General Issues
Replies 23
Likes 0
Views 798
Votes 0
Hi

I discovered a big issue with using discount codes and recurring payments. The issue is, new invoices are not being generated when using discount code on first invoice (other discount types has not been tested atm), only a transaction is created on for the same invoice. That is not right, and effectively makes the discount apply every time the subscription is renewed.

This is a big issue, that effects our bottom line. I've shared a dropbox link with you in "additional information" with a short video from our developer to show the issue.

I hope you can help fix this ASAP.

Thanks
Hello,

ok, m working on this issue.
Can you please share site's admin details as well as ftp details.
·
Thursday, 08 February 2018 11:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmas,

I checked this and it's not a bug. The discount coupon code you have created will applicable on every new invoice creation.
In case of recurring on next recurring payment new invoice is generated , that's why we suggest you need to create discount type each time in case of recurring.


//PAYPLANS_PRODISCOUNT_AUTO_ON_INVOICE_CREATION
//this discount type says it will be applied on every new invoice creation
//so it also applies when create new invoice of recurring subscription, but the amount asked to payment gateway is the full price.
//so make this discount type to eachtime.

$params->frequency = ($discountInstance->getCouponType() != PAYPLANS_PRODISCOUNT_EACHRECURRING)
? PayplansModifier::FREQUENCY_ONE_TIME
: PayplansModifier::FREQUENCY_EACH_TIME;


Update me if you have any confusion.
·
Thursday, 08 February 2018 13:03
·
0 Likes
·
0 Votes
·
0 Comments
·
We are using On First Invoice of Subscription - on the info (help text within the Pro Discount App) I see the following description of this discount type:

It will allow the discount amount to be applied only on the first invoice of the subscription.
Note : In case of Recurring, discount will be applied on first Recurring.

However, when testing again I found:

1. Using 100% discount on first invoice: Checkout as normal - added my credit card details with the payment gateway. Subscription created at payment gateway, and with PayPlans. On renewal, the subscription just expired. Wouldn't renew. In the log I see this message: Error occured in recurring payment.

I've seen this error log for multiple users that we likely have given a 100% discount code for on first invoice with a recurring subscription. Seems they fail to get charged now for the next payment.

2. Using 50% discount on first invoice: Checkout as normal - added my credit card details with the payment gateway. Subscription created at payment gateway, and with PayPlans. On renewal, the invoice for the subscription correctly states the full amount, but subscription is only charged 50%. This seems like a bug.

See attachment.
·
Tuesday, 15 May 2018 17:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

I checked your site. you have applied first invoce discount for recurring plans. When you apply this discount to recurring plans then recurring plans will be converted to Recurring + Trial 1 . So discount will be applied on first invoice and further payment will be done for regular amount, it depends on the payment gateway you are using that they support recurring trial period or not.
see attached screen shot.

In case of Epay they don't support recurring trial plans , for this discount code is not suggested for recurring plans, you can apply discount on each recurring invoice not for first one.
https://stackideas.com/forums/issue-with-discount-codes-and-recurring-payments-new-invoices-are-not-generated#reply-393477
I've already told you to create discount code of each recurring type for recurring plans.

So it's not possible to apply discount on first invoice in case of recurring payments because it will convert plan to recurring + trial 1 in case on first invoice discount. You can apply discount for each recurring only.

In case of paypal payment gateway there will be no issue , but in case of Epay need to check if recurring + Trial supported or not.
How many subscription having this issue , these are test payments or live one, so i can check the possibility of this.

Update me or correct me if i misunderstood.
·
Tuesday, 15 May 2018 18:28
·
0 Likes
·
0 Votes
·
0 Comments
·
We can't use a discount type "on each recurring" as the use case for us, is to give a discount only on their first payment.

I'm not sure about how many has this issue, but could be many, as we have used discount codes quite a lot in marketing campaigns to resubscribe old members.

We can't rely on PayPal - in fact we prefer not to use them. They are very expensive compared to ePay and not so commonly used in Denmark.

When using discount on first invoice with recurring, I understand it's created as a Trial 1 + Recurring. In this case, only 1 invoice is generated, but 3 payments are made, then the subscription gets expired. We are using ePay gateway for our testing.

There are 2 issues here:

1. we are required by law, to issue an invoice for each transaction. In this case, we likely have many were an invoice is not generated for a transaction.

2. how is this an issue with ePay? - I see in the ePay administration, that the subscription is created, when subscribing using discount on first invoice.

To me, it seems like the is an issue generating a new invoice for each transaction is this scenario.
·
Tuesday, 15 May 2018 19:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

1. we are required by law, to issue an invoice for each transaction. In this case, we likely have many were an invoice is not generated for a transaction.
can you tell me one of the subscription having this issue, so able to check it.

2. how is this an issue with ePay? - I see in the ePay administration, that the subscription is created, when subscribing using discount on first invoice.
I checked your site and found the issue. After applying 100% discount on forst invoice of subscription plan changed to recurring Trial.
So you have created one more discount couon on first invoice will is applicable for Recurring plan (see attached screen shot). In case of recurring payment, for every further recurring payment new invoice will be generated, that's why 50% discount code applied on that also.that's why discount applied on each recurring one. this should work because in Epay payment method payment collected at site itself by api.

I have checked and found that you have changed the discount coupon with diffrent percentage value. Can you try one ore payment with 100% discount on first invoice. During this process don't change the discount code.

Update me with the results.
·
Wednesday, 16 May 2018 15:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Regarding 1: Please look at index.php?option=com_payplans&view=subscription&task=edit&id=15498 - this is a PayPal subscription that I created yesterday, with a discount on first invoice. You said that the system worked perfectly with PayPal, so I wanted to test if it was indeed an issue with the gateway.

About an hour ago, I received a mail from PayPal that I've sent a new subscription payment (2'nd payment in total). About the same time, the subscription was expired in PayPlans, and I can see only one invoice was generated.

Same can be seen with index.php?option=com_payplans&view=subscription&task=edit&id=15492 from yesterdays testing, using ePay.
·
Wednesday, 16 May 2018 20:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

I checked the subscription you have paid through paypal. Payplans don't support expiration time in min , minimum time 1 day.
As you tried it for 5 min , that's why recurring plans expired because expiration date set to 5 mins. So as per minimum expiration time got notification from paypal after 1 day and second payment was without discount and your subscription also get activated. this issue is coming because of expiration time set in min as paypal don't support recurring payment in minutes.
see attached screen shot. So in case of paypal discount on first invoice only is working fine.

In case of ePay , i see only one invoice is generated but more than one transaction. Can you do one test recurring payment with Epay without applying discount. After that update me the subscription id , so i'll check it.
Have you done any kind of customisation in core code , if yes then please update me the changes.

Update me.
·
Thursday, 17 May 2018 11:54
·
0 Likes
·
0 Votes
·
0 Comments
·
I have tested PayPal with one day recurring subscription and with discount on first invoice. It works as expected, generating a new invoice on each payment.

As for ePay, this is an ongoing issue we need to get resolved ASAP. We see multiple issues.
1. multiple payments for the same subscriptions
2. recurring not working with discount on first invoice. In this case, only the first invoice is generated and subscription gets expired after 3 payments.

I have created a test recurring subscription with ePay without discount. Subscription ID: 15556

No core code have been changed.
·
Tuesday, 22 May 2018 17:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Please see this video: https://drive.google.com/file/d/1Fx1Gy0G1wdtG5veXBd-Mv8hA7PO0HWx7/view?usp=sharing

I've set up a vanilla Joomla test site with only Payplans and ePay - the issue remains, but I found a connection with getting the correct invoice amount, that seems to cause the problem when using discount on first invoice.
·
Tuesday, 22 May 2018 20:26
·
0 Likes
·
0 Votes
·
0 Comments
·
There is clearly an issue with $invoiceCount. Perhaps this is the real issue.

Tried to set up some code that mails me the invoice count whenever the processPayment function is called. $invoiceCount remains at 1. If I hardcoded the $invoiceCount to the next invoice number(count), then it picks up the correct price and completes the transaction and marks the invoice as paid.

Then again, this could be because of a count using the wrong invoice id?

I tried to mail be the content of the PayplansPayment Object that is sent to the processPayment function. Even though the last invoice has id 52, then when looking at the PayplansPayment Object, I get the first invoice id 46 for this subscription. I would expect invoice_id to be 52, but I could be wrong here?

Anyway, there is an issue - I hope to have provided enough feedback so you can find the bug and fix it.
·
Tuesday, 22 May 2018 21:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

Thanks for sharing detailed information on this.
I am working on this issue and will provide you this fix asap once get fixed.
·
Wednesday, 23 May 2018 01:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

Find attached kit of ePay payment method with changes, install it.
Please take a look on this issue and let me know if still issue persist.
·
Wednesday, 23 May 2018 13:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry for the late reply. We had hoped this issue was fixed, but have discovered that the issue persists. So we have to look at this issue again...

Please take a look at this subscription: https://www.opdagverden.dk/administrator/index.php?option=com_payplans&view=subscription&task=edit&id=11987

Only one invoice generated, but 2 there are transactions. With only one invoice, they keep getting the first invoice discount. When we discover it, we shorten the subscription time, to make up for it, but we don't catch all, so would really like to get this fixed.

This one also looks a bit messy
https://www.opdagverden.dk/administrator/index.php?option=com_payplans&view=subscription&task=edit&id=11375

Please let me know, what it will take to get it fixed, so:

1. an invoice is generated for each transaction. (I believe this will also fix the first invoice discount issue with ePay)

Backend and FTP details has been provided in this ticket: https://stackideas.com/forums/multiple-callbacks-results-in-multiple-renewals-of-the-subscription

Thanks
·
Monday, 24 September 2018 17:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

Yes, i am able to login with backend and ftp details.
Will check this issue and update you.

Thank you for understanding.
·
Monday, 24 September 2018 19:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Any news about this issue?
Thanks
·
Monday, 08 October 2018 17:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Rasmus,

Sorry for the delayed response. I've done some changes in ePay app to resolve this issue.
Please find attached kit of ePay and check this issue again.

Update me if still issue persist.

Thank you for understanding !
·
Monday, 08 October 2018 17:38
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post