Skip to content

darkensk/fsharp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GirShop

Checkout 3.0 and PayFrame integration in F# + Giraffe

For testing Checkout 3 add following variables to your environment variables:

  • apiPublicUrl - URL where the server is running

  • swedenClientId - ClientID for shop authentication in Swedish Market

  • swedenClientSecret - ClientSecret for shop authentication Swedish Market

  • checkoutBackendApiUrl - Checkout 3.0 Backend API url

  • checkoutFrontendBundleUrl - Checkout 3.0 Frontend JS bundle url

  • paymentWidgetBundleUrl - Payment Widget bundle url (optional)

  • partnerShippingBundleUrl - Partner Shipping bundle url (optional)

For testing PayFrame add following variables to your environment variables:

  • payFrameBundleUrl - NEW PayFrame Frontend JS bundle url

  • payFrameSiteKey - NEW The siteKey parameter is a required unique identifier provided by Avarda

  • payFrameLanguage - NEW ISO 639-1 language code (optional) - default en

Alternatively you can pass siteKey, and language as query parameters on the pay-frame page like this: https://localhost:5000/pay-frame?siteKey=cc2898b0-362c-445a-b777-80408e74b9a8&language=sv

Available markets:

In order to test different markets set up following clientId/clientSecret values based on market. Market will be available in the /settings/ page when credentials are set up.

Sweden:
    "swedenClientId"
    "swedenClientSecret"
Finland:
    "finlandClientId"
    "finlandClientSecret"
Norway:
    "norwayClientId"
    "norwayClientSecret"
Denmark:
    "denmarkClientId"
    "denmarkClientSecret"
Slovakia:
    "slovakiaClientId"
    "slovakiaClientSecret"
Czechia:
    "czechiaClientId"
    "czechiaClientSecret"
Poland:
    "polandClientId"
    "polandClientSecret"
Latvia:
    "latviaClientId"
    "latviaClientSecret"
Estonia:
    "estoniaClientId"
    "estoniaClientSecret"
Germany:
    "germanyClientId"
    "germanyClientSecret"
Austria:
    "austriaClientId"
    "austriaClientSecret"
International*:
    "internationalClientId"
    "internationalClientSecret"

* - International market requires extra setup by Avarda, please contact Avarda representative or support.


Please refer to articles Getting started and Embed Checkout for more info.

One way of adding the env variables is adding a "launchSettings.json" src/Gir/Properties/launchSettings.json:

{
  "profiles": {
    "Gir": {
      "commandName": "Project",
      "environmentVariables": {
        "apiPublicUrl": "https://localhost:5001",
        "swedenClientId": "<clientId>",
        "swedenClientSecret": "<clientSecret>",
        "checkoutBackendApiUrl": "<checkoutApiUrl>",
        "checkoutFrontendBundleUrl": "<checkoutBundleUrl>",
        "paymentWidgetBundleUrl": "<paymentWidgetUrl>",
        "payFrameBundleUrl": "<payFrameBundleUrl>",
        "payFrameSiteKey": "<siteKey>",
        "payFrameLanguage": "<language>"
      }
    }
  }
}

Run following commands:

dotnet tool restore

dotnet paket install

dotnet fake build

Open http://localhost:5000 or https://localhost:5001

Documentation:

Checkout 3

Avarda Checkout 3 documentation

PayFrame

PayFrame documentation

Payment Widget

Payment Widget documentation

Partner Shipping Module

Partner Shipping Module documentation

About

Sample F# integration of Avarda Checkout 3 and other Avarda products

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages