{"_id":"@acmeticketing/payments","name":"@acmeticketing/payments","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@acmeticketing/payments","version":"1.0.0","type":"commonjs","types":"./index.d.ts","gitHead":"2f38fccd524718ddc449ed9233b972932cb6efea","description":"The ACME Payments Card Present JavaScript SDK easily enables secure, PCI Compliant transactions into your checkout flows. Enable online, in-store, and omnichannel transactions in any customer present context in a few lines of code within your Webapp or PO","_id":"@acmeticketing/payments@1.0.0","_nodeVersion":"16.14.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-3DJCtroB4al1EN37w8SF048Uaul2/6KI2/l6mJj3xjn6qyhFDSHbw9rfs/E26exKBi6WibuQs3/J4/9/me2mQg==","shasum":"3e38658fcb5cf92b5321866841c9a1d03febb700","tarball":"https://registry.npmjs.org/@acmeticketing/payments/-/payments-1.0.0.tgz","fileCount":19,"unpackedSize":60344,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4ayu9pRL8kjqWYQHC0vAXn/H2TeJnYkVvigpJCOsUMAiBztIqChQ6O+foDxWmPDMPbBZ/hf96RpvePaqQGAaqsuA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN0w2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqi9A/+Lw6+m/8raU4ACY9eppP/6KQmmmwWU/tH4qFxFw5ZHQ8VCqES\r\n3W7wGA9Ahmp9hW6VngO3nE/vABVzAoxVXi4tPe6PM8chst5Xs2s3L0bKXfA3\r\nCzmuHjvbiGTteGv3qfIc37RnHOJibFscn/PRcDQ9zRlEurith69DIR9wrtO1\r\neb8xl9a9qL5eXDhk/zcX+CZyCkxie6rKxhjvvJ230qotoxHw+6IqOGUviED7\r\nzpcfpGwQ/fQLNFCZUWs2BGqZGSAkfe/HS8N1mzsLDXeYBJCGoADdyGRXbxRm\r\n4c6KRDH4cp77S7UcwCHWEBk6zIUp6GrlIsF0h7+ot1lTjdFHF5tSBtFl7Cab\r\n1atfebXGtJ4jJW3t+gZbKbqXj/MTt0/I6XS+Ua/VT/WCpVor41MIB19QljAc\r\nMW2xo3kZamWDNbVfE/ZP9FyvryNzUUxL303guJcqRxqBbK/kEF9DWA+FuCm0\r\n0XITvTE4RSF7DjEs2Rm6+KorKQO4dWDY2m0AIYc5JEYNYi05d8ES4c2Pv7vb\r\noQphc0nwK5tKNj4K3PT1DdKgkFiChmh+KZVWGDsGNjneMtF7E2YNsrgbrfo0\r\nBQ5MMPS3hexfkX77JGSB+F+s760bZZmT1+Em5iXFNgPT/u3Fu/Yo8pWdx1Ub\r\nKGx0+CqfwYzGcOHAblIA4TU7k8ub8yqDO9E=\r\n=E3ha\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aldo_acmeticketing","email":"aldo@acmeticketing.com"},"directories":{},"maintainers":[{"name":"abraham_hinojo","email":"abraham@acmeticketing.com"},{"name":"aldo_acmeticketing","email":"aldo@acmeticketing.com"},{"name":"pascal-acme","email":"pascal@acmeticketing.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payments_1.0.0_1681345589962_0.14104578197040296"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-13T00:26:29.884Z","1.0.0":"2023-04-13T00:26:30.141Z","modified":"2023-04-13T00:26:30.419Z"},"maintainers":[{"name":"abraham_hinojo","email":"abraham@acmeticketing.com"},{"name":"aldo_acmeticketing","email":"aldo@acmeticketing.com"},{"name":"pascal-acme","email":"pascal@acmeticketing.com"}],"description":"The ACME Payments Card Present JavaScript SDK easily enables secure, PCI Compliant transactions into your checkout flows. Enable online, in-store, and omnichannel transactions in any customer present context in a few lines of code within your Webapp or PO","readme":"# ACME Payments JavaScript SDK\n\nThe ACME Payments Card Present JavaScript SDK easily enables secure, PCI Compliant transactions into your checkout flows. Enable online, in-store, and omnichannel transactions in any customer present context in a few lines of code within your Webapp or POS today.\n\nACME Seller account required for API key access — get started today at sales@acmepayments.com.\n\n## Installation\n\n> NOTE: If you're migrating some of your merchants over from our previous library `@acmeticketing/payment-sdk` you should review our [migration steps](#migrating-from-previous-version).\n\n### ES Module\n\n- Intended for use with modern bundlers like webpack.\n- This is the recommended approach and will provide the best developer experience.\n\n```\nnpm install @acmeticketing/payments\n```\n\n### UMD\n\nUMD builds can be used directly in the browser via a `<script>` tag.\nManually add the `index.umd.js` script tag to the `<head>` of your site.\n\n```html\n<!-- Somewhere in your site's <head> -->\n<script src=\"https://unpkg.com/@acmeticketing/payments@1.0.0/index.umd.js\" async></script>\n```\n\n## Usage (ES Module)\n\n> All of the examples also apply to the UMD version but instead of importing our library as an ES Module it will be available under the global `ACME` object.\n\n```js\nconst acmePayments = window.ACME.ACMEPayments.create({\n  mid: 'your_mid', // Use your provided merchant identification number (MID)\n  publishableKey: 'your_publishable_key', // Use your provided publishable\n});\n```\n\n### Activate a terminal\n\n```ts\nimport { ACMEPayments } from '@acmeticketing/payments';\n\nconst acmePayments = ACMEPayments.create({\n  mid: 'your_mid',\n  publishableKey: 'your_publishable_key',\n});\n\ntry {\n  const response = await acmePayments.activateTerminal({\n    activationCode: 'activation_code_from_terminal',\n    description: 'description_of_the_terminal',\n    terminalId: 'unique_id_for_this_terminal',\n  });\n} catch (error) {\n  // handle error\n}\n```\n\n### Make a sale\n\n> This example assumes you have already gone through the terminal activation process.\n\nThe process goes like this:\n\n1. Choose one of your terminal IDs\n\n   You can look for it by retrieving a list of your terminals if you don't know the exact terminal ID.\n\n1. Authorize the payment amount with the terminal you picked\n1. Use the generated `transactionId` to capture the payment\n\n```ts\nimport { ACMEPayments } from '@acmeticketing/payments';\n\nconst acmePayments = ACMEPayments.create({\n  mid: 'your_mid',\n  publishableKey: 'your_publishable_key',\n});\n\nasync function capturePayment(terminalId: string, amount: string, externalId?: string) {\n  try {\n    const paymentAuthorizationResponse = await acmePayments.authorizePayment({\n      terminalId,\n      amount,\n    });\n\n    return acmePayments.capturePayment({\n      transactionId: paymentAuthorizationResponse.transactionId,\n      externalId,\n    });\n  } catch (error) {\n    // handle error\n  }\n}\n```\n\n### Find a terminal by serial number\n\n```ts\nimport { ACMEPayments } from '@acmeticketing/payments';\n\nconst acmePayments = ACMEPayments.create({\n  mid: 'your_mid',\n  publishableKey: 'your_publishable_key',\n});\n\nasync function findTerminalBySerialNumber(serialNumber: string) {\n  const response = await acmePayments.fetchTerminals();\n  const terminal = response.list.find((terminal) => terminal.serialNumber === serialNumber);\n\n  if (terminal == null) {\n    throw new Error(`Could not find terminal with serial number: ${serialNumber}`);\n  }\n\n  return terminal;\n}\n```\n\n### Delete a terminal\n\n> This example assumes you have already gone through the terminal activation process.\n\n```ts\nimport { ACMEPayments } from '@acmeticketing/payments';\n\nconst acmePayments = ACMEPayments.create({\n  mid: 'your_mid',\n  publishableKey: 'your_publishable_key',\n});\n\ntry {\n  await acmePayments.deleteTerminal({\n    terminalId: 'unique_id_for_this_terminal',\n  });\n} catch (error) {\n  // handle error\n}\n```\n\n## Migrating from previous version\n\nWe’ve migrated our terminals infrastructure. New terminal lifecycle calls are documented here: https://developers.acmepayments.com/support/solutions/articles/33000279925-payments-terminals\n\nYou will find some methods have changed if you were previously using our previous `@acmeticketing/payment-sdk` package:\n\n| From `@acmeticketing/payment-sdk`                            | To `@acmeticketing/payments`                                                                                                                                                                                      |\n| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `async ACMEPayments.init()`                                  | `ACMEPayments.create()`                                                                                                                                                                                           |\n|                                                              | `async ACMEPayments.activateTerminal(props)` The pairing process only has to be done once.                                                                                                                        |\n|                                                              | `async ACMEPayments.deleteTerminal(props)`                                                                                                                                                                        |\n| `ACMEPayments.createTerminal(props)`                         | Not available by this SDK version. Instead, you may pass a `terminalId` in most methods.                                                                                                                          |\n| `ACMETerminal.getConnectionStatus()`                         | Not available in this SDK version.                                                                                                                                                                                |\n| `ACMETerminal.getConnectedReader()`                          | Not available in this SDK version.                                                                                                                                                                                |\n| `ACMETerminal.getPaymentStatus()`                            | Not available in this SDK version.                                                                                                                                                                                |\n| `async ACMETerminal.discoverReaders()`                       | `async ACMEPayments.fetchTerminals(props?)`                                                                                                                                                                       |\n| `async ACMETerminal.connectReader(readerOrId)`               | Not available this SDK version. You pass a `terminalId` in most methods instead.                                                                                                                                  |\n| `async ACMETerminal.disconnectReader()`                      | You may delete a terminal but you're not required to disconnect from it.                                                                                                                                          |\n| `async ACMETerminal.sale(params)`                            | You need to call `async ACMEPayments.authorizePayment(props)` followed by `async ACMEPayments.capturePayment(props)`                                                                                              |\n| `async ACMETerminal.cancelSale()`                            | Not available in this SDK version.                                                                                                                                                                                |\n| `async ACMETerminal.refund(params)`                          | At present, this SDK version does not support refunds, please use our PCI compliant tokenized method. Referenced here: https://developers.acmepayments.com/support/solutions/articles/33000262275-payments-refund |\n| `async ACMETerminal.getTransactionById(transactionId)`       | At present, this SDK version does not support transactions. Please use our Transactions API referenced here: https://developers.acmepayments.com/support/solutions/articles/33000268600-payments-transactions     |\n| `async ACMETerminal.getTransactionsByExternalId(externalId)` | At present, this SDK version does not support transactions. Please use our Transactions API referenced here: https://developers.acmepayments.com/support/solutions/articles/33000268600-payments-transactions     |\n","readmeFilename":"README.md"}