[DBTech] DragonByte Donate

[DBTech] DragonByte Donate [Paid] 3.0.3

No permission to buy ($14.95)
See, we are not using $. So in our currency that number is not so high. A simple example, 500000 toman equals $160.
But because we want to refer users to zarinpal (and not paypal) and zarinpal get toman (and not $) so we use that number.
Even when i enter 500000 it changes it to 9999.
Also our currency doesn't have decimal.
I've added a hotfix that resolves this issue.


Fillip
 
Also I find no place to set it to use bd zarinpal as its paygate. It just goes to paypal.
I've discovered the reason for this: [bd] Paygates will refuse to use any currency that isn't among the Big Five, so I need to override the list of currencies. That would also explain why I didn't have any issues in testing, since I was only testing with the built-in currency list.


Fillip
 
Where exactly are you seeing this?
about decimal:
2016-08-17_10-54-35.webp
(we everywhere in our other add-ons have option to show/hide decimals)

about the limitation of amount to 9999:
2016-08-17_10-52-46.webp

also, we always have option to show currency sign on right side of the number or left. (but not we are forced to use it like English structure. As you may know, our language is RTL and anyway we write currency name or sign after the number. For example your say "$10" and we say "10 تومان". we write the number first, then the name of currency. So an option can fix this)

At the end, you may say "these are kind of custom requests and I should do them for myself." but its not right. Number of people here that have RTL languages (and exctly the same situation as I described) is a high number.

If there were any developer tutorials for the mod that would be handy of course, as it stands I can only look at and replicate what other donation mods do in order to support bd paygates.
I'll contact you about some hint for it.
 
I updated the add-on.

The result so far:
  • Now we can enter any amount we want. (fixed)
  • We still see decimal (although we don't have decimal in our currency)
  • We still be redirected to paypal (instead of zarinpal. Because we use bd zarinpal as our paygate)
 
Also when I try to delete a currency, it says: Mysqli prepare error: Unknown column 'title' in 'field list'
 
Hi,
Any ability to Allow a user to donate, and then automatically move add the user to a new group (Much like a Donate -> user upgrade scenario)??
Cheers
 
Hi,
Any ability to Allow a user to donate, and then automatically move add the user to a new group (Much like a Donate -> user upgrade scenario)??
Cheers
Yes, this mod does indeed feature the option of setting additional usergroups to be awarded on a per donation drive basis. For instance, you could have one drive for server costs and have donating to this drive award a Supporter usergroup, and another drive for event reward funds and have donating to this drive award a Game Master usergroup :)


Fillip
 
Feature request:

Let members donate toward suggestions/feature requests.
Often members post suggestions on functionality to improve the site. It would be great if members would be able to pay for specific features. This would create a new stream of income for sites. Here is how it could work:
  1. Add a 'donate to this suggestion' block to threads in a specific forum. This is basically a donation drive for that specific feature, without an end date.
  2. Administrators can add such a donation goal to a thread and set the goal amount.
  3. The block displays the goal amount needed and the amount donated so far.
 
We still be redirected to paypal (instead of zarinpal. Because we use bd zarinpal as our paygate)
I believe I have resolved this in tonight's Beta 2 update.

The problem was that since [bd] Paygates only support a few select currencies, whereas we allow you to use any currency you wish, I had to take additional steps (that no other donate mod have had to do :)) to force the currency array in Paygates to change. There were some issues with uppercase vs lowercase currency codes that caused this to not work as intended for certain currencies.

I've tested it with the built-in Paygates PayPal processor as well as Stripe, so hopefully it should work fine with zarinpal as well :)


Fillip
 
I believe I have resolved this in tonight's Beta 2 update.

The problem was that since [bd] Paygates only support a few select currencies, whereas we allow you to use any currency you wish, I had to take additional steps (that no other donate mod have had to do :)) to force the currency array in Paygates to change. There were some issues with uppercase vs lowercase currency codes that caused this to not work as intended for certain currencies.

I've tested it with the built-in Paygates PayPal processor as well as Stripe, so hopefully it should work fine with zarinpal as well :)


Fillip
Perfect. I'll be waiting for its release. I'll then share the result.
 
DragonByte Tech updated [DBTech] DragonByte Donate with a new update entry:

2.0.0 Beta 2

Fix: [bd] Paygates would refuse to run in certain scenarios
Fix: A limit of 9999 was incorrectly applied to the Donation Drive goal
Fix: Attempting to set goals higher than the maximum allowed would produce a MySQL error
Fix: Adding new currencies would produce a server error
Fix: Deleting a currency would produce a MySQL error

Read the rest of this update entry...
 
Updated to latest version, and this is the result:
  • Now we can donate using bd banking. But when we pay, although it decreases from the wallet, but still it shows "0.00 received" in donation drive. and below it, it is written "no one donated yet, do you want to be first?". But I paid and the amount decreased from my wallet (wallet = bd banking)
  • I try to pay using bd zarinpal. It went to zarinpal and when I paid, it came to my site in a page with error. (this link) and when i refreshed the page, it went to donation drive page. And it shows "0.00 received" in donation drive. and below it, it is written "no one donated yet, do you want to be first?". But it decreased from my bank account and added to my zarinpal account.
  • during these problems I got some error log. I'll write them below. (so I didn't continue for other parts for now)
Code:
ErrorException: Undefined property: stdClass::$rates - library/DBTech/Donate/Model/Currency.php:283
Generated By: Hamed-Azimi, 8 minutes ago
Stack Trace
#0 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/Model/Currency.php(283): XenForo_Application::handlePhpError(8, 'Undefined prope...', '/home/xenforo/d...', 283, Array)
#1 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/Model/Currency.php(315): DBTech_Donate_Model_Currency->getExchangeRates()
#2 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/DataManager/Currency.php(157): DBTech_Donate_Model_Currency->setExchangeRates()
#3 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/Application/DataManager.php(241): DBTech_Donate_DataManager_Currency->_postSave()
#4 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/ActionAdmin/Currency.php(174): DBTech_Donate_Application_DataManager->save()
#5 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/Application/Core.php(334): DBTech_Donate_ActionAdmin_Currency->actionUpdate()
#6 /home/xenforo/domains/mysite.com/public_html/library/DBTech/Donate/XenForo/ControllerAdmin/Donate.php(34): DBTech_Donate_Application_Core->runAction()
#7 /home/xenforo/domains/mysite.com/public_html/library/XenForo/FrontController.php(351): DBTech_Donate_XenForo_ControllerAdmin_Donate->actionIndex()
#8 /home/xenforo/domains/mysite.com/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/xenforo/domains/mysite.com/public_html/admin.php(13): XenForo_FrontController->run()
#10 {main}
Request State
array(3) {
  ["url"] => string(58) "http://mysite.com/admin.php?dbtech-donate/currency"
  ["_GET"] => array(1) {
    ["dbtech-donate/currency"] => string(0) ""
  }
  ["_POST"] => array(9) {
    ["currency"] => array(7) {
      ["currencyid"] => string(3) "TOM"
      ["description"] => string(23) "تومان (ایران)"
      ["active"] => string(1) "1"
      ["displayorder"] => string(1) "1"
      ["denomination"] => string(10) "تومان"
      ["primarycurrency"] => string(1) "1"
      ["exchangerate"] => string(1) "1"
    }
    ["action"] => string(6) "update"
    ["currencyid"] => string(3) "TOM"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(62) "/admin.php?dbtech-donate/currency&action=modify&currencyid=TOM"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
    ["do"] => string(8) "currency"
    ["id"] => int(0)

Code:
XenForo_Exception: Callback returned error: - library/bdBank/ControllerPublic/Paygate.php:147
Generated By: Hamed-Azimi, 7 minutes ago
Stack Trace
#0 /home/xenforo/domains/mysite.com/public_html/library/XenForo/FrontController.php(351): bdBank_ControllerPublic_Paygate->actionPay()
#1 /home/xenforo/domains/mysite.com/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#2 /home/xenforo/domains/mysite.com/public_html/index.php(13): XenForo_FrontController->run()
#3 {main}
Request State
array(3) {
  ["url"] => string(42) "http://mysite.com/bank/paygate-pay"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(12) {
    ["client_id"] => string(0) ""
    ["amount"] => string(3) "500"
    ["currency"] => string(3) "TOM"
    ["display_name"] => string(62) "Donation for drive "کمک هزینه نگهداری سرور""
    ["callback"] => string(57) "http://mysite.com/bdpaygate/callback.php?p=bdbank"
    ["data"] => string(23) "dbtech_donate|1|152b2|4"
    ["redirect"] => string(175) "http://mysite.com/dbtech-donate/%DA%A9%D9%85%DA%A9-%D9%87%D8%B2%DB%8C%D9%86%D9%87-%D9%86%DA%AF%D9%87%D8%AF%D8%A7%D8%B1%DB%8C-%D8%B3%D8%B1%D9%88%D8%B1.1/drive?success=1"
    ["hash"] => string(32) "dba393d351894b025baf4f2ab529bc67"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(51) "/dbtech-donate/donate?action=donate&transactionid=4"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

Code:
ErrorException: Fatal Error: Using $this when not in object context - library/DBTech/Donate/DataManager/Donation.php:103
Generated By: Unknown Account, 8 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
  ["url"] => string(57) "http://mysite.com/bdpaygate/callback.php?p=bdbank"
  ["_GET"] => array(1) {
    ["p"] => string(6) "bdbank"
  }
  ["_POST"] => array(8) {
    ["client_id"] => string(0) ""
    ["amount"] => string(3) "500"
    ["currency"] => string(3) "TOM"
    ["display_name"] => string(62) "Donation for drive "کمک هزینه نگهداری سرور""
    ["data"] => string(23) "dbtech_donate|1|152b2|4"
    ["transaction_id"] => string(5) "19907"
    ["calculated_money"] => string(3) "500"
    ["verifier"] => string(32) "ca117bd73c76f2cee0c8f13596f6aaf0"
  }
}
 
I've added two hotfixes that should resolve the donation DataManager error as well as the error on currency modify.

I've no idea if that'll resolve the 3rd issue but we can hope :)

Sorry for the trouble, the BD integration couldn't really be tested very thoroughly locally, so I kinda rely on outside testing help for this :)


Fillip
 
Yes, this mod does indeed feature the option of setting additional usergroups to be awarded on a per donation drive basis. For instance, you could have one drive for server costs and have donating to this drive award a Supporter usergroup, and another drive for event reward funds and have donating to this drive award a Game Master usergroup :)


Fillip

Hi Fillip,
Thats great - many thanks :)

Is there any way that a user can be added to a group for a particular period of time?

this is what i'm trying to achieve.... :)
I.e. someone donates. User moved to "supporter" group for a period of 12 months.
Same person donates 6 months later - date reset to 12 months from current date.
if no donations in the last 12 months, user returned to "standard" user status.

Is this/Would this be possible?

Cheers
Paul
 
Nothing has been changed since my last post. Upgraded the add-on and tested again, and both bd banking and bd zarinpal did the same (decreased and transferred the money. But in donation drive it shows nothing yet.)
New result:
Code:
ErrorException: Fatal Error: Call to undefined method DBTech_Donate_Model_Drive::_getDriveModel() - library/DBTech/Donate/DataManager/Donation.php:103
Generated By: Unknown Account, 1 minute ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
  ["url"] => string(57) "http://mysite.com/bdpaygate/callback.php?p=bdbank"
  ["_GET"] => array(1) {
    ["p"] => string(6) "bdbank"
  }
  ["_POST"] => array(8) {
    ["client_id"] => string(0) ""
    ["amount"] => string(3) "500"
    ["currency"] => string(3) "TOM"
    ["display_name"] => string(62) "Donation for drive "کمک هزینه نگهداری سرور""
    ["data"] => string(23) "dbtech_donate|1|025c5|6"
    ["transaction_id"] => string(5) "19909"
    ["calculated_money"] => string(3) "500"
    ["verifier"] => string(32) "ca117bd73c76f2cee0c8f13596f6aaf0"
  }
}
Code:
XenForo_Exception: Callback returned error: - library/bdBank/ControllerPublic/Paygate.php:147
Generated By: Hamed-Azimi, A moment ago
Stack Trace
#0 /home/xenforo/domains/mysite.com/public_html/library/XenForo/FrontController.php(351): bdBank_ControllerPublic_Paygate->actionPay()
#1 /home/xenforo/domains/mysite.com/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#2 /home/xenforo/domains/mysite.com/public_html/index.php(13): XenForo_FrontController->run()
#3 {main}
Request State
array(3) {
  ["url"] => string(42) "http://mysite.com/bank/paygate-pay"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(12) {
    ["client_id"] => string(0) ""
    ["amount"] => string(3) "500"
    ["currency"] => string(3) "TOM"
    ["display_name"] => string(62) "Donation for drive "کمک هزینه نگهداری سرور""
    ["callback"] => string(57) "http://mysite.com/bdpaygate/callback.php?p=bdbank"
    ["data"] => string(23) "dbtech_donate|1|025c5|6"
    ["redirect"] => string(175) "http://mysite.com/dbtech-donate/%DA%A9%D9%85%DA%A9-%D9%87%D8%B2%DB%8C%D9%86%D9%87-%D9%86%DA%AF%D9%87%D8%AF%D8%A7%D8%B1%DB%8C-%D8%B3%D8%B1%D9%88%D8%B1.1/drive?success=1"
    ["hash"] => string(32) "a94d761f5119ee59c3cfaf9b507b1fee"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(51) "/dbtech-donate/donate?action=donate&transactionid=6"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Hi Fillip,
Thats great - many thanks :)

Is there any way that a user can be added to a group for a particular period of time?

this is what i'm trying to achieve.... :)
I.e. someone donates. User moved to "supporter" group for a period of 12 months.
Same person donates 6 months later - date reset to 12 months from current date.
if no donations in the last 12 months, user returned to "standard" user status.

Is this/Would this be possible?

Cheers
Paul
Ahh I see... I'm noticing there is a DB table in XenForo that stores temporary usergroup changes, I will investigate whether this table can be utilised for this purpose.

EDIT: I've looked into this and it should be possible for me to create an expiry option similar to how XenForo creates its Warnings (default to permanent). Look for it in a future version :)

New result:
Code:
ErrorException: Fatal Error: Call to undefined method DBTech_Donate_Model_Drive::_getDriveModel() - library/DBTech/Donate/DataManager/Donation.php:103
That's what I get for coding at half past midnight when I can barely keep one eye open. Sorry about that, I've made another hotfix that should resolve that.


Fillip
 
Last edited:
Fillip - Many thanks :)

I'm not a coder so please excuse the vague explanation, however i believe all that needs to happen is that the "supporters" group needs to be added to the users "secondary" user group (as below), rather than a complete change of groups... As i understand it, this is the preffered way to hand these within xF...

upload_2016-8-23_15-52-37.webp

the user group is left the same - and all that happens is that after x number of days the secondary group is removed, leaving the user with their standard access....

Or maybe an alternative way would be for the Admin to manually set up a user upgrade, and via the donate it just adds the person to the list... this way the donation add-on wouldn tneed to handle the detail...

Think i'll go purchase now, since it's almost there :D

cheers :)
Paul
 
Top Bottom