{"id":19888856,"url":"https://github.com/paypal/payouts-php-sdk","last_synced_at":"2025-04-06T14:13:05.761Z","repository":{"id":41235529,"uuid":"238863610","full_name":"paypal/Payouts-PHP-SDK","owner":"paypal","description":"PHP SDK for Payouts RESTful APIs","archived":false,"fork":false,"pushed_at":"2024-08-06T13:04:38.000Z","size":210,"stargazers_count":51,"open_issues_count":9,"forks_count":34,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-30T12:08:49.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-07T07:07:50.000Z","updated_at":"2025-03-24T10:07:49.000Z","dependencies_parsed_at":"2024-12-03T18:41:53.428Z","dependency_job_id":null,"html_url":"https://github.com/paypal/Payouts-PHP-SDK","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"3c102e0cc1e85480f3466e49d01069919e6237bb"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2FPayouts-PHP-SDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2FPayouts-PHP-SDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2FPayouts-PHP-SDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2FPayouts-PHP-SDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paypal","download_url":"https://codeload.github.com/paypal/Payouts-PHP-SDK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492566,"owners_count":20947545,"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:27.787Z","updated_at":"2025-04-06T14:13:05.728Z","avatar_url":"https://github.com/paypal.png","language":"PHP","funding_links":["https://developer.paypal.com/docs/api/payments.payouts-batch/v1/","https://developer.paypal.com/docs/payouts/","https://developer.paypal.com/docs/payouts/reference/setup-sdk","https://developer.paypal.com/docs/payouts/reference/setup-sdk/","https://developer.paypal.com/developer/applications"],"categories":[],"sub_categories":[],"readme":"# PayPal Payouts PHP SDK v2\n\n![Home Image](homepage.jpg)\n\n__Welcome to PayPal Payouts__. This repository contains PayPal's PHP SDK for Payouts and samples for [v1/payments/payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/) APIs.\n\nThis is a part of the next major PayPal SDK. It includes a simplified interface to only provide simple model objects and blueprints for HTTP calls. This repo currently contains functionality for PayPal Payouts APIs which includes [Payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/).\n\nPlease refer to the [PayPal Payouts Integration Guide](https://developer.paypal.com/docs/payouts/) for more information. Also refer to [Setup your SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk) for additional information about setting up the SDK's. \n\n## Prerequisites\n\nPHP 5.6 and above\n\nAn environment which supports TLS 1.2 (see the TLS-update site for more information)\n\n## Usage\n### Binaries\n\nIt is not necessary to fork this repository for using the PayPal SDK. Please take a look at [PayPal Payouts Server SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk/#install-the-sdk) for configuring and working with SDK without forking this code.\n\nFor contributing to this repository or using the samples you can fork this repository.\n\n### Setting up credentials\n\nGet client ID and client secret by going to https://developer.paypal.com/developer/applications and generating a REST API app. Get \u003cb\u003eClient ID\u003c/b\u003e and \u003cb\u003eSecret\u003c/b\u003e from there.\n\n```PHP\nrequire __DIR__ . '/vendor/autoload.php';\nuse PaypalPayoutsSDK\\Core\\PayPalHttpClient;\nuse PaypalPayoutsSDK\\Core\\SandboxEnvironment;\n// Creating an environment\n$clientId = \"\u003c\u003cPAYPAL-CLIENT-ID\u003e\u003e\";\n$clientSecret = \"\u003c\u003cPAYPAL-CLIENT-SECRET\u003e\u003e\";\n\n$environment = new SandboxEnvironment($clientId, $clientSecret);\n$client = new PayPalHttpClient($environment);\n```\n\n## Examples\n### Creating a Payout\nThis will create a Payout and print batch id for the created Payouts\n\n```PHP\nuse PaypalPayoutsSDK\\Payouts\\PayoutsPostRequest;\n$request = new PayoutsPostRequest();\n$body= json_decode(\n            '{\n                \"sender_batch_header\":\n                {\n                  \"email_subject\": \"SDK payouts test txn\"\n                },\n                \"items\": [\n                {\n                  \"recipient_type\": \"EMAIL\",\n                  \"receiver\": \"payouts2342@paypal.com\",\n                  \"note\": \"Your 1$ payout\",\n                  \"sender_item_id\": \"Test_txn_12\",\n                  \"amount\":\n                  {\n                    \"currency\": \"USD\",\n                    \"value\": \"1.00\"\n                  }\n                }]\n              }',             \n            true);\n$request-\u003ebody = $body;\n$client = PayPalClient::client();\n$response = $client-\u003eexecute($request);\nprint \"Status Code: {$response-\u003estatusCode}\\n\";\nprint \"Status: {$response-\u003eresult-\u003ebatch_header-\u003ebatch_status}\\n\";\nprint \"Batch ID: {$response-\u003eresult-\u003ebatch_header-\u003epayout_batch_id}\\n\";\nprint \"Links:\\n\";\nforeach($response-\u003eresult-\u003elinks as $link)\n {\n   print \"\\t{$link-\u003erel}: {$link-\u003ehref}\\tCall Type: {$link-\u003emethod}\\n\";\n }\necho json_encode($response-\u003eresult, JSON_PRETTY_PRINT), \"\\n\";\n        \n```\n\n### Retrieve a Payouts Batch\nThis will retrieve a payouts batch\n```PHP\n $request = new PayoutsGetRequest($batchId);\n $response = $client-\u003eexecute($request);\n echo json_encode($response-\u003eresult, JSON_PRETTY_PRINT), \"\\n\";\n```\n\n### Parsing Failure Response\nThis will execute a Get request to simulate a failure\n```PHP\n try{\n    $request = new PayoutsGetRequest(null);\n    $response = $client-\u003eexecute($request);\n    echo json_encode($response-\u003eresult, JSON_PRETTY_PRINT), \"\\n\";\n  } catch(HttpException $e){\n    echo $e-\u003egetMessage()\n    var_dump(json_decode($e-\u003egetMessage()));\n\n  }\n\n\n```\n## Running tests\n\nTo run integration tests using your client id and secret, clone this repository and run the following command:\n\n```sh\n$ composer install\n$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer unit\n```\n\nYou may use the client id and secret above for demonstration purposes.\n\n\n## Samples\n\nYou can start off by trying out [Samples](/samples).\n\nNote: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable while executing the samples.\n\n## License\nCode released under [SDK LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fpayouts-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaypal%2Fpayouts-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fpayouts-php-sdk/lists"}