Post by Redmayne » Sat Oct 17, 2015 11:47 pm

Hi all, newbie here.

I have a mobile app that allows users to collect "gift points" which will contribute to their first/next purchase. Is it possible to import the users "gift points" and allocate/credit them to their account, by matching it to their email address?

The app exports the data (email and number of points) in JSON, correctly.

If anyone can point me in the right direction, I will be most thankful!

Cheers

Newbie

Posts

Joined
Sat Oct 17, 2015 11:39 pm

Post by openmandrake » Mon Oct 19, 2015 2:45 am

Hmm, basically you need to add the reward points correctly into the oc_customer_reward table. E.g. from inside the admin, there is the possibility to add them manually.

The question is rather, what do you understand as import? If it is a one time import or a continuous import. The best approach would be to create a controller with some authentication logic, whatever you have inside your app. And inside the controller add the data to the respective reward table. Finding the customer via email is a database query as well :)

I hope this helped, otherwise be more specific with your question...

Checkout our extensions, or our open source projects


New member

Posts

Joined
Wed Oct 31, 2012 3:05 am

Post by Redmayne » Mon Oct 19, 2015 2:57 am

It's a start, thank you!

It will be a continuous stream, so to speak. It will need to work at the customers will - with a press of a button (in-app), the tokens are in their account on the web-store.

I hope this is more specific.

Newbie

Posts

Joined
Sat Oct 17, 2015 11:39 pm

Post by openmandrake » Mon Oct 19, 2015 5:57 am

If I understand you correctly, inside your app customers can earn points, which later can be used to buy items on the opencart shop?

Basically, I would it solve within a controller action. So your app sends a http post request with the user identifier (email) and amount of points to the action. Inside the action you retrieve the customer via the email and then add the amount of points to his account. This would require around 20 - 40 lines of code i estimate.

However, the more problematic thing is how you prove that the user really earned the points inside the app. Because anybody could call the controller action and add himself points. You would need a cryptographic sound approach to do this prove. Have you thought about that already? It wouldn't matter what approach you use to import the points, you always would need this prove, to be sure that nobody cheated on you.

Checkout our extensions, or our open source projects


New member

Posts

Joined
Wed Oct 31, 2012 3:05 am

Post by Redmayne » Mon Oct 19, 2015 11:15 pm

Indeed, I'll have a dedicated part of the store for the gifts.

20 lines isn't too bad, but if it's the latter, I think it would be best I find someone with a lot more experience - I sound naive, but is it endorsed on the forum to look for someone that can aide/perform such a thing? Or even better, is there a group of go-to-guys that offer custom work?

The app side is now covered (thanks for the advice!). I have 3 keys which consist of 30 characters - each week, they will be replaced/updated.

Thanks again! You've been a tremendous help.

Newbie

Posts

Joined
Sat Oct 17, 2015 11:39 pm

Post by openmandrake » Tue Oct 20, 2015 3:54 am

I could always help or implement the feature for you. I run my own company, just write me a PN and I give you my contact details and we could clearify details. Otherwise I guess you can find somebody on the partners page.

Checkout our extensions, or our open source projects


New member

Posts

Joined
Wed Oct 31, 2012 3:05 am
Who is online

Users browsing this forum: No registered users and 29 guests