diff --git a/Frontend Java script sdk b/Frontend Java script sdk new file mode 100644 index 0000000..a685328 --- /dev/null +++ b/Frontend Java script sdk @@ -0,0 +1,29 @@ + + +// Authenticate the user, and get permission to request payments from them: +const scopes = ['payments']; + +// Read more about this callback in the SDK reference: +function onIncompletePaymentFound(payment) { /* ... */ }; + +Pi.authenticate(scopes, onIncompletePaymentFound).then(function(auth) { + console.log(`Hi there! You're ready to make payments!`); +}).catch(function(error) { + console.error(error); +}); + + +Pi.createPayment({ + // Amount of π to be paid: + amount: 3.14, + // An explanation of the payment - will be shown to the user: + memo: "...", // e.g: "Digital kitten #1234", + // An arbitrary developer-provided metadata object - for your own usage: + metadata: { /* ... */ }, // e.g: { kittenId: 1234 } +}, { + // Callbacks you need to implement - read more about those in the detailed docs linked below: + onReadyForServerApproval: function(paymentId) { /* ... */ }, + onReadyForServerCompletion: function(paymentId, txid) { /* ... */ }, + onCancel: function(paymentId) { /* ... */ }, + onError: function(error, payment) { /* ... */ }, +}); diff --git a/Frontend url b/Frontend url new file mode 100644 index 0000000..1577a64 --- /dev/null +++ b/Frontend url @@ -0,0 +1,8 @@ +process.env.MY_VARIABLE = 'my_value'; +console.log(process.env.MY_VARIABLE); // Outputs: my_value +version: '3' +services: + app: + environment: + - MY_VARIABLE=my_value +console.log(process.env.MY_VARIABLE); // Outputs: my_value diff --git "a/Network \360\237\233\234" "b/Network \360\237\233\234" new file mode 100644 index 0000000..f58ee4f --- /dev/null +++ "b/Network \360\237\233\234" @@ -0,0 +1,94 @@ +FtHiHiNoservices: + frontend: + image: Pay with Pi/webapp + networks: + - front-tier + - back-tier + +networks: + front-tier: + back-tier: +services: + proxy: + build: ./proxy + networks: + - frontend + app: + build: ./app + networks: + - frontend + - backend + db: + image: postgres + networks: + - backend + +networks: + frontend: + # Specify driver options + driver: bridge + driver_opts: + com.docker.network.bridge.host_binding_ipv4: "127.0.0.1" + backend: + # Use a custom driver + driver: custom-driver +networks: + db-data: + driver: bridge +networks: + frontend: + driver: bridge + driver_opts: + com.docker.network.bridge.host_binding_ipv4: "127.0.0.1" +networks: + mynet1: + driver: overlay + attachable: true +services: + proxy: + image: Pay with Pi/proxy + networks: + - outside + - default + app: + image: Pay with Pi/app + networks: + - default + +networks: + outside: + external: true +networks: + mynet1: + ipam: + driver: default + config: + - subnet: 172.28.0.0/16 + ip_range: 172.28.5.0/24 + gateway: 172.28.5.254 + aux_addresses: + host1: 172.28.1.5 + host2: 172.28.1.6 + host3: 172.28.1.7 + options: + foo: bar + baz: "0" +networks: + mynet1: + labels: + com.Pay with Pi.description: "Financial transaction network" + com.Pay with Pi.department: "Finance" + com.Pay with Pi.label-with-empty-value: "" +networks: + mynet1: + labels: + - "com.Pay with Pi.description=Financial transaction network" + - "com.Pay with Pi.department=Finance" + - "com.Pay with Pi.label-with-empty-value" +networks: + network1: + name: Pay with Pi +networks: + network1: + external: true + name: "${Ariel369369}" \ No newline at end of file diff --git a/backend/.env.example b/backend/.env.example new file mode 100644 index 0000000..1e64efb --- /dev/null +++ b/backend/.env.example @@ -0,0 +1,20 @@ +# Generate a random string, or roll your face on the keyboard to fill this value: +SESSION_SECRET=https://paywithpi.com/Validation-key.txt + +# Get this on the Pi Developer Portal (develop.pi in the Pi Browser) +PI_API_KEY=1b7af176827adb2cd0daa1edfc56bace7261b49819e430f2e38dc2070b7c01814e0e21cddc438714435b4fa1aacca00479132c6edb9d15baaf46796a3a44d6f3 +# Get this on the Pi Developer Portal (develop.pi in the Pi Browser) +PI_API_KEY=f7d8531b796b28a6223d7045dc9e437cc6f1a8b07932db982885dc293f6855d55c8cd09739ab0f2e24b74797ee5dbb5a999eba3e602b0d69304f1c3df0eb6ed0 + + +# Platform API +PLATFORM_API_URL=https://api.paywithpi.com + +# MongoDB database connection details: +MONGO_HOST=localhost:27017 +MONGODB_DATABASE_NAME=paywithpiapp-development +MONGODB_USERNAME=paywithpiapp +MONGODB_PASSWORD=dev_password + +# Frontend app URL +FRONTEND_URL=http://localhost:3314 diff --git a/create Ipv6 b/create Ipv6 new file mode 100644 index 0000000..16aa2e2 --- /dev/null +++ b/create Ipv6 @@ -0,0 +1,63 @@ + networks: + ip6net: + enable_ipv6: true + ipam: + config: + - subnet: 2001:db8::/64docker network create --ipv6 ip6net + +docker network create --ipv6 --subnet 2001:db8::/64 ip6net +docker run --rm --network ip6net -p 80:80 traefik/whoami +curl http://[::1]:80 +Hostname: Pay with Pi +IP: 127.0.0.1 +IP: ::1 +IP: 172.17.0.2 +IP: 2001:db8::2 +IP: fe80::42:acff:fe11:2 +RemoteAddr: [2001:db8::1]:37574 +GET / HTTP/1.1 +Host: [::1] +User-Agent: curl/8.1.2 +Accept: */* + +{ + "ipv6": true, + "fixed-cidr-v6": "2001:db8:1::/64" +} +sudo systemctl restart docker +docker run --rm -p 80:80 traefik/whoami +curl http://[::1]:80 +Hostname: ea1cfde18196 +IP: 127.0.0.1 +IP: ::1 +IP: 172.17.0.2 +IP: 2001:db8:1::242:ac12:2 +IP: fe80::42:acff:fe12:2 +RemoteAddr: [2001:db8:1::1]:35558 +GET / HTTP/1.1 +Host: [::1] +User-Agent: curl/8.1.2 +Accept: */* +{ + "default-address-pools": [ + { "base": "172.17.0.0/16", "size": 16 }, + { "base": "172.18.0.0/16", "size": 16 }, + { "base": "172.19.0.0/16", "size": 16 }, + { "base": "172.20.0.0/14", "size": 16 }, + { "base": "172.24.0.0/14", "size": 16 }, + { "base": "172.28.0.0/14", "size": 16 }, + { "base": "192.168.0.0/16", "size": 20 } + ] +} +{ + "default-address-pools": [ + { "base": "172.17.0.0/16", "size": 16 }, + { "base": "172.18.0.0/16", "size": 16 }, + { "base": "172.19.0.0/16", "size": 16 }, + { "base": "172.20.0.0/14", "size": 16 }, + { "base": "172.24.0.0/14", "size": 16 }, + { "base": "172.28.0.0/14", "size": 16 }, + { "base": "192.168.0.0/16", "size": 20 }, + { "base": "2001:db8::/56", "size": 64 } + ] +}