This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

zovi

  • ***
  • 29 posts
Pay with credits not possible
« on: February 04, 2018, 03:15:56 PM »
Hi
In my page an user can not pay with credits when the amount of the product is the same as the credit in the wallet. But it should.

For ex. a product is cost 5.- and in the wallet are 5.- the button "Pay with credits" is Gray backgrounded and the tooltip saying "You do not having enough founds in your wallet (see Print-screen).
If I ad 1.- to the User (he has now 6.-), the payment works fine with "Pay with credits".


Plugin v1.4.1
Osclass v3.7.4

Can someone imagine why this is not working?

Thanks for help
« Last Edit: February 04, 2018, 03:47:33 PM by zovi »

*

Ivanko

  • *****
  • 388 posts
Re: Pay with credits not possible
« Reply #1 on: February 05, 2018, 08:17:51 AM »
Hi
In my page an user can not pay with credits when the amount of the product is the same as the credit in the wallet. But it should.

For ex. a product is cost 5.- and in the wallet are 5.- the button "Pay with credits" is Gray backgrounded and the tooltip saying "You do not having enough founds in your wallet (see Print-screen).
If I ad 1.- to the User (he has now 6.-), the payment works fine with "Pay with credits".


Plugin v1.4.1
Osclass v3.7.4

Can someone imagine why this is not working?

Thanks for help


sign off as admin and sign on as user - pay with credits.

*

MB Themes

Re: Pay with credits not possible
« Reply #2 on: February 05, 2018, 11:11:55 AM »
@zovi
In functions.php find line:
Code: [Select]
if($wallet['formatted_amount'] > $amount) {
and change it to:
Code: [Select]
if($wallet['formatted_amount'] >= $amount) {
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: Pay with credits not possible
« Reply #3 on: February 05, 2018, 02:01:38 PM »
@zovi
In functions.php find line:
Code: [Select]
if($wallet['formatted_amount'] > $amount) {
and change it to:
Code: [Select]
if($wallet['formatted_amount'] >= $amount) {

mini bug ? :o

*

MB Themes

Re: Pay with credits not possible
« Reply #4 on: February 05, 2018, 03:40:33 PM »
@Ivanko
Yes it seems like that
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • ***
  • 29 posts
Re: Pay with credits not possible
« Reply #5 on: February 06, 2018, 12:20:57 AM »
Thanks.
OK, did both.
First: Logout and login did change anything (but thanks for the idea).
Second: I added the "=" and thataa... the button "pay with credits" is showing normal and ready to pay.
But then I tried to pay...  "There was some errors, please try later or contact the administrator" !  :-[

So I tried it many times also with 30min rest between. Did not work.
Then I added 1.- to the User manual as admin (now 6.-) and it works fine.
You can see it at the print-screens.

It was a fresh created brand new user and I give them the 5.- with the osclass_pay option "Add credits to new user".

Is there a rounding error or something like that?
Thanks for your great help.

*

zovi

  • ***
  • 29 posts
Re: Pay with credits not possible
« Reply #6 on: February 06, 2018, 12:42:12 AM »
Re hi

Now I tried with the osclass_pay option "Add credits to new user" to give a new user 5.0000001 instead of 5.-
Then, I deleted the old user and created a new one. Oclass_pay give him again 5.- (5.0000001). After that, I created a new listening and paid it. That worked fine.

Have a look at the print-screens

So in my opinion it has to be something with rounding!?
What do you think?

*

MB Themes

Re: Pay with credits not possible
« Reply #7 on: February 06, 2018, 08:21:33 AM »
@zovi
This should fix issue.

uote author=MB Themes link=topic=2802.msg13916#msg13916 date=1517825515]
In functions.php find line:
Code: [Select]
if($wallet['formatted_amount'] > $amount) {
and change it to:
Code: [Select]
if($wallet['formatted_amount'] >= $amount) {[/quote]
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • ***
  • 29 posts
Re: Pay with credits not possible
« Reply #8 on: February 06, 2018, 10:43:08 AM »
hi
Thanks fo answer.

Think you didn't read my post correctly (maybe it's my bad English). I did that already. Please read the second step:

Thanks.
OK, did both.
First: Logout and login did change anything (but thanks for the idea).
Second: I added the "=" and thataa... the button "pay with credits" is showing normal and ready to pay.
But then I tried to pay...  "There was some errors, please try later or contact the administrator" !  :-[

So I tried it many times also with 30min rest between. Did not work.
Then I added 1.- to the User manual as admin (now 6.-) and it works fine.
You can see it at the print-screens.

It was a fresh created brand new user and I give them the 5.- with the osclass_pay option "Add credits to new user".

Is there a rounding error or something like that?
Thanks for your great help.

The Button "Add credits to new user" is active/working after I changed the code to:
Code: [Select]
if($wallet['formatted_amount'] >= $amount) {
But I can not pay.

Marked as best answer by zovi on February 07, 2018, 10:03:43 AM
*

MB Themes

Re: Pay with credits not possible
« Reply #9 on: February 06, 2018, 10:55:33 AM »
@zovi
Found 1 more in oc-content/plugins/osclass_pay/user/wallet_pay.php

$wallet['formatted_amount'] > $fee

into
$wallet['formatted_amount'] >= $fee
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • ***
  • 29 posts
Re: Pay with credits not possible
« Reply #10 on: February 06, 2018, 12:55:28 PM »
jeyyyy. It works now!
From now on I want to call you hero  ;D

Thanks a lot

*

MB Themes

Re: Pay with credits not possible
« Reply #11 on: February 06, 2018, 02:21:11 PM »
@zovi
Welcome, do not forget to leave rating on plugin ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots