Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I'm impressed...

I'm impressed...

Scheduled Pinned Locked Moved The Lounge
csharpjavascriptlinqcomsysadmin
15 Posts 10 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sander RosselS Sander Rossel

    I'm working on a website for a client and at some point a visitor is going to have to pay. I've never done this before, so I was kind of saving this for last. Then the customer said they wanted to use Mollie, a payment platform. So I just took a look at it, created an account, and within an hour I created a test payment. They even have a test token so I don't have to transfer real money and instead I can pick my payment method and select the status I want returned (failed, pending, done, etc.) so I can test all scenario's. Here's something I never thought I'd say, but their documentation is actually pretty useful and they return meaningful error messages. Switching to real payments should be as easy as changing the token. I'm in no way affiliated with Mollie and as a consumer I hate these kind of platforms because they usually make me pay to pay, but this has been the easiest third-party integration I've ever had. Of course I've only used it for an hour and they haven't suddenly changed their entire API without notice yet, but so far I'm genuinely impressed :thumbsup:

    Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

    R Offline
    R Offline
    Ron Anders
    wrote on last edited by
    #3

    Some days ya just wanna live forever.

    1 Reply Last reply
    0
    • Sander RosselS Sander Rossel

      I'm working on a website for a client and at some point a visitor is going to have to pay. I've never done this before, so I was kind of saving this for last. Then the customer said they wanted to use Mollie, a payment platform. So I just took a look at it, created an account, and within an hour I created a test payment. They even have a test token so I don't have to transfer real money and instead I can pick my payment method and select the status I want returned (failed, pending, done, etc.) so I can test all scenario's. Here's something I never thought I'd say, but their documentation is actually pretty useful and they return meaningful error messages. Switching to real payments should be as easy as changing the token. I'm in no way affiliated with Mollie and as a consumer I hate these kind of platforms because they usually make me pay to pay, but this has been the easiest third-party integration I've ever had. Of course I've only used it for an hour and they haven't suddenly changed their entire API without notice yet, but so far I'm genuinely impressed :thumbsup:

      Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

      R Offline
      R Offline
      RickZeeland
      wrote on last edited by
      #4

      Mollie is famous, there is even a song about her: The Dubliners Molly Malone - YouTube[^] :rolleyes:

      1 Reply Last reply
      0
      • Sander RosselS Sander Rossel

        I'm working on a website for a client and at some point a visitor is going to have to pay. I've never done this before, so I was kind of saving this for last. Then the customer said they wanted to use Mollie, a payment platform. So I just took a look at it, created an account, and within an hour I created a test payment. They even have a test token so I don't have to transfer real money and instead I can pick my payment method and select the status I want returned (failed, pending, done, etc.) so I can test all scenario's. Here's something I never thought I'd say, but their documentation is actually pretty useful and they return meaningful error messages. Switching to real payments should be as easy as changing the token. I'm in no way affiliated with Mollie and as a consumer I hate these kind of platforms because they usually make me pay to pay, but this has been the easiest third-party integration I've ever had. Of course I've only used it for an hour and they haven't suddenly changed their entire API without notice yet, but so far I'm genuinely impressed :thumbsup:

        Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

        K Offline
        K Offline
        kmoorevs
        wrote on last edited by
        #5

        It's refreshing to see a positive review every now and then!..oh, and Happy Belated Birthday! :laugh: It's also refreshing to work with a new API and 'it just works'...even better when it exceeds your expectations! Good to hear! :)

        "Go forth into the source" - Neal Morse

        Z Sander RosselS 2 Replies Last reply
        0
        • K kmoorevs

          It's refreshing to see a positive review every now and then!..oh, and Happy Belated Birthday! :laugh: It's also refreshing to work with a new API and 'it just works'...even better when it exceeds your expectations! Good to hear! :)

          "Go forth into the source" - Neal Morse

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #6

          kmoorevs wrote:

          Happy Belated Birthday

          What a coincidence. It's my belated birthday today too.

          Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

          1 Reply Last reply
          0
          • Sander RosselS Sander Rossel

            I'm working on a website for a client and at some point a visitor is going to have to pay. I've never done this before, so I was kind of saving this for last. Then the customer said they wanted to use Mollie, a payment platform. So I just took a look at it, created an account, and within an hour I created a test payment. They even have a test token so I don't have to transfer real money and instead I can pick my payment method and select the status I want returned (failed, pending, done, etc.) so I can test all scenario's. Here's something I never thought I'd say, but their documentation is actually pretty useful and they return meaningful error messages. Switching to real payments should be as easy as changing the token. I'm in no way affiliated with Mollie and as a consumer I hate these kind of platforms because they usually make me pay to pay, but this has been the easiest third-party integration I've ever had. Of course I've only used it for an hour and they haven't suddenly changed their entire API without notice yet, but so far I'm genuinely impressed :thumbsup:

            Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

            F Offline
            F Offline
            Forogar
            wrote on last edited by
            #7

            Well, I am annoyed that they named their service after my dog! :mad: ...and they misspelled it as well! :doh:

            - I would love to change the world, but they won’t give me the source code.

            Sander RosselS 1 Reply Last reply
            0
            • R R Giskard Reventlov

              Cool - thanks - been looking for a simple way to take payments for a web site. Any gotchas at all?

              Keep your friends close. Keep Kill your enemies closer. The End

              Sander RosselS Offline
              Sander RosselS Offline
              Sander Rossel
              wrote on last edited by
              #8

              This is what I found, nothing serious, but it'll get you started. Before you start, make sure you actually set at least one payment method in your profile or you'll get an exception from the web API "no payment methods found" (which is fairly descriptive, except when you're completely new). Also, when you create a payment you get a response with some URL's, one of those is the URL that your users should visit to complete their payment, but you're responsible for redirecting the user (which makes sense, because their web API can't do it for you). The docs don't mention this very explicitly. And you get updates on your payments through an optional webhook. I haven't tried it yet, but I do want to implement it, but the problem is that your localhost can't accept HTTP requests from Mollie, so you'll need to run this code on a server that can. I plan on creating a simple Azure Function that updates my dev database, so I can make a request on my localhost, get an update on Azure, but still see the change on localhost. The docs do mention this problem with webhooks. Here's my very first try-out code for Mollie, almost worked on the first try. Without the webhook for updates.

              public async Task Pay()
              {
              using (var client = new HttpClient())
              {
              var id = Guid.NewGuid().ToString();
              var request = new
              {
              amount = new
              {
              currency = "EUR",
              value = "1.00"
              },
              description = "Test payment",
              redirectUrl = $"https://localhost:[port]/OrderCompleted?id={id}",
              metadata = new
              {
              id
              }
              };
              var json = JsonConvert.SerializeObject(request);
              var content = new StringContent(json, Encoding.UTF8, "application/json");
              client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "test_[your code]");
              var response = await client.PostAsync("https://api.mollie.com/v2/payments", content);
              var responseContent = await response.Content.ReadAsStringAsync();
              if (response.IsSuccessStatusCode)
              {
              string url = JsonConvert.DeserializeObject(responseContent)._links.checkout.href;
              return Redirect(url);
              }
              }
              return Ok();
              }

              There's also an third party library, but for me it doesn't get much more difficult than this so I don't need it :)

              Best, Sander

              R 1 Reply Last reply
              0
              • K kmoorevs

                It's refreshing to see a positive review every now and then!..oh, and Happy Belated Birthday! :laugh: It's also refreshing to work with a new API and 'it just works'...even better when it exceeds your expectations! Good to hear! :)

                "Go forth into the source" - Neal Morse

                Sander RosselS Offline
                Sander RosselS Offline
                Sander Rossel
                wrote on last edited by
                #9

                kmoorevs wrote:

                oh, and Happy Belated Birthday

                Thanks :D

                kmoorevs wrote:

                It's also refreshing to work with a new API and 'it just works'

                Until today I thought of this as a fairy tale :laugh:

                Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

                1 Reply Last reply
                0
                • F Forogar

                  Well, I am annoyed that they named their service after my dog! :mad: ...and they misspelled it as well! :doh:

                  - I would love to change the world, but they won’t give me the source code.

                  Sander RosselS Offline
                  Sander RosselS Offline
                  Sander Rossel
                  wrote on last edited by
                  #10

                  Why did you name your dog after a payment service and spelled it wrong? :confused:

                  Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

                  1 Reply Last reply
                  0
                  • Sander RosselS Sander Rossel

                    This is what I found, nothing serious, but it'll get you started. Before you start, make sure you actually set at least one payment method in your profile or you'll get an exception from the web API "no payment methods found" (which is fairly descriptive, except when you're completely new). Also, when you create a payment you get a response with some URL's, one of those is the URL that your users should visit to complete their payment, but you're responsible for redirecting the user (which makes sense, because their web API can't do it for you). The docs don't mention this very explicitly. And you get updates on your payments through an optional webhook. I haven't tried it yet, but I do want to implement it, but the problem is that your localhost can't accept HTTP requests from Mollie, so you'll need to run this code on a server that can. I plan on creating a simple Azure Function that updates my dev database, so I can make a request on my localhost, get an update on Azure, but still see the change on localhost. The docs do mention this problem with webhooks. Here's my very first try-out code for Mollie, almost worked on the first try. Without the webhook for updates.

                    public async Task Pay()
                    {
                    using (var client = new HttpClient())
                    {
                    var id = Guid.NewGuid().ToString();
                    var request = new
                    {
                    amount = new
                    {
                    currency = "EUR",
                    value = "1.00"
                    },
                    description = "Test payment",
                    redirectUrl = $"https://localhost:[port]/OrderCompleted?id={id}",
                    metadata = new
                    {
                    id
                    }
                    };
                    var json = JsonConvert.SerializeObject(request);
                    var content = new StringContent(json, Encoding.UTF8, "application/json");
                    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "test_[your code]");
                    var response = await client.PostAsync("https://api.mollie.com/v2/payments", content);
                    var responseContent = await response.Content.ReadAsStringAsync();
                    if (response.IsSuccessStatusCode)
                    {
                    string url = JsonConvert.DeserializeObject(responseContent)._links.checkout.href;
                    return Redirect(url);
                    }
                    }
                    return Ok();
                    }

                    There's also an third party library, but for me it doesn't get much more difficult than this so I don't need it :)

                    Best, Sander

                    R Offline
                    R Offline
                    R Giskard Reventlov
                    wrote on last edited by
                    #11

                    Super cool! Thanks. :thumbsup:

                    Keep your friends close. Keep Kill your enemies closer. The End

                    1 Reply Last reply
                    0
                    • Sander RosselS Sander Rossel

                      I'm working on a website for a client and at some point a visitor is going to have to pay. I've never done this before, so I was kind of saving this for last. Then the customer said they wanted to use Mollie, a payment platform. So I just took a look at it, created an account, and within an hour I created a test payment. They even have a test token so I don't have to transfer real money and instead I can pick my payment method and select the status I want returned (failed, pending, done, etc.) so I can test all scenario's. Here's something I never thought I'd say, but their documentation is actually pretty useful and they return meaningful error messages. Switching to real payments should be as easy as changing the token. I'm in no way affiliated with Mollie and as a consumer I hate these kind of platforms because they usually make me pay to pay, but this has been the easiest third-party integration I've ever had. Of course I've only used it for an hour and they haven't suddenly changed their entire API without notice yet, but so far I'm genuinely impressed :thumbsup:

                      Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

                      D Offline
                      D Offline
                      dandy72
                      wrote on last edited by
                      #12

                      If it "just works"...holy Mollie?

                      1 Reply Last reply
                      0
                      • Sander RosselS Sander Rossel

                        I'm working on a website for a client and at some point a visitor is going to have to pay. I've never done this before, so I was kind of saving this for last. Then the customer said they wanted to use Mollie, a payment platform. So I just took a look at it, created an account, and within an hour I created a test payment. They even have a test token so I don't have to transfer real money and instead I can pick my payment method and select the status I want returned (failed, pending, done, etc.) so I can test all scenario's. Here's something I never thought I'd say, but their documentation is actually pretty useful and they return meaningful error messages. Switching to real payments should be as easy as changing the token. I'm in no way affiliated with Mollie and as a consumer I hate these kind of platforms because they usually make me pay to pay, but this has been the easiest third-party integration I've ever had. Of course I've only used it for an hour and they haven't suddenly changed their entire API without notice yet, but so far I'm genuinely impressed :thumbsup:

                        Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

                        V Offline
                        V Offline
                        Vincent Maverick Durano
                        wrote on last edited by
                        #13

                        Authorize.Net was very easy to setup too. At least to me ;P

                        Sander RosselS 1 Reply Last reply
                        0
                        • V Vincent Maverick Durano

                          Authorize.Net was very easy to setup too. At least to me ;P

                          Sander RosselS Offline
                          Sander RosselS Offline
                          Sander Rossel
                          wrote on last edited by
                          #14

                          It doesn't have The Netherlands most used payment type, iDeal :)

                          Best, Sander sanderrossel.com Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly

                          1 Reply Last reply
                          0
                          • R R Giskard Reventlov

                            Cool - thanks - been looking for a simple way to take payments for a web site. Any gotchas at all?

                            Keep your friends close. Keep Kill your enemies closer. The End

                            U Offline
                            U Offline
                            User 14066065
                            wrote on last edited by
                            #15

                            wow you can enjoy music while running or swimming through best bone conduction headphones 2019

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups