1

Cart / Payment Gateway Integrations

Тема: Cart / Payment Gateway Integrations

I find it odd there aren't any existing "Shopping Cart" or Payment gateway integrations.  I suppose it's the custom nature of Wialon, but it doesn't make things easy smile

Is the normal route people take of all custom integration for customer sign-up, billing (recurring billing) and payment gateway? 

I'm going through the SDK API and JS API and it seems overly complicated to perform some basics of "create account", "adjust billing of units".  I'm coming in from the outside of this whole process so it's very likely I'm looking at things in the wrong way.

Anyone have some advice on direction to take with this?  OR is it just better to not automate account creation, unit count, billing plans (unit restrictions), billing and still perform those tasks manually?

2

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

It would seem there's nothing out there so it's all custom done?

Ok. 

I take it zero replies because everyone views everyone else as a competitor?

3

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech, only automation is the way to go. There are some integrations, but most of the time it is competitive feature of this or that TSP. That's why they prefer not to share it.

At the dark side of telematics...
4

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

shal пишет:

simplextech, only automation is the way to go. There are some integrations, but most of the time it is competitive feature of this or that TSP. That's why they prefer not to share it.

I can understand the competitive nature of things.  I'm just looking for some starter info or even a simple sample would be nice for setting up a new user/account.  I've looked through the current SDK and it's very dis-jointed and difficult to follow.  Especially with the comments all inline with the code in the small sandbox area.  I'm not a web dev but I will learn.  I do more of the back end dev and by trade a Unix Engineer but I'll learn the dev as needed. 

Funny, I'm not even in the Fleet tracking arena... not even close.

5

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech, what is you final goal? You want to automate billing or connect Wialon account management to some ERP?

At the dark side of telematics...
6

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech, basically to create an account you need login and create session. To login you need token. Please ask token for the user that either is top-level account or has dealer rights, so that you may play with it correctly.

Having active session you may operate using its sid, listen for updates, etc and you may manage some items.

To manage accounts you need to create user, using it's ID create resource and then upgrade it into account.

To block/unblock or perform payments over accounts please look here.

At the dark side of telematics...
7

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

shal пишет:

simplextech, basically to create an account you need login and create session. To login you need token. Please ask token for the user that either is top-level account or has dealer rights, so that you may play with it correctly.

Having active session you may operate using its sid, listen for updates, etc and you may manage some items.

To manage accounts you need to create user, using it's ID create resource and then upgrade it into account.

To block/unblock or perform payments over accounts please look here.

End Goal:  Have billing system (Stripe, Paypal, etc) accept the payment and call the necessary script via Webhook to create the new account, or increase unit count for the user, delete user, etc.  Common normal add/modify/delete of "accounts".  These are slightly different as in Wialon there are "Accounts" and then "Users".  So my customers are individual so they all need "Accounts" as they are separate customers.

I was messing with the php class last night for integration and I worked through it.  I hit a problem with the "dataFlags" portion and that's not well defined in the documentation of what value is expected or of what the possible values are.  I found the Data Format:Users and tried various combinations and I got either Error 6 (unknown) or 4 for bad parameters.  All from just trying to create a user.

I would think the most basic fundamental aspect of Wialon is for partners to get paid by their customers.  The integration of a generic billing platform of the sample interactions of creating the user, create account with existent user, change billing plan, change common user parameters and finally a delete account operation would be on the primary list of SDK Samples and HOWTO information.

8

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

Very basic.  I get an Error 6 - Unknown error.  I'm reading through the documentation and the issue is with the dataFlags it seems.  I've tried several variants and nothing is working.

Anyone have any more information about the quirks of the API or should I not be trying to use the PHP and use something else?

 echo $wialon_api->core_create_user('{
                        "creatorId":18125092,
                        "name":"sdk_test",
                        "password":"sdk_test_123",
                        "dataFlags":1}');
9

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

Partial success!

I'm going to ramble and document as I go.

  • Got a new token
  • Create User
  • Create Resource
  • Create Account

This was done in 3 separate PHP files, calls.  Now I need to combine this into one.  The documentation on the dataFlags is really not clear.  I understand the Hex and Dec and combining.  The information/details about what each really means is not clear.  Is this for setting the user/resource/account permissions?  I'm trying to tie this back to what I have seen from the CMS interface and how they relate.  Documenting this a little more I think would be very helpful to new people.  It would be nice if there was a guide for basic rights of General User/Account, Admin, Reports, etc.  Now i'm coming from a back end systems perspective of users, and roles and trying to get my own brain around this style of accounts and privileges.

Now to try and "Update" the account to setup the user e-mail, timezone, metrics/US measurements and default City.

10

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech, congrats on partial success. The best way to check what to do is to use cms.wialon.com and see actual requests and their paramers in browser console.
API docs a little bit outdated and other libraries even much more outdated. The best source of information so far is this forum and people here.

At the dark side of telematics...
11

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

In Wialon you should operate with accounts only. No users, no resources - all limitations and billing are done over accounts.

At the dark side of telematics...
12

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

shal пишет:

To manage accounts you need to create user, using it's ID create resource and then upgrade it into account.

Per your other post:
To manage accounts you need to create user, using it's ID create resource and then upgrade it into account.

This is where the use of "User" for the terminology is misleading and confusing.  Especially for me coming from other systems where a user is a user.  But from the way the system is structured from CMS it's a 3 step process.  Please correct me if I have misread any of this.

1. create user
2. create resource from user id of step 1
3. create account from resource id of step 2 and assign billing plan

The user in step 1 is the "Master User" that the "Account" is comprised of.  Essentially the Login Name for the Account.  Is this not correct?  I don't know of any other way to "Create an Account".

13

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech, your steps are correct. You may have different "user" and "resource/account" names, but usually it is easier to have same name for both. With this method you can preliminary check is user & avl_resource names are unique before creation so that potentially you won't have any errors.

At the dark side of telematics...
14

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

btw, PayPal payments are not 100% covered by WebHooks. In October we had one payment for which PayPal didn't generated the WebHook at all according to WebHook Logs. It means that either you will need some manual activation of your script or still need to run periodic synchronization to be 100% sure. Just for your information.

At the dark side of telematics...
15

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

shal пишет:

btw, PayPal payments are not 100% covered by WebHooks. In October we had one payment for which PayPal didn't generated the WebHook at all according to WebHook Logs. It means that either you will need some manual activation of your script or still need to run periodic synchronization to be 100% sure. Just for your information.

Thanks for the tip.  I'll keep that in mind as I'm still looking at payment gateways.  I have it narrowed down and PayPal is at the bottom of my list currently.

I'm following the advice I had read before about keeping the user/resource name the same to make things easier.  Thanks for the link to checking if they are unique.

16

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

Are there any issues in Wialon using a "email address" format for the user/resource/account name?  So far it seems to work fine and login and everything is working.  I want to make sure there's no hidden problems I'm not aware of.

17

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech пишет:

Are there any issues in Wialon using a "email address" format for the user/resource/account name?  So far it seems to work fine and login and everything is working.  I want to make sure there's no hidden problems I'm not aware of.

Should be OK as far as it is unique.

At the dark side of telematics...
18

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

What would be the best approach of managing unit number restrictions?  I see that there looks to be a way to change/edit the billing plan to change the service unit value.  Is that the recommended approach for increase/decrease of the the unit limit?

https://sdk.wialon.com/wiki/en/sidebar/ … ng_service

19

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech, yes it is.

At the dark side of telematics...
20

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

So far things have come along very well.

Integration using Stripe for Billing aka Subscriptions.  I've now integrated with Pabbly for a very easy customer portal and in-between integration with Stripe.

-- Account Create / Delete
-- Service Upgrade / Downgrade

I'm using billing plans at set unit counts to make it easy to change unit plans and automate the process.  Other increments can be done through a support channel.  Almost ready to go live with this and now I've hit a problem.

I've been running on a Wialon trial and things were fine and so we bit the bullet and are now paid customers.  I'm trying to move the integrations from the "test" environment to the new "prod" environment and this should be a simple change of the Token and the CreatorId that is used.  However the exact same code is no longer working in the new environment but it still works perfect in the "trial" environment.  The ONLY difference is the access token and the "CreatorId" used. 

I've sent an email to support.  Waiting on a response.  I think my account my be "broke" in some way as it took several days and escalations to HQ before I could even access my account.  So things were rough from the start.

Any ideas thoughts on other differences I may be over looking?  A permission difference or something?

21

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

simplextech пишет:

Any ideas thoughts on other differences I may be over looking?  A permission difference or something?

Not too much information, hope support will assist you (if not already). Basically your token should be generated from user that is account creator and this account should have dedicated billing option activated. Also token should have correct rights. And in that case you may operate with users that are located below this account in creators hierarchy. Wialon can create not parent-chaild relationships with flexible ACLs, but this won't work for the account billing management.

At the dark side of telematics...
22

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

shal пишет:
simplextech пишет:

Any ideas thoughts on other differences I may be over looking?  A permission difference or something?

Not too much information, hope support will assist you (if not already). Basically your token should be generated from user that is account creator and this account should have dedicated billing option activated. Also token should have correct rights. And in that case you may operate with users that are located below this account in creators hierarchy. Wialon can create not parent-chaild relationships with flexible ACLs, but this won't work for the account billing management.

Well.  The several replies from "Support" were "We don't support the API" and to use the forum. 

So I started over.  Deleted the access from within the CMS for applications with access and created a new token again and started testing and now it's working.  So either I missed something the first three times last night or something changed somewhere.  I don't know.  But as of right now it is working and I can move forward.  I did document this as well and I'll test the steps again with another user to verify them again. 

There is a error code 6 that according to the documentation states "Unknown".  That is NOT helpful and something needs to be done about that.

23

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

New problem.  Not entirely sure if this is in the user or resource area. 

The user or resource flags.  Currently when a user is created they are not getting the permissions to "create units" or mobile access.  This is part of the user flags I believe.

So what flags can I set to grant the user ALL permissions as they will be the "Account Owner" and be able to create anything within their account.

24

Cart / Payment Gateway Integrations

Re: Cart / Payment Gateway Integrations

So I figured out the flags issue.  So it's actually more steps to creating an account than initially thought.

1. Create User
2. Set User Settings corectly as the defaults are bad
3. Create Resource
4. Create Account from Resource ID and Billing Plan