mobly / paypal-stc
PayPal STC SDK Integration
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 11
Forks: 0
Open Issues: 0
pkg:composer/mobly/paypal-stc
Requires
- php: >=5.4
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- monolog/monolog: ^1.24
- squizlabs/php_codesniffer: ^3.4
This package is not auto-updated.
Last update: 2025-10-12 11:21:26 UTC
README
Mobly PayPal-STC-SDK
Simple SDK to make an standardize paypal stc integration
How to use
Make a Payment Transaction:
require __DIR__ . '/vendor/autoload.php'; use Mobly\PaypalStc\Sdk\Client; use Mobly\PaypalStc\Sdk\Command\Risk; use Mobly\PaypalStc\Sdk\Entities\Receiver; use Mobly\PaypalStc\Sdk\Entities\Transaction; use Mobly\PaypalStc\Sdk\Interfaces\PaymentInterface; $paypalPlusMerchantId = "my-merchant-id"; $trackingId = 'my-tracking'; $token = 'my-token'; $url = 'http://www.paypal.com'; $risk = new Risk($paypalPlusMerchantId, $trackingId); $receiver = new Receiver(); $order = new Transaction(); $sender = new \Mobly\PaypalStc\Sdk\Entities\Sender(); $sender->setSenderFirstName('João') ->setSenderLastName('João') ->setSenderPhone(11123451234); //other fields ... $receiver->setBusinessName('Mobly'); $receiver->setReceiverEmail('paypal@paypal.com'); $receiver->setReceiverAccountId('paypal@paypal.com'); $receiver->setReceiverAddressState('SP'); $receiver->setReceiverAddressCity('São Paulo'); $receiver->setReceiverAddressCountryCode(PaymentInterface::PAYMENT_CURRENCY); // other fields ... $transaction = new Transaction(); $transaction->setSender($sender) ->setReceiver($receiver); $client = new Client($token, $url); $risk = new Risk($paypalPlusMerchantId, $trackingId); try { $risk->registerRisk($client, $transaction); $risk->retrieveRisk($client); } catch (\GuzzleHttp\Exception\GuzzleException $e) { die($e->getMessage()); } catch (Exception $e) { die($e->getMessage()); }