firebot6 Reply #1, 9 months, 2 weeks ago
Currently running MODX Revolution 2.1.3-pl (traditional).
I'm just about done with this project I've been working on. The last piece is a button (or, three buttons I guess) that correspond to the different subscription options available. When an already logged in user clicks on a button to pick their subscription type, I want it to redirect them to PayPal where they make the payment. Once the payment is cleared (or however it works), I want PayPal to communicate with Modx and put that user into the paid user group (there is only one, regardless of subscription type), while still keeping the user in all of their other groups.
I've found bits and pieces of how to put this all together. I have the PayPal IPN PHP example (https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt ), and I found this eForm example for how to add things to the Modx database (http://wiki.modxcms.com/index.php/Use_eForm_to_Store_data_into_Database ).
I'm having trouble figuring out how to get the current logged in user's id, and along with the id for the paid user group and the other numbers required for a table entry, pass it to the database using a button click (as opposed to a form). Also, in the user_group table, there are the columns for id, user group, member, role, rank. I know what each of those numbers does besides the one in the id column. It's not the member id, and it's not the user group id. So I don't know what value I should pass along for that either.
Finally, I have even less of an idea how to get all of this to communicate with the PayPal IPN script so it only gets changed once a payment is cleared.
I don't want someone to do all the work for me, but I wouldn't be against a good tutorial or a solid example. Even just a nudge in the right direction, since I've never worked with any of this before.
I'm just about done with this project I've been working on. The last piece is a button (or, three buttons I guess) that correspond to the different subscription options available. When an already logged in user clicks on a button to pick their subscription type, I want it to redirect them to PayPal where they make the payment. Once the payment is cleared (or however it works), I want PayPal to communicate with Modx and put that user into the paid user group (there is only one, regardless of subscription type), while still keeping the user in all of their other groups.
I've found bits and pieces of how to put this all together. I have the PayPal IPN PHP example (https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt ), and I found this eForm example for how to add things to the Modx database (http://wiki.modxcms.com/index.php/Use_eForm_to_Store_data_into_Database ).
I'm having trouble figuring out how to get the current logged in user's id, and along with the id for the paid user group and the other numbers required for a table entry, pass it to the database using a button click (as opposed to a form). Also, in the user_group table, there are the columns for id, user group, member, role, rank. I know what each of those numbers does besides the one in the id column. It's not the member id, and it's not the user group id. So I don't know what value I should pass along for that either.
Finally, I have even less of an idea how to get all of this to communicate with the PayPal IPN script so it only gets changed once a payment is cleared.
I don't want someone to do all the work for me, but I wouldn't be against a good tutorial or a solid example. Even just a nudge in the right direction, since I've never worked with any of this before.