Skip to content

redradist/BlazorGooglePay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me A Coffee

BlazorGooglePay

This library is wrapper around GooglePay Js library that provides BlazorGooglePayButton razor component as well as direct access to GooglePay API and embedding GooglePayButton in custom Blazor component

To use this package you have to update your index.html like in the following example:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>Awesome BlazorGooglePay Application</title>
    <base href="/" />
    <link href="css/normalize.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="css/app.css" rel="stylesheet" />
</head>

<body>
    <app>Loading...</app>

    <div id="blazor-error-ui">
        An unhandled error has occurred.
        <a href="" class="reload">Reload</a>
        <a class="dismiss">🗙</a>
    </div>
    <script src="_framework/blazor.webassembly.js" autostart='false'></script>
    <script src="https://cdn.jsdelivr.net/gh/redradist/Blazor.Dependecies/src/blazor.dependencies.js"></script>
    <script>
        window.blazorDepsPromise.then(() => {
            Blazor.start();
        });
    </script>
</body>

</html>

The most important part in this html is that:

    ...
    <script src="_framework/blazor.webassembly.js" autostart='false'></script>
    <script src="https://cdn.jsdelivr.net/gh/redradist/Blazor.Dependecies/src/blazor.dependencies.js"></script>
    <script>
        window.blazorDepsPromise.then(() => {
            Blazor.start();
        });
    </script>
    ...

Also you have to add in wwwroot directory the following file blazorDeps.json:

[
  {
    "type": "Razor Class Library",
    "name": "BlazorGooglePay"
  },
]

All this changes done BlazorDependecies Blazor static files manager