Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

node.js integration questions (for Stripe Integration)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • node.js integration questions (for Stripe Integration)

    Hi,

    I have been thinking about linking my application to Stripe - the online payment system. I have done some initial research and I think it could be pretty easy but need some advice on putting the pieces together...
    Stripe has a node.js version, so this might be the perfect way to take advantage of the new Xbasic/node.js integration.

    I have watched the videos on the node.js Xbasic integration in the release notes, but I can't figure out how you publish these node.js files to the WAS? In the videos they are added to the actual AA development client. Or am I missing something?

    Any ideas?

    Thanks

    Scott

  • #2
    Re: node.js integration questions (for Stripe Integration)

    http://downloads.alphasoftware.com/a...easeNotes.html

    Found this:
    Xbasic - Node.JS - Extending Server-side Functionality using Node.js - Node.js is a popular program for writing server side utilities in Javascript. Alpha Anywhere now has tight integration with Node and you can now define your own Node modules that can be called from Xbasic.
    Watch Video - Part 1
    Watch Video - Part 2
    Watch Video - Part 3
    To create a new 'Node Service' that can be called from Xbaisc, you create a new .js file in the Node_Services folder in the Alpha Anywhere executable folder. The syntax for this .js file is the syntax you would use for any Node module.
    To call a Node service from Xbasic, you:
    dim an instances of the helper::V8 object
    construct a JSON string that defines the Node service you want to call and the parameters you wan to pass to the Node service
    call the .NodeRequest() method of the helper::V8 object instance

    In the following example, we have defined a trivial Node service that takes as its input two variables, 'firstname' and 'lastname' and sends back a string showing: Hello firstname lastname.
    The Node service in this example is called 'hello'. Therefore the '_command' property of the JSON command object is set to 'hello'
    You must also set an '_id' property in the JSON command object. This can be any value. Using a UUID for this value is convenient.
    The Node service is called using the .NodeRequest() method and the result is returned as a JSON string with properties for the error text (if there was an error) and 'result' - the result of the request. The JSON response can be parsed to get Xbasic varibles, or the json_extract() function can be used to extract the 'result' property.
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    Comment


    • #3
      Re: node.js integration questions (for Stripe Integration)

      So looking through my folders in my a5v12 I can't find the node_services or node_modules folders. From the videos in the release notes it made it sound like these were installed with alpha anywhere (I just updated to the most recent public release two days ago) but wasn't sure if I actually needed to go download node onto my server and then it will be automatically put into the right folder? Any help greatly appreciated (also I guess it is possible that node.js is only a part of pre-release software).

      Comment


      • #4
        Re: node.js integration questions (for Stripe Integration)

        Originally posted by lilmofo812 View Post
        So looking through my folders in my a5v12 I can't find the node_services or node_modules folders. From the videos in the release notes it made it sound like these were installed with alpha anywhere (I just updated to the most recent public release two days ago) but wasn't sure if I actually needed to go download node onto my server and then it will be automatically put into the right folder? Any help greatly appreciated (also I guess it is possible that node.js is only a part of pre-release software).
        It's available in Development and WAS root folder of your application, just checked

        Comment


        • #5
          Re: node.js integration questions (for Stripe Integration)

          A word about stripe: OUTSTANDING

          I have several authorize.net accounts/paypal,square, etc. and I can say that stripe out performs them and I will be cancelling ALL of my authorize.net accounts as it is time for the leeches to beat it.

          Here is a real world example of WHY i feel this way today.

          I went to the secretary of state website and registered my business name (required for bank account) after I had my fed tax ID of course.
          Once I got my bank account setup I said great NOW i can go to authorize.net setup a merchant account add my bank account and then I can integrate this into my SAAS application I created with Alpha.

          So I fill out the application for the new account ( I actually have two others as well) and I must say I forgot what a royally painful experience it is with all of the "security questions" and paperwork you have to go through during account creation. Then I wait - well you will need a merchant processor assigned to you for processing and your going to need to process a certain amount of $ monthly or face fees, etc.
          So I wait...two days later I get an email that says congrats I have been accepted and assigned to some merchant services company in iowa and I can process soon!

          Ok lets go back to about an hour after I completed my registration at authorize.net.
          I thought, hmmm that stripe thing looks interesting. Let me revisit that.
          20 minutes later my account was setup - complete, and I setup a recurring subscription for 2 of my SAAS memberships - ran the cards and was told it would take up to five days (I think that was it...) for my very first transaction to clear then after that just 2

          So lets move to 5 days later. As expected the charges were processed with the fees deducted (minimal) and guess what there was ALSO a charge from authorize.net for 79 dollar setup fee!

          I created the account at my bank with just 100
          so lets recap

          Authorize.net 1-5 days cannot process a single transaction but they can take setup fees from me.
          Stripe: no setup fee, running cards immediately.
          The bottom line is I added my bank account info and ran cards and got paid before my authorize.net account was active and all I got from them was an automatic draft of 79 bucks - I cancelled my account needless to say (that took 3 days as well btw)

          another thing of note is I started digging around in my bank account for my other business - the merchant fees because I do less than a certain amount of credit card transactions are costing me hundreds of dollars a MONTH as well as the percentages of the transactions and other misc fees.

          so in short Stripe is cost effective for me and I would love to hear other peoples experiences in contrast if they exist.
          Oh one other cool thing of note is that I just got an email that informed me that "Emailme" forms (3rd party) now accepts stripe too for payments in their forms...

          Thanks Alpha - your helping me stay cost effective as well.
          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

          Comment


          • #6
            Re: node.js integration questions (for Stripe Integration)

            Yeah that's my bad, didn't think to look in the program files folder first (just went to a shortcut folder I have on the C: drive labeled a5v12).

            My next question would be if anyone has been able to successfully set a node service that will create a Stripe customer and subscribe them to a plan after using the new checkout action javascript? I can successfully receive the response JSON object (which from what I can tell contains the necessary token to do the customer creation and subscription sign up) but I'm not sure how to go about passing this information into the node service. I would assume I would have to take the JSON and pass it into some variable that I could then get to when calling the xbasic function that contains the node call, just not sure if I can easily pass the JSON along as an object or if I have to do something special to make sure it isn't messed up. This looks like some great functionality and I look forward to Alpha building out more integration with stripe!

            Comment


            • #7
              Re: node.js integration questions (for Stripe Integration)

              Anyone noticing the stripe action javascript no longer working? I'm trying to figure out if this is just something I am seeing or everyone is seeing. Tried deleting the action I had created and rebuilding it to no avail. Everything is working except I am no longer receiving the results from the action and in test mode I'm not even seeing the test charges in my stripe dashboard....its very peculiar! My one fear is that our recent switch to https may be causing the results to not return correctly but I don't even know where I would look to update this change either in alpha or stripe!

              Comment


              • #8
                Re: node.js integration questions (for Stripe Integration)

                I would suggest that YES your switch to https has affected things...https is a different url than http. I cannot however help you solve your problem. When you DO find the solution, please post back- THANKS!
                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                Comment


                • #9
                  Re: node.js integration questions (for Stripe Integration)

                  I was trying to get the example hello.js from the forementioned videos working in the interactive window. I created the file and put a copy of it in a5V12ApplicationServer/node_services folder, and a copy in the a5V12/node_services folder. Is there anything else I need to do?
                  ?n.NodeRequest(jsoncmd) is returning empty. Thinking it can't find the file?
                  dim n as helper::V8

                  dim p as p
                  p._d = api_uuidcreate()
                  p._command = "hello"
                  p.firstname = "Fred"
                  p.lastname = "Jones"

                  dim jsoncmd as c
                  jsoncmd = json_generate(p)
                  ?jsoncmd
                  = {
                  "_d": "575dd111-7220-4032-8c6c-88c244f8a503",
                  "_command": "hello",
                  "firstname": "Fred",
                  "lastname": "Jones"
                  }
                  ERROR: Expected value
                  ?n.NodeRequest(jsoncmd)
                  = ""

                  Comment


                  • #10
                    Re: node.js integration questions (for Stripe Integration)

                    Replace _d with _id.
                    Last edited by kkfin; 02-24-2016, 11:45 PM.

                    Comment


                    • #11
                      Re: node.js integration questions (for Stripe Integration)

                      Thank You Ken that was it.

                      So as far as using a node_service on my server I would just copy the script file to the WAS a5V12ApplicationServer/node_services then it can be loaded from a xbasics script?

                      It would be helpful if the videos showed the creation and placement of the hello.js file, where it needs to exist in a development environment and on a remote server, and why.

                      It also would be helpful if it was demonstrated being used in a web component.

                      A walk through of using the node server directly in relationship to a web project as discussed in this blog post would also be helpful: http://www.alphasoftware.com/blog/al...lpha-anywhere/

                      Thanks,
                      Bob
                      Last edited by bob9145; 02-25-2016, 10:53 AM.

                      Comment


                      • #12
                        Re: node.js integration questions (for Stripe Integration)

                        There is two ways to publish/place files. One is in install folder( your example) and other is in subfolders in root. The later use node_request() function. Both share same logic how to place files. Obviously when files are in root you may have to protect them from direct use. So be carefully with your data.

                        Comment

                        Working...
                        X