Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create .env.example #452

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Juma-creator
Copy link

@Juma-creator Juma-creator commented Oct 1, 2024

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=Pay with Piapp-development
MONGODB_USERNAME=Pay with Piapp
MONGODB_PASSWORD=dev_password

Frontend app URL

FRONTEND_URL=http://localhost:3314

# 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.minepi.com

# MongoDB database connection details:
MONGO_HOST=localhost:27017
MONGODB_DATABASE_NAME=Pay with Piapp-development
MONGODB_USERNAME=Pay with Piapp
MONGODB_PASSWORD=dev_password

# Frontend app URL
FRONTEND_URL=http://localhost:3314
# 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
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
<script src="https://sdk.minepi.com/pi-sdk.js"></script>
<script>Pi.init({ version: "2.0" })</script>
// 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) { /* ... */ },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant