{"id":16800823,"url":"https://github.com/sudoplz/react-native-sp-reader-sdk","last_synced_at":"2025-04-11T00:31:53.950Z","repository":{"id":57340291,"uuid":"128108179","full_name":"SudoPlz/react-native-sp-reader-sdk","owner":"SudoPlz","description":"A react-native module that wraps the brand new paysdk by square","archived":false,"fork":false,"pushed_at":"2018-09-27T22:57:29.000Z","size":49,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T13:14:55.459Z","etag":null,"topics":["paysdk","react-native","react-native-module","readersdk","square","squareup"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SudoPlz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-04T19:03:42.000Z","updated_at":"2019-02-11T09:14:01.000Z","dependencies_parsed_at":"2022-09-07T10:22:34.811Z","dependency_job_id":null,"html_url":"https://github.com/SudoPlz/react-native-sp-reader-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SudoPlz%2Freact-native-sp-reader-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SudoPlz%2Freact-native-sp-reader-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SudoPlz%2Freact-native-sp-reader-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SudoPlz%2Freact-native-sp-reader-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SudoPlz","download_url":"https://codeload.github.com/SudoPlz/react-native-sp-reader-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322430,"owners_count":21084334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["paysdk","react-native","react-native-module","readersdk","square","squareup"],"created_at":"2024-10-13T09:35:11.444Z","updated_at":"2025-04-11T00:31:53.918Z","avatar_url":"https://github.com/SudoPlz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# react-native-sp-reader-sdk\n\n## This is a 3rd party module, but square just released their own implementation of an RN module\n\nSo:\n- we will now be joining forces on that repo\n- You can now use the official Square RN module here --\u003e https://github.com/square/react-native-square-reader-sdk\n\n\n## Dependencies\n\n`react-native` version `\u003e0.40`\n\n## Installation\n\nCheck the [wiki](https://github.com/SudoPlz/react-native-sp-reader-sdk/wiki) for instructions.\n\n## Usage \n\n  ```javascript\n\n  import ReaderSDK from 'react-native-sp-reader-sdk';\n\n  ```\n\n\n### Example \n\n```javascript\nclass testApp extends Component {\n  constructor() {\n    super();\n    const readerSdk = new ReaderSDK();\n\n\n    // initialize the sdk\n    readerSdk.initSdk();\n\n\n    // login with an auth code\n    readerSDK.authorizeWithCode(\"1234567\").then(() =\u003e {\n      // success\n    }).catch((err) =\u003e {\n      // failure\n    })\n\n    // find out if already logged into readerSDK\n    const isLoggedIn = await readerSdk.isLoggedIn();\n\n\n    // set other settings\n    readerSDK.setCheckoutParameters(\n      ReaderSDK\n        .AdditionalPaymentTypes\n        .MANUAL_CARD_ENTRY, // additional payment types\n      null, // tip percentages arr\n      tipsEnabled, // tips enabled\n      false, // custom tip field visible\n      false, // separate tip screen visible\n      true, // skip receipt\n      false, // always require signature\n      false, // allow split tender\n    );\n\n    // present the settings screen\n    readerSDK.presentReaderSettingsScreen(\n      true, // animate modal window\n    );\n\n    // find out if logged in\n    const isLoggedIn = readerSDK.isLoggedIn()\n      .then(isLoggedIn =\u003e {\n        // isLoggedIn is either true or false\n      });\n\n    readerSDK.requestPermissions() // so try asking for permissions (needed for iOS)\n      .then((permissions) =\u003e {\n        if (permissions != null) {\n          let permissionsGranted;\n          if (notAndroid) {\n            const {\n              appLocationPermission,\n              deviceLocationEnabled,\n              appRecordingPermission,\n            } = permissions;\n            // do sth?\n          }\n        }\n      });\n\n     readerSDK.checkoutWithAmount(\n        100, // amount to pay (in cents)\n        'This is a transaction', // transaction notes\n      ).then((result) =\u003e { // transactionRequestWithCentsAmount success\n         /*\n          {\n              \"transaction\": {\n                createdAt:\"2018-07-25T18:13:02+03:00\"\n                locationID:\"18K28ZA1PZF1T\"\n                tenderCnt:1\n                totalMoneyAmount:115 (in cents, aka 1,15$)\n                totalMoneyCurrency:\"USD\"\n                totalTipMoneyAmount:15 (in cents, aka 0,15$)\n                totalTipMoneyCurrency:\"USD\"\n                transactionClientID:\"EE8E7FF7-D16E-4350-91AD-47F2S6C7B447\"\n                transactionID:\"Wo5JKw2fOp7dfwai7Gv3FlO14D9eV\"\n              }\n          }\n          */\n\n        // Do something with the result\n      })\n      .catch((e) =\u003e { // checkoutWithAmount error\n      });\n\n      readerSDK.deauthorize(); // logout\n    }\n  ...\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudoplz%2Freact-native-sp-reader-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudoplz%2Freact-native-sp-reader-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudoplz%2Freact-native-sp-reader-sdk/lists"}