{"id":19888903,"url":"https://github.com/paypal/paypalcheckout-samples-ios","last_synced_at":"2025-05-02T17:32:47.156Z","repository":{"id":40704449,"uuid":"262426278","full_name":"paypal/paypalcheckout-samples-ios","owner":"paypal","description":"PayPal Native Checkout iOS Samples","archived":false,"fork":false,"pushed_at":"2024-03-27T00:57:26.000Z","size":278,"stargazers_count":5,"open_issues_count":4,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-13T19:27:24.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paypal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-08T20:51:48.000Z","updated_at":"2024-04-11T20:59:13.000Z","dependencies_parsed_at":"2023-01-28T16:31:29.052Z","dependency_job_id":null,"html_url":"https://github.com/paypal/paypalcheckout-samples-ios","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/paypal%2Fpaypalcheckout-samples-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypalcheckout-samples-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypalcheckout-samples-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fpaypalcheckout-samples-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paypal","download_url":"https://codeload.github.com/paypal/paypalcheckout-samples-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224324455,"owners_count":17292521,"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":[],"created_at":"2024-11-12T18:08:36.095Z","updated_at":"2024-11-12T18:08:36.831Z","avatar_url":"https://github.com/paypal.png","language":"Objective-C","funding_links":["https://developer.paypal.com/developer/applications/","https://developer.paypal.com/docs/business/native-checkout/ios/"],"categories":[],"sub_categories":[],"readme":"# PayPalCheckout Sample Apps\n\nThis is a sample repository showcasing how to integrate the Native Checkout experience into your `iOS` application.\n\n**Table of Contents**:\n\u003c!-- TOC --\u003e  \n1. [Quick Setup](#quick-setup)\n    - [Create Application ID](#create-application-id)\n    - [Application Scopes](#application-scopes)\n    - [Quick Start](#quick-start)\n2. [Prerequisites](#prerequisites)\n    - [Application Creation](#application-creation)\n    - [NVM](#nvm)\n    - [Docker](#docker)\n3. [Setup](#setup)\n    - [Set Client ID / Client Secret / Return URL](#1-set-client-id--client-secret--return-url)\n    - [Setup Dependencies](#2-setup-dependencies)\n4. [Troubleshooting](#troubleshooting)\n    - [NVM Issues](#nvm-issues)\n5. [Reference](#reference)\n\u003c!-- /TOC --\u003e\n\n## Quick Setup\n\n### Create Application ID\n\nCreate an application at [PayPal Applications](https://developer.paypal.com/developer/applications/). You can retrieve your client id, client secret, and create a return url there.\n\n### Application Scopes\n\nIn order to set the proper application scope permissions follow the documentation for settings scopes at [Initial Setup Documentation](https://developer.paypal.com/docs/business/native-checkout/ios/#know-before-you-code).\n\n### Quick Start\n\nAfter creating your application, run the following commands at the root directory:\n\n```bash\n# Set client id and secret for server and client\n$ ./bin/setids \"\u003cyour_client_id\u003e\" \"\u003cyour_client_secret\u003e\" \"\u003creturn_url\u003e\"\n\n# Setup dependencies, install PayPayCheckout with Cocoapods, open workspace, and start server\n$ ./bin/setup --cocoapods\n```\n\nYour `CLIENT_ID` and `CLIENT_SECRET` are retrieved from the [applications portal](https://developer.paypal.com/developer/applications/). Your `return_url` will be retrieved from there as well, but you will need to set the proper [scopes](#application-scopes) before your uri can be utilized.\n\n**Note**: Please note run this on Simulator as you will be running a local server.\n\n## Prerequisites\n\n### Application Creation\n\nIn order for this project to run properly we need to create an application at [PayPal Applications](https://developer.paypal.com/developer/applications/). Make sure you login and create your appropriate application. You can find additional information on our documentation [here](https://developer.paypal.com/docs/business/native-checkout/ios/#know-before-you-code). Then you need to ensure that you have a `.env` file inside the `node_checkout/` directory which contains your `CLIENT_ID` and `CLIENT_SECRET`.\n\nWe've automated away the process for you to create your .env file and finding / replacing any source code with the client_id and return_url by running the following command:\n\n```bash\n$ ./bin/setids \"\u003cyour_client_id\u003e\" \"\u003cyour_client_secret\u003e\" \"\u003creturn_url\u003e\"\n```\n\nAs a result after running this script the `CLIENT_ID` and `CLIENT_SECRET` environment variables in .env file, and the `\u003cclient_id\u003e` and `\u003creturn_url\u003e` in the sample apps' source code will be set to the values you provided.\n\nIf you do not want to expose your `CLIENT_SECRET` into your bash history, you can optionally choose to only include your `CLIENT_ID`, then bash or zsh will prompt you to enter your `CLIENT_SECRET`:\n\n```bash\n$ ./bin/setids \"\u003cyour_client_id\u003e\"\nPlease enter your [client secret]: \"\u003cyour_client_secret\u003e\"\nPlease enter your [client return url]: \"\u003creturn_url\u003e\"\n\nChecking for places where your client ids, secrets, and return url are used\n\n[done] Check for an existing .env file\n[done] Updating objective-c files for CLIENT_ID...\n[done] Updating swift files for CLIENT_ID...\n[done] Updating objective-c files for return_url...\n[done] Updating swift files for return_url...\n```\n\n### NVM\n\nThe `node checkout` service by default will run the node service through `node@10.17.0 version` and this is done through `nvm` and the local `.nvmrc` file in `./node_checkout/`. The `./bin/setup` script ensures that `nvm` is installed if you do not have it installed locally. If you choose to switch back to your original `node version` after running the sample demo, you can simply run `nvm use default`.\n\n### Docker\n\n**Please note this step is optional**\n\nThe `node checkout` service can optionally run with Docker. You can install Docker [here](https://docs.docker.com/docker-for-mac/install/), or you can let the `./bin/setup` script install docker for you. Please note that you will require `docker-compose` support. \n\nTo use via Docker just run:\n\n```bash\n$ ./bin/setup --use-docker\n```\n\n**Note:** You will need to ensure that Docker is running before you execute `./bin/setup`, if you are installing docker from the `./bin/setup` script you can run it again since the script will ensure Docker opens after install.\n\n## Setup\n\nThere are two steps required to run the project:\n\n```text\n1. Set Client ID / Client Secret / Return URL\n2. Setup Dependencies\n```\n\nThe above two steps are handled by two scripts, `./bin/setids` and `./bin/setup`, respectively.\n\n### 1. Set Client ID / Client Secret / Return URL\nRun the following commands at the _project root level_:\n```bash\n$ ./bin/setids \"\u003cyour_client_id\u003e\" \"\u003cyour_client_secret\u003e\" \"\u003cyour_return_url\u003e\"\n# optionally just enter client id and bash will prompt for secret, and return url \n```\n\n### 2. Setup Dependencies\n\nSetting up dependencies will be handled with the `./bin/setup` script. In detail, this activates a build script which runs the following steps:\n\n1. Check if Homebrew, Docker (if we specified it), nvm, and Cocoapods/Carthage are installed\n2. Run `pod install` or `carthage update` (depending on whether you specified `--cocoapods` or `--carthage`). This will download binaries for the project\n3. Open the workspace, `Samples.xcworkspace`\n4. Check to see if we've specified `--use-docker`\n    - If we've specified `--use-docker`, we will run `docker-compose up`, this will create the container, install dependencies in container, and run on port 3000\n    - If we did not specify `--use-docker` which is the default flow, then we will use `nvm` to install `node@10.17.0` then switch to that via `nvm use 10.17.0`, and finally `npm install \u0026\u0026 npm start`\n\n\nWe provide three ways you can install our SDK: via Cocoapods, Carthage, or Swift Package Manager.\n\n#### Cocoapods\nRun the following commands at the _project root level_:\n```\n$ ./bin/setup --cocoapods\n# will install pod if not already installed, run pod install using our provided Podfile, and install any programs you require\n```\n\n#### Carthage\nRun the following commands at the _project root level_:\n```\n$ ./bin/setup --carthage\n# will install carthage if not already installed, run carthage update using our provided Cartfile, and install any programs you require\n```\nNote: The following `Search Paths` must be present under `Framework Search Paths` for both `Samples.Swift` and `Samples.Objc`:\n\n```bash\n$(PROJECT_DIR)/../Carthage/Build/iOS\n```\n\n#### Swift Package Manager\nRun the following commands at the _project root level_:\n```\n$ ./bin/setup\n# will install any programs you require\n```\n\nThen you can install the PayPalCheckout SDK via Swift Package Manager by following Apple's [package integration guide](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app), while specifying `https://github.com/paypal/paypalcheckout-ios.git` as the source git repository.\n\n## Troubleshooting\n\n### NVM Issues\n\nNVM may encounter issues if installed via `Homebrew`. The official NVM repository does not support `Homebrew`, so it is advised that you uninstall from `Homebrew` via:\n\n```bash\nbrew unlink nvm\nbrew uninstall nvm\n```\n\nAnd remove any artifacts:\n\n```bash\nrm -rf ~/.nvm\nrm -rf ~/.npm  \n```\n\nThen rerun the `./bin/setup` script to install `nvm`.\n\n## Reference\n- [iOS Native Checkout SDK repo](https://github.com/paypal/paypalcheckout-ios)\n- [iOS Native Checkout Reference docs](https://paypal.github.io/mobile-checkout-docs/ios/reference/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fpaypalcheckout-samples-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaypal%2Fpaypalcheckout-samples-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fpaypalcheckout-samples-ios/lists"}