Php интеграция с paypal

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

paypal / PayPal-PHP-SDK Public archive

PHP SDK for PayPal RESTful APIs

License

paypal/PayPal-PHP-SDK

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This SDK is deprecated. You can continue to use it, but no new features or support requests will be accepted. For alternatives, please visit the current SDK homepage on the PayPal Developer Portal

Home Image

Welcome to PayPal PHP SDK. This repository contains PayPal’s PHP SDK and samples for REST API.

Direct Credit Card Support

Important: The PayPal REST API no longer supports new direct credit card integrations. Please instead consider Braintree Direct; which is, PayPal’s preferred integration solution for accepting direct credit card payments in your mobile app or website. Braintree, a PayPal service, is the easiest way to accept credit cards, PayPal, and many other payment methods.

The Payment Card Industry (PCI) Council has mandated that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, PayPal is updating its services to require TLS 1.2 for all HTTPS connections. At this time, PayPal will also require HTTP/1.1 for all connections. Click here for more information

Connections to the sandbox environment use only TLS 1.2.

Our PayPal-PHP-SDK Page includes all the documentation related to PHP SDK. Everything from SDK Wiki, to Sample Codes, to Releases. Here are few quick links to get you there faster.

  • SDK now allows injecting your logger implementation. Please read documentation for more details.
  • If you are running into SSL Connect Error talking to sandbox or live, please update your SDK to latest version or, follow instructions as shown here
  • Checkout the latest 1.0.0 release. Here are all the breaking Changes in v1.0.0 if you are migrating from older versions.
  • Now we have a Github Page, that helps you find all helpful resources building applications using PayPal-PHP-SDK.

Please note that if you are integrating with PayPal Checkout, this SDK and corresponding API v1/payments are in the process of being deprecated.

We recommend that you integrate with API v2/checkout/orders and v2/payments. Please refer to the Checkout PHP SDK to continue with the integration.

We’re releasing a brand new version of our SDK! 2.0 is currently at release candidate status, and represents a full refactor, with the goal of making all of our APIs extremely easy to use. 2.0 includes all of the existing APIs (except payouts), and includes the new Orders API (Disputes and Marketplace coming soon). Check out the FAQ and migration guide, and let us know if you have any suggestions or issues!

Read License for more licensing information.

Read here for more information.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

PHP SDK for Payouts RESTful APIs

License

paypal/Payouts-PHP-SDK

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

PayPal Payouts PHP SDK v2

Home Image

Welcome to PayPal Payouts. This repository contains PayPal’s PHP SDK for Payouts and samples for v1/payments/payouts APIs.

This 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.

Please refer to the PayPal Payouts Integration Guide for more information. Also refer to Setup your SDK for additional information about setting up the SDK’s.

An environment which supports TLS 1.2 (see the TLS-update site for more information)

It is not necessary to fork this repository for using the PayPal SDK. Please take a look at PayPal Payouts Server SDK for configuring and working with SDK without forking this code.

For contributing to this repository or using the samples you can fork this repository.

Get client ID and client secret by going to https://developer.paypal.com/developer/applications and generating a REST API app. Get Client ID and Secret from there.

require __DIR__ . '/vendor/autoload.php'; use PaypalPayoutsSDK\Core\PayPalHttpClient; use PaypalPayoutsSDK\Core\SandboxEnvironment; // Creating an environment $clientId pl-s">>"; $clientSecret pl-s">>"; $environment = new SandboxEnvironment($clientId, $clientSecret); $client = new PayPalHttpClient($environment);

This will create a Payout and print batch id for the created Payouts

use PaypalPayoutsSDK\Payouts\PayoutsPostRequest; $request = new PayoutsPostRequest(); $body= json_decode( '  "sender_batch_header":   "email_subject": "SDK payouts test txn" >, "items": [   "recipient_type": "EMAIL", "receiver": "payouts2342@paypal.com", "note": "Your 1$ payout", "sender_item_id": "Test_txn_12", "amount":   "currency": "USD", "value": "1.00" > >] >', true); $request->body = $body; $client = PayPalClient::client(); $response = $client->execute($request); print "Status Code: $response->statusCode>\n"; print "Status: $response->result->batch_header->batch_status>\n"; print "Batch ID: $response->result->batch_header->payout_batch_id>\n"; print "Links:\n"; foreach($response->result->links as $link) < print "\t$link->rel>: $link->href>\tCall Type: $link->method>\n"; > echo json_encode($response->result, JSON_PRETTY_PRINT), "\n";

This will retrieve a payouts batch

$request = new PayoutsGetRequest($batchId); $response = $client->execute($request); echo json_encode($response->result, JSON_PRETTY_PRINT), "\n";

This will execute a Get request to simulate a failure

try< $request = new PayoutsGetRequest(null); $response = $client->execute($request); echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; > catch(HttpException $e)< echo $e->getMessage() var_dump(json_decode($e->getMessage())); >

To run integration tests using your client id and secret, clone this repository and run the following command:

$ composer install $ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer unit

You may use the client id and secret above for demonstration purposes.

You can start off by trying out Samples.

Note: Update the PayPalClient.php with your sandbox client credentials or pass your client credentials as environment variable while executing the samples.

Источник

Читайте также:  font-style
Оцените статью