diff --git a/README.md b/README.md index 396c603..6092d39 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ # Google Pay Web Checkout Playground + + + + + Use this playground environment to experiment integrating Google Pay, as if you were working directly from your own checkout page.
diff --git a/dev.nix b/dev.nix new file mode 100644 index 0000000..2c912ca --- /dev/null +++ b/dev.nix @@ -0,0 +1,50 @@ +/* + Copyright 2024 Google LLC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +# To learn more about how to use Nix to configure your environment +# see: https://developers.google.com/idx/guides/customize-idx-env +{ pkgs, ... }: { + # Which nixpkgs channel to use. + channel = "stable-24.05"; # or "unstable" + + # Use https://search.nixos.org/packages to find packages + packages = [ + pkgs.python311 + ]; + + # Sets environment variables in the workspace + env = {}; + idx = { + workspace = { + onCreate = { + default.openFiles = [ + "index.html" + "index.js" + ]; + }; + }; + + previews = { + enable = true; + previews = { + web = { + command = ["python3" "-m" "http.server" "$PORT" "--bind" "0.0.0.0"]; + manager = "web"; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/idx-template.json b/idx-template.json new file mode 100644 index 0000000..a31c4e4 --- /dev/null +++ b/idx-template.json @@ -0,0 +1,8 @@ +{ + "name": "Google Pay Web Checkout Playground", + "description": "Use this playground environment to experiment integrating Google Pay, as if you were working directly from your own checkout page.", + "categories": ["Web app", "Misc"], + "icon": "https://www.gstatic.com/images/branding/productlogos/google_pay_round/v6/192px.svg", + "publisher": "Google Pay DevRel", + "website": "https://pay-web-quickstart.web.app" + } \ No newline at end of file diff --git a/idx-template.nix b/idx-template.nix new file mode 100644 index 0000000..fe53a3a --- /dev/null +++ b/idx-template.nix @@ -0,0 +1,25 @@ +/* + Copyright 2025 Google LLC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +{ pkgs, ... }: { + bootstrap = '' + mkdir "$out" + mkdir -p "$out/.idx/" + cp -rf ${./dev.nix} "$out/.idx/dev.nix" + shopt -s dotglob; cp -r ${./public}/* "$out" + chmod -R +w "$out" + ''; +} \ No newline at end of file