Static Api - PeakeCoin - Open Source

in Ecency22 hours ago (edited)

https://github.com/PaulMoon410/peakecoin_api/blob/main/paypal_api_config.js

I've been working non-stop... Was trying to figure out some of this backend stuff. If anyone is hip on PayPal payments, lets chit-chat.
paypal_api_config.js

// Static PayPal API config template for PeakeCoin payout integrations.

const paypalApiConfig = {
  updated_at: "2026-03-30T00:00:00Z",
  provider: "paypal",
  recommended: true,
  mode: "sandbox",
  base_urls: {
    sandbox: "https://api-m.sandbox.paypal.com",
    live: "https://api-m.paypal.com"
  },
  oauth: {
    token_path: "/v1/oauth2/token"
  },
  payouts: {
    create_path: "/v1/payments/payouts",
    get_path: "/v1/payments/payouts/{payout_batch_id}"
  },
  credential_fields: [
    { name: "PAYPAL_CLIENT_ID", required: true, source: "environment" },
    { name: "PAYPAL_CLIENT_SECRET", required: true, source: "environment" },
    { name: "PAYPAL_MODE", required: false, source: "environment", default: "sandbox" }
  ],
  recipient_fields: ["recipient_type", "receiver", "amount", "currency", "note", "sender_item_id"]
};

function getPaypalBaseUrl(mode = paypalApiConfig.mode) {
  return mode === 'live' ? paypalApiConfig.base_urls.live : paypalApiConfig.base_urls.sandbox;
}

function getPaypalTokenUrl(mode) {
  return getPaypalBaseUrl(mode) + paypalApiConfig.oauth.token_path;
}

function getPaypalPayoutCreateUrl(mode) {
  return getPaypalBaseUrl(mode) + paypalApiConfig.payouts.create_path;
}

function buildPaypalPayoutItem(payload = {}) {
  return {
    recipient_type: payload.recipient_type || 'EMAIL',
    amount: {
      value: String(payload.amount ?? '0.00'),
      currency: payload.currency || 'USD'
    },
    receiver: payload.receiver || '',
    note: payload.note || 'PeakeCoin payout',
    sender_item_id: payload.sender_item_id || `pek-${Date.now()}`
  };
}

if (typeof module !== 'undefined') {
  module.exports = {
    paypalApiConfig,
    getPaypalBaseUrl,
    getPaypalTokenUrl,
    getPaypalPayoutCreateUrl,
    buildPaypalPayoutItem
  };
}

if (typeof window !== 'undefined') {
  window.paypalApiConfig = paypalApiConfig;
  window.getPaypalBaseUrl = getPaypalBaseUrl;
  window.getPaypalTokenUrl = getPaypalTokenUrl;
  window.getPaypalPayoutCreateUrl = getPaypalPayoutCreateUrl;
  window.buildPaypalPayoutItem = buildPaypalPayoutItem;
}



🪙 PeakeCoin Ecosystem

💱 PeakeCoin USDT Bridge (Hive ↔ Polygon/MATIC)
Bridge SWAP.USDT from Hive Engine to USDT on Polygon (MATIC).
Whitelist access, documentation, and bridge status updates:
👉 https://geocities.ws/peakecoin


⚙️ HiveP.I.M.P. — PeakeCoin Intelligent Market Protector
Operated by @hivepimp, P.I.M.P. focuses on stabilizing PEK markets and strengthening liquidity on Hive Engine.
Community participation supports long-term ecosystem health.


🤖 PeakeBot — Autonomous Trading System
Independent multi-token trading bot with RC-awareness, adaptive delay logic, and smart cycle control.
📊 Trading bot documentation:
👉 https://geocities.ws/p/e/peakecoin/trading-bot/peakebot_v0_01.html
💻 Open-source repositories:
👉 https://github.com/paulmoon410


🎰 PeakeSino — The PeakeCoin Casino (Beta)
Blockchain-powered games using PEK as the native in-game currency.
Built on Hive with a focus on provable fairness and community-driven growth.
🃏 Play the beta games here:
👉 https://geocities.ws/peakecoin/pek_casino/beta_games/index.html


🙏 Acknowledgements

Thanks to and please follow:
@enginewitty @ecoinstant @neoxian @txracer @thecrazygm @holdonia @aggroed

For their continued support, guidance, and help expanding the PeakeCoin ecosystem.