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

function Xbasic module

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

    function Xbasic module

    Trying to turn this code created by the curl genie into a function that can be called from the browser like this video explains https://www.youtube.com/watch?v=BOUrEhYfZBk&t=186s
    not sure how you would code?
    Function plan as c ()
    Plan = ?
    end Function

    exports.create_plan = plan
    dim cf_1 as extension::CurlFile
    dim flag_1 as l
    dim ce as extension::Curl

    ce = extension::Curl.Init()
    ce.setOpt("URL","https://api.stripe.com/v1/plans")
    ce.setOpt("NOPROGRESS",1)
    ce.setOpt("USERPWD","sk_test_9L3BgxHETEMrKjLa85yT2kzE:")
    dim posted_fields as c = ("amount=7500&interval=month&product[name]=Iorp&currency=usd&id=Iorp")
    ce.setOpt("POSTFIELDS",posted_fields)
    ce.setOpt("POSTFIELDSIZE_LARGE", len(posted_fields) )
    ce.setOpt("USERAGENT","curl/7.34.0")
    ce.setOpt("MAXREDIRS",50)
    ce.setOpt("CAINFO",a5.Get_Exe_Path()+"\caroot\ca-cert.pem")
    ce.setOpt("CAPATH",a5.Get_Exe_Path()+"\caroot")
    'ce.setOpt("SSH_KNOWNHOSTS","C:\Users\Robert Senski\AppData\Roaming/_ssh/known_hosts")
    ce.setOpt("TCP_KEEPALIVE",1)
    ce.SetOpt("FILE",cf_1)
    flag_1 = ce.Exec()
    ce.setOpt("URL",<<%txt%
    \
    %txt%)
    if flag_1 then

    dim headers as c
    dim contents as c
    headers = cf_1.GetHeaders()
    contents = cf_1.GetContent()

    'BE SURE TO COMMENT OUT THIS CODE IN A WEB APPLICATION AS showVar() CANNOT BE USED IN WEB APPLICATIONS
    dim msg as c
    msg = "Headers: " + crlf() + headers + crlf() + "Content: " + contents
    showvar(msg)


    else
    dim errors as c
    errors = ce.error()

    'BE SURE TO COMMENT OUT THIS CODE IN A WEB APPLICATION AS showVar() CANNOT BE USED IN WEB APPLICATIONS
    showvar("error: " + errors)
    end if
    ce.close()

    #2
    Re: function xbasics module

    In simply terms your function needs to have all of this code but instead of using Showvar(msg) simply have the Plan = msg and Plan = errors. Or better still

    DIM Output as P
    Output.result = ""
    Output.error = .F.

    then if error occurs set Output.error = .T. and if there is a result make output.result = msg. Then just return your function with Output.

    Function plan as p () < make it return p rather then C
    <Code generated with changes to Showvar lines as described above>
    Plan = Output
    end Function
    Alex Collier

    "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

    AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

    Comment


      #3
      Re: function Xbasic module

      Thanks Alex,
      Will give it a whirl!

      Comment


        #4
        Re: function Xbasic module

        Hey Bob,
        I had noticed this was around the stripe api. what are you trying to do out of interest?. If you intended to make this code reusable you might want to look into using a xbasic class or Node API instead.
        Alex Collier

        "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

        AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

        Comment


          #5
          Re: function Xbasic module

          Yes trying to master Stripe with AA. The curl genie in xbasics worked well in raw form. I went 15 rounds with node and lost. Haven't looked at xbasic class yet.
          I need a pretty complicated payment scheme to monetize my app. I thought I could build a series of xbasic curl modules that would break down the various API calls I need to implement.
          I could then combine them as needed. They would serve as templates. This would also break down what can be complicated stripe transactions allowing me to get my head around Stripe advanced.
          I need to utilize everything from basic charges to custom transactions.

          Comment


            #6
            Re: function Xbasic module

            On a side note when I inputed the curl into the genie it outputted 6 flags and repeated the request 6 times. Bug? running 4684

            Comment


              #7
              Re: function Xbasic module

              I wish someone would create some full-blown Stripe builder like AS did but one that actually has everything in it from charges to refunds, subscriptions, etc including sub-accounts would be worth every penny. I would do it but my brain misfires at that level.
              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


                #8
                Re: function Xbasic module

                curl https://api.stripe.com/v1/plans \
                -u sk_test_some_test_key: \
                -d amount=5000 \
                -d interval=month \
                -d product[name]="Gold staff" \
                -d currency=usd \
                -d id=gold-staff

                Comment


                  #9
                  Re: function Xbasic module

                  It's a great API. Developers that can monetize Apps buys AA products. I suggested it a decade ago, but don't think Stripe was on the radar then, it was paypals emerging adaptive payments.

                  Comment


                    #10
                    Re: function Xbasic module

                    Originally posted by CharlesParker View Post
                    I wish someone would create some full-blown Stripe builder like AS did but one that actually has everything in it from charges to refunds, subscriptions, etc including sub-accounts would be worth every penny. I would do it but my brain misfires at that level.
                    I would do this but i am not doing it alone. We need to bind together to take it upon ourselves to start a Stripe API project so we can all benefit.
                    Last edited by alexc; 03-02-2018, 01:24 AM. Reason: spelling
                    Alex Collier

                    "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                    AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                    Comment


                      #11
                      Re: function Xbasic module

                      Originally posted by bob9145 View Post
                      Yes trying to master Stripe with AA. The curl genie in xbasics worked well in raw form. I went 15 rounds with node and lost. Haven't looked at xbasic class yet.
                      I need a pretty complicated payment scheme to monetize my app. I thought I could build a series of xbasic curl modules that would break down the various API calls I need to implement.
                      I could then combine them as needed. They would serve as templates. This would also break down what can be complicated stripe transactions allowing me to get my head around Stripe advanced.
                      I need to utilize everything from basic charges to custom transactions.
                      15 Rounds lol yes node js is like that i would not give up. did you not just deconstruct the one alpha has started for you in their platform using Node.
                      Alex Collier

                      "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                      AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                      Comment


                        #12
                        Re: function Xbasic module

                        Bob, does the node js lib from stripe do all the functions you need if this would be working for you.


                        https://stripe.com/docs/api/node
                        Alex Collier

                        "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                        AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                        Comment


                          #13
                          Re: function Xbasic module

                          I've been asking Alpha to finish the Stripe implementation for years... no one is interested in finishing what was started. Stripe is a really good payment solution for web and mobile. Too bad it's another job half done. I feel a lot of Alpha features like Stripe are just Marketing checkboxes.

                          Node.JS and Stripe do work well together... but... Alpha implemented two levels of Node calls. Some Stripe calls work with 1 level and not the other. When I tried to explain this to Alpha I got shut down... no one was interested.

                          Comment


                            #14
                            Re: function Xbasic module

                            Here is the way I see Stripe integration:
                            A function or functiions for each call that excepts the necessary user/app inputs and listens for and receives responses from the Stripe API
                            A UX form for each type of transaction with the required fields with a function that calls the template functions and submits the required data as needed for the call.
                            The UX then processes the response and converts the response into variables and makes them available to the UX to save, or present to user as needed ect.....
                            A set of sample tables for the back end to organize the various transactions.
                            Similar to some of the UX security templates. All the AA parts are there whether it is in node js , or curl via xbasics from what I can see. It just has to be assembled.
                            Last edited by bob9145; 03-02-2018, 01:45 AM.

                            Comment


                              #15
                              Re: function Xbasic module

                              Originally posted by Davidk View Post
                              I've been asking Alpha to finish the Stripe implementation for years... no one is interested in finishing what was started. Stripe is a really good payment solution for web and mobile. Too bad it's another job half done. I feel a lot of Alpha features like Stripe are just Marketing checkboxes.

                              Node.JS and Stripe do work well together... but... Alpha implemented two levels of Node calls. Some Stripe calls work with 1 level and not the other. When I tried to explain this to Alpha I got shut down... no one was interested.
                              Yes you are probably right there David. I am interested in knowing more of your discoveries. any chance you can explain / maybe be quicker via video. Otherwise i would be up for a Webinar session with a bunch of us to discuss what we can do. I think a full integration into stripe would be welcomed.
                              Alex Collier

                              "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                              AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                              Comment

                              Working...
                              X