{"_id":"@cowboysandwitches/paypal-utils","name":"@cowboysandwitches/paypal-utils","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@cowboysandwitches/paypal-utils","version":"0.1.0","description":"An unofficial PayPal utils package helping to integrate PayPal Checkout more easily - with good types and JSDoc annotations.","repository":{"type":"git","url":"git+https://github.com/cowboysandwitches/paypal-utils.git"},"license":"GPLv3","bugs":{"url":"https://github.com/cowboysandwitches/paypal-utils/issues"},"main":"./script/mod.js","module":"./esm/mod.js","exports":{".":{"import":"./esm/mod.js","require":"./script/mod.js"}},"scripts":{"test":"node test_runner.js"},"devDependencies":{"@types/node":"^20.9.0","picocolors":"^1.0.0","@deno/shim-deno":"~0.18.0"},"types":"./script/mod.d.ts","gitHead":"8e72268a830a55308005c612290f9939e61cc542","homepage":"https://github.com/cowboysandwitches/paypal-utils#readme","_id":"@cowboysandwitches/paypal-utils@0.1.0","_nodeVersion":"18.14.0","_npmVersion":"9.3.1","dist":{"integrity":"sha512-WxChGRfGn7tKRAmEWcvSyYDXkYhJW1MTb38wm0cRsRaSqyWVKshbr2DyoiE21R6HFsxMuf7JruukWB0p0LH9fg==","shasum":"30fd6419df14872e1eb57f48ad76ce00472bdc70","tarball":"https://registry.npmjs.org/@cowboysandwitches/paypal-utils/-/paypal-utils-0.1.0.tgz","fileCount":103,"unpackedSize":110961,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3vX3sPTK1DwUy8GssTT4efbv5OrANIubGRG3+jNORZAiEAljVu29AsCjIhgDpxgrVsjo6cjLDEA3MiHfnMcKcxFPM="}]},"_npmUser":{"name":"l2ig","email":"l@l5d.li"},"directories":{},"maintainers":[{"name":"l2ig","email":"l@l5d.li"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/paypal-utils_0.1.0_1718053392558_0.06618187680233123"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-10T21:03:12.408Z","0.1.0":"2024-06-10T21:03:12.724Z","modified":"2024-06-10T21:03:13.101Z"},"maintainers":[{"name":"l2ig","email":"l@l5d.li"}],"description":"An unofficial PayPal utils package helping to integrate PayPal Checkout more easily - with good types and JSDoc annotations.","homepage":"https://github.com/cowboysandwitches/paypal-utils#readme","repository":{"type":"git","url":"git+https://github.com/cowboysandwitches/paypal-utils.git"},"bugs":{"url":"https://github.com/cowboysandwitches/paypal-utils/issues"},"license":"GPLv3","readme":"# @cowboysandwitches/paypal-utils\n\nAn unofficial PayPal utils package helping to integrate PayPal Checkout more easily - with good types and JSDoc annotations.\n\n## Usage\n\n### Creating an `ServerUtils` instance\n\n```typescript\nconst serverUtils = new ServerUtils({\n  isSandbox: true,\n  credentials: {\n    clientId: \"blibla...\",\n    clientSecret: \"blub...\",\n  },\n});\n```\n\n### Creating an order\n\n```typescript\nconst serverUtils = new ServerUtils(...);\n\nconst order = serverUtils.createOrder({\n  intent: ServerUtilsCreateOrderOptionsIntent.Capture,\n  purchaseUnits: [\n    {\n      amount: {\n        currencyCode: \"EUR\",\n        value: \"1\",\n      },\n    },\n  ],\n});\nassert(order.ok);\nconsole.debug(`Created order ${order.data.id}`);\n```\n\n### Capturing the payment for an order\n\n```typescript\nconst serverUtils = new ServerUtils(...);\n\nconst capturedOrder = await serverUtils.capturePaymentForOrder({\n  orderId: \"...\",\n});\nassert(capturedOrder.ok);\nconsole.debug(`Captured order ${capturedOrder.id}.`);\n```\n","readmeFilename":"README.md"}