2020-05-21, 08:40 PM
Hey ppl,
I have created a forum wadakela.xyz. I have added newPoints Awards System in it. Which is integrated with CoinPayments for user to buy it.
img: https://i.imgur.com/sI7Edly.png
Now, for example I have 5 awards and user buys 3rd one. I have scripted files which send an email and PM to me notifying that "this" user has purchased an award with ''this award ID'' when the user gets on success (callback from coinpayment) page.
imgs: https://imgur.com/a/fzR1qQl
Initially, when it was not integrated with coinpayments, I used POST method to get the award ID from the form when someone clicks BUY button through awards page which actually was working fine. I could get the proper id using this code.
Now that it is integrated with CoinPayments, it's not going to the success.php directly so POST method isn't working. If I'm not wrong, I can get the award id in the success.php via cookies (or sessions maybe?). But, I'm failing to store award ID in a cookie.
As we know, it's now like this:
-awards page -> coinpayments site -> success page.
To get award ID from awards page to success page, I tried the following code to store award ID into the cookie:
(guided by this topic: https://community.mybb.com/thread-115261.html)
in success page, $award_id Always returns "5". Maybe because there are 5 awards listed?
Other than this, the whole process is very smooth and working as intended. What I want to do is to store proper award ID in the cookie.
I'd appreciate if one could help me with this. And if there's any alternate to achieve this, I'd like to know about it as well.
And also, I really need to get it done by today..
If you need more information, please let me know.
Thank you.
Well, seeing no response from anybody. I would like to know if one requires any additional information or Am I missing something?
Just to add in my previous reply: Newpoints Awards System uses NewPoints and OUGC Awards to extend them. Basically, I'm trying to get award ID (aid) of OUGC awards from awards page to the success page. Which I need help with storing award ID in a cookie..
Waiting for response! Thank you.
I have created a forum wadakela.xyz. I have added newPoints Awards System in it. Which is integrated with CoinPayments for user to buy it.
img: https://i.imgur.com/sI7Edly.png
Now, for example I have 5 awards and user buys 3rd one. I have scripted files which send an email and PM to me notifying that "this" user has purchased an award with ''this award ID'' when the user gets on success (callback from coinpayment) page.
imgs: https://imgur.com/a/fzR1qQl
Initially, when it was not integrated with coinpayments, I used POST method to get the award ID from the form when someone clicks BUY button through awards page which actually was working fine. I could get the proper id using this code.
//awards page
<input type="hidden" name="award" value="{$award['aid']}">
//success page
$award_id = $POST['award'];
Now that it is integrated with CoinPayments, it's not going to the success.php directly so POST method isn't working. If I'm not wrong, I can get the award id in the success.php via cookies (or sessions maybe?). But, I'm failing to store award ID in a cookie.
As we know, it's now like this:
-awards page -> coinpayments site -> success page.
To get award ID from awards page to success page, I tried the following code to store award ID into the cookie:
(guided by this topic: https://community.mybb.com/thread-115261.html)
//in awards page
my_setcookie("award",$award['aid']);
//in the form
<input type="hidden" name="award" value="{$award['aid']}">
//ALSO TRIED
<input type="hidden" name="{$mybb->cookies['award']}" value="{$award['aid']}">
....processing with coinpayments....
//in success (callback) page
$award_id = $mybb->cookies['award'];
echo $award_id; //pm + email actually.
my_unsetcookie("award");
in success page, $award_id Always returns "5". Maybe because there are 5 awards listed?
Other than this, the whole process is very smooth and working as intended. What I want to do is to store proper award ID in the cookie.
I'd appreciate if one could help me with this. And if there's any alternate to achieve this, I'd like to know about it as well.
And also, I really need to get it done by today..
If you need more information, please let me know.
Thank you.
Well, seeing no response from anybody. I would like to know if one requires any additional information or Am I missing something?
Just to add in my previous reply: Newpoints Awards System uses NewPoints and OUGC Awards to extend them. Basically, I'm trying to get award ID (aid) of OUGC awards from awards page to the success page. Which I need help with storing award ID in a cookie..
Waiting for response! Thank you.