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

Stripe Checkout

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

    Stripe Checkout

    Hope someone can help.

    I want to capture the email address from Stripe Checkout (using the action Javascript currently).

    I have already been able to capture the token, which is great, but the email alludes me.

    According to Stripe,

    HTML Code:
    When Checkout receives the token from Stripe, it appends two hidden fields to the form: stripeToken and stripeEmail.
    I am assuming stripeToken translates to e.token in the function stripeCheckout_xxx. How can I get e.email to work the same way?

    Thanks,

    #2
    Re: Stripe Checkout

    Originally posted by AdamP View Post
    Hope someone can help.

    I want to capture the email address from Stripe Checkout (using the action Javascript currently).

    I have already been able to capture the token, which is great, but the email alludes me.

    According to Stripe,

    HTML Code:
    When Checkout receives the token from Stripe, it appends two hidden fields to the form: stripeToken and stripeEmail.
    I am assuming stripeToken translates to e.token in the function stripeCheckout_xxx. How can I get e.email to work the same way?

    Thanks,
    https://documentation.alphasoftware....ripe%20payment

    The {dialog.object}.getStripeResults() method (https://documentation.alphasoftware....sults%20method) returns the Stripe's Charges object if the transaction succeeds. Otherwise, it contains the Stripe Errors object.
    Sarah Mitchell
    Director of Customer Success | [URL="https://www.alphasoftware.com"]Alpha Software Corporation[/URL]
    [B]Get in the know! [/B] Join us for our Weekly Webinars: [URL="https://www.alphasoftware.com/weekly-transform-tuesday-webinar"]TransForm Tuesday[/URL] and [URL="https://www.alphasoftware.com/weekly-alpha-anywhere-overview-webinar"]Wednesday's Alpha Anywhere Demo and Q&A[/URL]
    Connect with us: [URL="https://www.instagram.com/alpha_software_corp/"]Instagram[/URL] | [URL="https://twitter.com/AlphaSoftware"]Twitter[/URL] | [URL="https://www.facebook.com/AlphaSoftware/"]Facebook[/URL] | [URL="https://www.linkedin.com/company/alpha-software"]LinkedIn[/URL] | [URL="https://www.youtube.com/user/AlphaSoftwareInc"]YouTube[/URL]

    Comment


      #3
      Re: Stripe Checkout

      Thanks Sarah. Unfortunately:

      Fires after the Stripe Checkout charge has been authorized or denied.
      I am not letting it get that far. I am taking the token and calling the Stripe API myself to generate (in this case) subscriptions. I do not want a charge to occur.

      Code:
      function stripeCheckout_xxx as c(e as p)
      	
      	dim packet as p
      	packet._tokenId = e.token
      -->	packet._email = e.email <-- 'This is what I want
      
      	dim jsonCmd as c
      	jsonCmd = json_generate(packet)
      
      	dim result as c
      	result = jsonCmd
      
      	stripeCheckout_xxx = "{dialog.object}._stripeResults ="+result+";A5.stripe.results="+result+";"
      
      end function

      Comment


        #4
        Re: Stripe Checkout

        In the Action Javascript builder, have a look at the Events section... On Stripe Checkout Complete. The inline help for this is...

        StripeCompleteEvent.PNG

        Using the example code in this event, the email address would be found in...

        Code:
        e.result.source.name

        Comment


          #5
          Re: Stripe Checkout

          Thanks David. I stepped through the function with debug(1) and looked at e.result and it doesn't contain that data.

          Maybe I'm looking in the wrong spot?

          Comment


            #6
            Re: Stripe Checkout

            David, I think I was looking in the wrong place. I was looking at the Xbasic function. How would I intercept the javascript in the button?

            Comment


              #7
              Re: Stripe Checkout

              Hopefully I'm on the right track... I think I have to do something in the Javascript - Attribute and Javascript - Declarations sections of the Edit Click Event?

              I feel much more comfortable in Xbasic than javascript... time to dive in.

              Comment


                #8
                Re: Stripe Checkout

                David, unfortunately I think it comes back to what I said to Sarah... I'm not letting the charge go through as I"m intercepting the Xbasic function (above).

                Here is what Stripe claims is the response:

                Code:
                {
                  "id": "tok_1DS6FkG1UBU2rpsGrTfUBJ6h",
                  "object": "token",
                  "card": {
                    "id": "card_1DS6FkG1UBU2rpsGUKjKvw4o",
                    "object": "card",
                    "address_city": null,
                    "address_country": null,
                    "address_line1": null,
                    "address_line1_check": null,
                    "address_line2": null,
                    "address_state": null,
                    "address_zip": null,
                    "address_zip_check": null,
                    "brand": "MasterCard",
                    "country": "US",
                    "cvc_check": "pass",
                    "dynamic_last4": null,
                    "exp_month": 4,
                    "exp_year": 2044,
                    "funding": "credit",
                    "last4": "4444",
                    "metadata": {
                    },
                    "name": "[email protected]",
                    "tokenization_method": null
                  },
                  "client_ip": "75.67.39.165",
                  "created": 1541178972,
                  "email": "[email protected]",
                  "livemode": false,
                  "type": "card",
                  "used": false
                }
                If I could get access to that, I'd be golden!

                Edit: I do get the "tok_1DS6FkG1UBU2rpsGrTfUBJ6h" from e above, but that is it.
                Last edited by AdamP; 11-02-2018, 05:21 PM. Reason: clarification

                Comment


                  #9
                  Re: Stripe Checkout

                  You said you were using the Action Javascript Stripe Checkout. If that's the case then there is no XBasic for you to debug through... unless you've converted the Action into code... and there's really no reason to do that. Follow the Action Javascript inline help in the Stripe Checkout dialog.

                  Comment


                    #10
                    Re: Stripe Checkout

                    I did turn it into code, and there is a reason for me to do that... I don't want to create a Stripe charge.

                    Here is the Xbasic when you turn it into code:

                    Code:
                    function stripeCheckout_xxx as c(e as p)
                    DIM p as P
                    DIM p.appType as C = "Test"
                    DIM p.testSecretKey as C = "sk_test_Zsx007TIfg18fbkkvW4ksEQq"
                    DIM p.liveSecretKey as C = "x"
                    
                    
                    dim n as Helper::V8
                    dim p2 as p
                    p2._id = api_uuidcreate()
                    p2._command = "stripeChargesCreate"
                    p2._tokenId = e.token
                    
                    dim skey as c
                    if p.appType = "Test" then
                    skey = p.testSecretKey
                    else
                    skey = p.liveSecretKey
                    end if
                    p2._key = skey
                    p2._amount = e._state.charge.amount
                    p2._description = e._state.charge.description
                    p2._currency = e._state.charge.currency
                    
                    dim jsonCmd as c
                    jsonCmd = json_generate(p2)
                    
                    dim result as c
                    result = n.NodeRequest(jsonCmd)
                    stripeCheckout_xxx = "{dialog.object}._stripeResults ="+result+";A5.stripe.results="+result+";"
                    
                    end function
                    It is calling the node.js to create the Stripe charge. I am bypassing that with the Xbasic posted earlier in the thread. My issue is that I want to capture the e.token which is provided but also an email address which should be provided, but it isn't and it is hidden somewhere that I can't figure out how to get.

                    Comment


                      #11
                      Re: Stripe Checkout

                      Not really sure what you're trying to do... but...

                      If you add this after getting the result...

                      Code:
                      dim resultVar as p
                      resultVar = json_parse(result)
                      Then you'll find the email address in...

                      Code:
                      resultVar.result.source.name
                      However, this is AFTER the charge.

                      It kind of sounds like you want to get the email address entered in Stripe Checkout BEFORE calling nodeJS.

                      You mentioned you're trying to create a Subscription. This is not the way to do that because you're making a nodeJS request for a Charge.

                      You can't use Stripe Checkout to create a Subscription.

                      You've not detailed the Alpha build/version you're using... but you may be better off using the Stripe Genie... which utilizes a Stripe .NET implementation. There are a few issues with that, but it may be a better solution for you.
                      Last edited by Davidk; 11-02-2018, 06:06 PM.

                      Comment


                        #12
                        Re: Stripe Checkout

                        Thanks for your help David. Unfortunately that doesn't work since I don't call the node.js that returns the result from creating a charge.

                        I suspect there is a process that is happening in the background somewhere.

                        1. User fills out the Stripe checkout UI and the data is sent to Stripe.
                        2. Stripe returns a token.
                        3. This token is passed to the node.js to create the charge.
                        4. Another result is sent back from Stripe.

                        I take the token from step 2 and use it myself. According to Stripe, it should be returning stripeToken and stripeEmail, but for some reason Alpha is only returning stripeToken at this point.

                        Comment


                          #13
                          Re: Stripe Checkout

                          If you're working with Subscriptions you don't want to use Stripe Checkout.

                          Comment


                            #14
                            Re: Stripe Checkout

                            Well, Stripe Checkout got me a starting point. That is why I've intercepted the call before the node.js. At this point it looks like I need to build my own checkout UI using Stripe Elements, but I didn't want to go down that route w/o seeing if I could get access to this email address which according to Stripe is being returned with the token.

                            Comment


                              #15
                              Re: Stripe Checkout

                              Originally posted by Davidk View Post
                              However, this is AFTER the charge.

                              It kind of sounds like you want to get the email address entered in Stripe Checkout BEFORE calling nodeJS.

                              You mentioned you're trying to create a Subscription. This is not the way to do that because you're making a nodeJS request for a Charge.

                              You can't use Stripe Checkout to create a Subscription.

                              You've not detailed the Alpha build/version you're using... but you may be better off using the Stripe Genie... which utilizes a Stripe .NET implementation. There are a few issues with that, but it may be a better solution for you.
                              LOL, you are the one who told me the .NET implementation wasn't good and I should use cUrl to Xbasic, which I am using... and it works. But this is all after... I need a piece of data that is supposed to be supplied with the token and Alpha is not supplying it.

                              Comment

                              Working...
                              X