forked from LiveCarta/PayPal-PHP-SDK
@@ -20,7 +20,9 @@ abstract class AuthorizationCache
|
|||||||
public static function pull($config = null, $clientId = null)
|
public static function pull($config = null, $clientId = null)
|
||||||
{
|
{
|
||||||
// Return if not enabled
|
// Return if not enabled
|
||||||
if (!self::isEnabled($config)) { return null; }
|
if (!self::isEnabled($config)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$tokens = null;
|
$tokens = null;
|
||||||
$cachePath = self::cachePath($config);
|
$cachePath = self::cachePath($config);
|
||||||
@@ -54,7 +56,9 @@ abstract class AuthorizationCache
|
|||||||
public static function push($config = null, $clientId, $accessToken, $tokenCreateTime, $tokenExpiresIn)
|
public static function push($config = null, $clientId, $accessToken, $tokenCreateTime, $tokenExpiresIn)
|
||||||
{
|
{
|
||||||
// Return if not enabled
|
// Return if not enabled
|
||||||
if (!self::isEnabled($config)) { return; }
|
if (!self::isEnabled($config)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$cachePath = self::cachePath($config);
|
$cachePath = self::cachePath($config);
|
||||||
if (!is_dir(dirname($cachePath))) {
|
if (!is_dir(dirname($cachePath))) {
|
||||||
@@ -116,6 +120,4 @@ abstract class AuthorizationCache
|
|||||||
$config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap();
|
$config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap();
|
||||||
return (array_key_exists($key, $config)) ? trim($config[$key]) : null;
|
return (array_key_exists($key, $config)) ? trim($config[$key]) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Common;
|
namespace PayPal\Common;
|
||||||
|
|
||||||
use PayPal\Validation\JsonValidator;
|
use PayPal\Validation\JsonValidator;
|
||||||
use PayPal\Validation\ModelAccessorValidator;
|
use PayPal\Validation\ModelAccessorValidator;
|
||||||
|
|
||||||
@@ -67,7 +68,9 @@ class PayPalModel
|
|||||||
public static function getList($data)
|
public static function getList($data)
|
||||||
{
|
{
|
||||||
// Return Null if Null
|
// Return Null if Null
|
||||||
if ($data === null) { return null; }
|
if ($data === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_a($data, get_class(new \stdClass()))) {
|
if (is_a($data, get_class(new \stdClass()))) {
|
||||||
//This means, root element is object
|
//This means, root element is object
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class PayPalUserAgent
|
|||||||
*/
|
*/
|
||||||
public static function getValue($sdkName, $sdkVersion)
|
public static function getValue($sdkName, $sdkVersion)
|
||||||
{
|
{
|
||||||
|
|
||||||
$featureList = array(
|
$featureList = array(
|
||||||
'platform-ver=' . PHP_VERSION,
|
'platform-ver=' . PHP_VERSION,
|
||||||
'bit=' . self::_getPHPBit(),
|
'bit=' . self::_getPHPBit(),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Common;
|
namespace PayPal\Common;
|
||||||
|
|
||||||
use PayPal\Exception\PayPalConfigurationException;
|
use PayPal\Exception\PayPalConfigurationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,7 +121,7 @@ class ReflectionUtil
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
foreach ($annots[1] as $i => $annot) {
|
foreach ($annots[1] as $i => $annot) {
|
||||||
$annotations[strtolower($annot)] = empty($annots[2][$i]) ? TRUE : rtrim($annots[2][$i], " \t\n\r)");
|
$annotations[strtolower($annot)] = empty($annots[2][$i]) ? true : rtrim($annots[2][$i], " \t\n\r)");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $annotations;
|
return $annotations;
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ class PayPalConfigManager
|
|||||||
*/
|
*/
|
||||||
public function get($searchKey)
|
public function get($searchKey)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (array_key_exists($searchKey, $this->configs)) {
|
if (array_key_exists($searchKey, $this->configs)) {
|
||||||
return $this->configs[$searchKey];
|
return $this->configs[$searchKey];
|
||||||
} else {
|
} else {
|
||||||
@@ -108,7 +107,6 @@ class PayPalConfigManager
|
|||||||
|
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,7 +121,6 @@ class PayPalConfigManager
|
|||||||
*/
|
*/
|
||||||
public function getIniPrefix($userId = null)
|
public function getIniPrefix($userId = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($userId == null) {
|
if ($userId == null) {
|
||||||
$arr = array();
|
$arr = array();
|
||||||
foreach ($this->configs as $key => $value) {
|
foreach ($this->configs as $key => $value) {
|
||||||
@@ -157,7 +154,4 @@ class PayPalConfigManager
|
|||||||
{
|
{
|
||||||
trigger_error('Clone is not allowed.', E_USER_ERROR);
|
trigger_error('Clone is not allowed.', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ class PayPalCredentialManager
|
|||||||
$suffix++;
|
$suffix++;
|
||||||
$key = $prefix . $suffix;
|
$key = $prefix . $suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,5 +163,4 @@ class PayPalCredentialManager
|
|||||||
{
|
{
|
||||||
trigger_error('Clone is not allowed.', E_USER_ERROR);
|
trigger_error('Clone is not allowed.', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class PayPalHttpConfig
|
|||||||
public static $defaultCurlOptions = array(
|
public static $defaultCurlOptions = array(
|
||||||
CURLOPT_SSLVERSION => 6,
|
CURLOPT_SSLVERSION => 6,
|
||||||
CURLOPT_CONNECTTIMEOUT => 10,
|
CURLOPT_CONNECTTIMEOUT => 10,
|
||||||
CURLOPT_RETURNTRANSFER => TRUE,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute
|
CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute
|
||||||
CURLOPT_USERAGENT => 'PayPal-PHP-SDK',
|
CURLOPT_USERAGENT => 'PayPal-PHP-SDK',
|
||||||
CURLOPT_HTTPHEADER => array(),
|
CURLOPT_HTTPHEADER => array(),
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ class PayPalHttpConnection
|
|||||||
*/
|
*/
|
||||||
private function getHttpHeaders()
|
private function getHttpHeaders()
|
||||||
{
|
{
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach ($this->httpConfig->getHeaders() as $k => $v) {
|
foreach ($this->httpConfig->getHeaders() as $k => $v) {
|
||||||
$ret[] = "$k: $v";
|
$ret[] = "$k: $v";
|
||||||
@@ -101,7 +100,7 @@ class PayPalHttpConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Default Option if Method not of given types in switch case
|
//Default Option if Method not of given types in switch case
|
||||||
if ($this->httpConfig->getMethod() != NULL) {
|
if ($this->httpConfig->getMethod() != null) {
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod());
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,5 +190,4 @@ class PayPalHttpConnection
|
|||||||
//Return result object
|
//Return result object
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,5 +116,4 @@ class PayPalLoggingManager
|
|||||||
$this->logger->debug($message);
|
$this->logger->debug($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,4 @@ class PayPalInvalidCredentialException extends \Exception
|
|||||||
. ': <b>' . $this->getMessage() . '</b>';
|
. ': <b>' . $this->getMessage() . '</b>';
|
||||||
return $errorMsg;
|
return $errorMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,5 +33,4 @@ class PayPalMissingCredentialException extends \Exception
|
|||||||
|
|
||||||
return $errorMsg;
|
return $errorMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ class RestHandler implements IPayPalHandler
|
|||||||
*/
|
*/
|
||||||
public function handle($httpConfig, $request, $options)
|
public function handle($httpConfig, $request, $options)
|
||||||
{
|
{
|
||||||
|
|
||||||
$credential = $this->apiContext->getCredential();
|
$credential = $this->apiContext->getCredential();
|
||||||
$config = $this->apiContext->getConfig();
|
$config = $this->apiContext->getConfig();
|
||||||
|
|
||||||
|
|||||||
@@ -13,5 +13,4 @@ interface PayPalLogFactory
|
|||||||
* @return LoggerInterface instance of logger object implementing LoggerInterface
|
* @return LoggerInterface instance of logger object implementing LoggerInterface
|
||||||
*/
|
*/
|
||||||
public function getLogger($className);
|
public function getLogger($className);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ use PayPal\Core\PayPalConfigManager;
|
|||||||
use Psr\Log\AbstractLogger;
|
use Psr\Log\AbstractLogger;
|
||||||
use Psr\Log\LogLevel;
|
use Psr\Log\LogLevel;
|
||||||
|
|
||||||
|
|
||||||
class PayPalLogger extends AbstractLogger
|
class PayPalLogger extends AbstractLogger
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Cipher
|
|||||||
*/
|
*/
|
||||||
const IV_SIZE = 16;
|
const IV_SIZE = 16;
|
||||||
|
|
||||||
function __construct($secretKey)
|
public function __construct($secretKey)
|
||||||
{
|
{
|
||||||
$this->secretKey = $secretKey;
|
$this->secretKey = $secretKey;
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ class Cipher
|
|||||||
* @param $input
|
* @param $input
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function encrypt($input)
|
public function encrypt($input)
|
||||||
{
|
{
|
||||||
// Create a random IV. Not using mcrypt to generate one, as to not have a dependency on it.
|
// Create a random IV. Not using mcrypt to generate one, as to not have a dependency on it.
|
||||||
$iv = substr(uniqid("", true), 0, Cipher::IV_SIZE);
|
$iv = substr(uniqid("", true), 0, Cipher::IV_SIZE);
|
||||||
@@ -45,7 +45,7 @@ class Cipher
|
|||||||
* @param $input
|
* @param $input
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function decrypt($input)
|
public function decrypt($input)
|
||||||
{
|
{
|
||||||
// Decode the IV + data
|
// Decode the IV + data
|
||||||
$input = base64_decode($input);
|
$input = base64_decode($input);
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ class PayPalRestCall
|
|||||||
*/
|
*/
|
||||||
public function execute($handlers = array(), $path, $method, $data = '', $headers = array())
|
public function execute($handlers = array(), $path, $method, $data = '', $headers = array())
|
||||||
{
|
{
|
||||||
|
|
||||||
$config = $this->apiContext->getConfig();
|
$config = $this->apiContext->getConfig();
|
||||||
$httpConfig = new PayPalHttpConfig(null, $method, $config);
|
$httpConfig = new PayPalHttpConfig(null, $method, $config);
|
||||||
$headers = $headers ? $headers : array();
|
$headers = $headers ? $headers : array();
|
||||||
@@ -75,5 +74,4 @@ class PayPalRestCall
|
|||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class NumericValidator
|
|||||||
{
|
{
|
||||||
if (trim($argument) != null && !is_numeric($argument)) {
|
if (trim($argument) != null && !is_numeric($argument)) {
|
||||||
throw new \InvalidArgumentException("$argumentName is not a valid numeric value");
|
throw new \InvalidArgumentException("$argumentName is not a valid numeric value");
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ $request = clone $agreement;
|
|||||||
try {
|
try {
|
||||||
// Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.
|
// Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.
|
||||||
$agreement = $agreement->create($apiContext);
|
$agreement = $agreement->create($apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $ex);
|
ResultPrinter::printError("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $ex);
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ try {
|
|||||||
// the buyer to. Retrieve the url from the $agreement->getApprovalLink()
|
// the buyer to. Retrieve the url from the $agreement->getApprovalLink()
|
||||||
// method
|
// method
|
||||||
$approvalUrl = $agreement->getApprovalLink();
|
$approvalUrl = $agreement->getApprovalLink();
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex);
|
ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex);
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ require __DIR__ . '/../bootstrap.php';
|
|||||||
// ## Approval Status
|
// ## Approval Status
|
||||||
// Determine if the user accepted or denied the request
|
// Determine if the user accepted or denied the request
|
||||||
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||||
|
|
||||||
$token = $_GET['token'];
|
$token = $_GET['token'];
|
||||||
$agreement = new \PayPal\Api\Agreement();
|
$agreement = new \PayPal\Api\Agreement();
|
||||||
try {
|
try {
|
||||||
@@ -36,7 +35,6 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("Get Agreement", "Agreement", $agreement->getId(), null, $agreement);
|
ResultPrinter::printResult("Get Agreement", "Agreement", $agreement->getId(), null, $agreement);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||||
|
|||||||
@@ -18,12 +18,10 @@ $agreementStateDescriptor = new AgreementStateDescriptor();
|
|||||||
$agreementStateDescriptor->setNote("Reactivating the agreement");
|
$agreementStateDescriptor->setNote("Reactivating the agreement");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$suspendedAgreement->reActivate($agreementStateDescriptor, $apiContext);
|
$suspendedAgreement->reActivate($agreementStateDescriptor, $apiContext);
|
||||||
|
|
||||||
// Lets get the updated Agreement Object
|
// Lets get the updated Agreement Object
|
||||||
$agreement = Agreement::get($suspendedAgreement->getId(), $apiContext);
|
$agreement = Agreement::get($suspendedAgreement->getId(), $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $ex);
|
ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $ex);
|
||||||
|
|||||||
@@ -18,12 +18,10 @@ $agreementStateDescriptor = new AgreementStateDescriptor();
|
|||||||
$agreementStateDescriptor->setNote("Suspending the agreement");
|
$agreementStateDescriptor->setNote("Suspending the agreement");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$createdAgreement->suspend($agreementStateDescriptor, $apiContext);
|
$createdAgreement->suspend($agreementStateDescriptor, $apiContext);
|
||||||
|
|
||||||
// Lets get the updated Agreement Object
|
// Lets get the updated Agreement Object
|
||||||
$agreement = Agreement::get($createdAgreement->getId(), $apiContext);
|
$agreement = Agreement::get($createdAgreement->getId(), $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex);
|
ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex);
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ try {
|
|||||||
|
|
||||||
// Lets get the updated Agreement Object
|
// Lets get the updated Agreement Object
|
||||||
$agreement = Agreement::get($createdAgreement->getId(), $apiContext);
|
$agreement = Agreement::get($createdAgreement->getId(), $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", null, $patchRequest, $ex);
|
ResultPrinter::printError("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", null, $patchRequest, $ex);
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ try {
|
|||||||
$createdPlan->update($patchRequest, $apiContext);
|
$createdPlan->update($patchRequest, $apiContext);
|
||||||
|
|
||||||
$plan = Plan::get($createdPlan->getId(), $apiContext);
|
$plan = Plan::get($createdPlan->getId(), $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $ex);
|
ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $ex);
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ try {
|
|||||||
$createdPlan->update($patchRequest, $apiContext);
|
$createdPlan->update($patchRequest, $apiContext);
|
||||||
|
|
||||||
$plan = Plan::get($createdPlan->getId(), $apiContext);
|
$plan = Plan::get($createdPlan->getId(), $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $ex);
|
ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $ex);
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ class ResultPrinter
|
|||||||
self::printConsoleObject($response, $errorMessage);
|
self::printConsoleObject($response, $errorMessage);
|
||||||
printf("\n-------------------------------------------------------------\n\n");
|
printf("\n-------------------------------------------------------------\n\n");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (self::$printResultCounter == 0) {
|
if (self::$printResultCounter == 0) {
|
||||||
include "header.html";
|
include "header.html";
|
||||||
echo '
|
echo '
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ try {
|
|||||||
// 'saveToFile' method with proper file name.
|
// 'saveToFile' method with proper file name.
|
||||||
// This will save the image as /samples/invoice/images/sample.png
|
// This will save the image as /samples/invoice/images/sample.png
|
||||||
$path = $image->saveToFile("images/sample.png");
|
$path = $image->saveToFile("images/sample.png");
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex);
|
ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex);
|
||||||
@@ -39,4 +37,3 @@ try {
|
|||||||
// One of the ways, you could directly inject the base64-encoded string
|
// One of the ways, you could directly inject the base64-encoded string
|
||||||
// with proper image information in front of it.
|
// with proper image information in front of it.
|
||||||
echo '<img src="data:image/png;base64,'. $image->getImage() . '" alt="Invoice QR Code" />';
|
echo '<img src="data:image/png;base64,'. $image->getImage() . '" alt="Invoice QR Code" />';
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ use PayPal\Api\OpenIdTokeninfo;
|
|||||||
$refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE';
|
$refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$tokenInfo = new OpenIdTokeninfo();
|
$tokenInfo = new OpenIdTokeninfo();
|
||||||
$tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext);
|
$tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $ex);
|
ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $ex);
|
||||||
|
|||||||
@@ -21,13 +21,11 @@ use PayPal\Api\OpenIdUserinfo;
|
|||||||
$refreshToken = 'W1JmxG-Cogm-4aSc5Vlen37XaQTj74aQcQiTtXax5UgY7M_AJ--kLX8xNVk8LtCpmueFfcYlRK6UgQLJ-XHsxpw6kZzPpKKccRQeC4z2ldTMfXdIWajZ6CHuebs';
|
$refreshToken = 'W1JmxG-Cogm-4aSc5Vlen37XaQTj74aQcQiTtXax5UgY7M_AJ--kLX8xNVk8LtCpmueFfcYlRK6UgQLJ-XHsxpw6kZzPpKKccRQeC4z2ldTMfXdIWajZ6CHuebs';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$tokenInfo = new OpenIdTokeninfo();
|
$tokenInfo = new OpenIdTokeninfo();
|
||||||
$tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext);
|
$tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext);
|
||||||
|
|
||||||
$params = array('access_token' => $tokenInfo->getAccessToken());
|
$params = array('access_token' => $tokenInfo->getAccessToken());
|
||||||
$userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext);
|
$userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("User Information", "User Info", null, $params, $ex);
|
ResultPrinter::printError("User Information", "User Info", null, $params, $ex);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ session_start();
|
|||||||
// PayPal would redirect the user to the redirect_uri mentioned when creating the consent URL.
|
// PayPal would redirect the user to the redirect_uri mentioned when creating the consent URL.
|
||||||
// The user would then able to retrieve the access token by getting the code, which is returned as a GET parameter.
|
// The user would then able to retrieve the access token by getting the code, which is returned as a GET parameter.
|
||||||
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||||
|
|
||||||
$code = $_GET['code'];
|
$code = $_GET['code'];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -25,5 +24,4 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("Obtained Access Token", "Access Token", $accessToken->getAccessToken(), $_GET['code'], $accessToken);
|
ResultPrinter::printResult("Obtained Access Token", "Access Token", $accessToken->getAccessToken(), $_GET['code'], $accessToken);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,3 @@ try {
|
|||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getId(), $bodyReceived, $output);
|
ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getId(), $bodyReceived, $output);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ use PayPal\Api\Amount;
|
|||||||
use PayPal\Api\Authorization;
|
use PayPal\Api\Authorization;
|
||||||
use PayPal\Api\Capture;
|
use PayPal\Api\Capture;
|
||||||
|
|
||||||
|
|
||||||
// ### Capture Payment
|
// ### Capture Payment
|
||||||
// You can capture and process a previously created authorization
|
// You can capture and process a previously created authorization
|
||||||
// by invoking the $authorization->capture method
|
// by invoking the $authorization->capture method
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ try {
|
|||||||
// for payment approval
|
// for payment approval
|
||||||
// Please note that currently future payments works only with PayPal as a funding instrument.
|
// Please note that currently future payments works only with PayPal as a funding instrument.
|
||||||
$payment->create($apiContext, $clientMetadataId);
|
$payment->create($apiContext, $clientMetadataId);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Future Payment", "Payment", null, $payment, $ex);
|
ResultPrinter::printError("Future Payment", "Payment", null, $payment, $ex);
|
||||||
|
|||||||
@@ -82,8 +82,6 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment);
|
ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment);
|
||||||
|
|
||||||
return $payment;
|
return $payment;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
require 'CreatePayment.php';
|
require 'CreatePayment.php';
|
||||||
use PayPal\Api\Payment;
|
use PayPal\Api\Payment;
|
||||||
|
|
||||||
|
|
||||||
// ### Retrieve payment
|
// ### Retrieve payment
|
||||||
// Retrieve the PaymentHistory object by calling the
|
// Retrieve the PaymentHistory object by calling the
|
||||||
// static `get` method on the Payment class,
|
// static `get` method on the Payment class,
|
||||||
@@ -21,7 +20,6 @@ use PayPal\Api\Payment;
|
|||||||
// Refer the method doc for valid values for keys
|
// Refer the method doc for valid values for keys
|
||||||
// (See bootstrap.php for more on `ApiContext`)
|
// (See bootstrap.php for more on `ApiContext`)
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$params = array('count' => 10, 'start_index' => 5);
|
$params = array('count' => 10, 'start_index' => 5);
|
||||||
|
|
||||||
$payments = Payment::all($params, $apiContext);
|
$payments = Payment::all($params, $apiContext);
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ $payment = require __DIR__ . '/ExecutePayment.php';
|
|||||||
// ### Approval Status
|
// ### Approval Status
|
||||||
// Determine if the user approved the payment or not
|
// Determine if the user approved the payment or not
|
||||||
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||||
|
|
||||||
$transactions = $payment->getTransactions();
|
$transactions = $payment->getTransactions();
|
||||||
$transaction = $transactions[0];
|
$transaction = $transactions[0];
|
||||||
$relatedResources = $transaction->getRelatedResources();
|
$relatedResources = $transaction->getRelatedResources();
|
||||||
@@ -27,7 +26,6 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printResult("User Cancelled the Approval", null);
|
ResultPrinter::printResult("User Cancelled the Approval", null);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ use PayPal\Api\Authorization;
|
|||||||
// has expired.
|
// has expired.
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$amount = new Amount();
|
$amount = new Amount();
|
||||||
$amount->setCurrency("USD");
|
$amount->setCurrency("USD");
|
||||||
$amount->setTotal(1);
|
$amount->setTotal(1);
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ $patchRequest->setPatches(array($patchReplace, $patchAdd));
|
|||||||
// (See bootstrap.php for more on `ApiContext`)
|
// (See bootstrap.php for more on `ApiContext`)
|
||||||
try {
|
try {
|
||||||
$result = $createdPayment->update($patchRequest, $apiContext);
|
$result = $createdPayment->update($patchRequest, $apiContext);
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||||
ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex);
|
ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex);
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ $authorization = require 'AuthorizePayment.php';
|
|||||||
$authorizationId = '1BF65516U6866543H'; // $authorization->getId();
|
$authorizationId = '1BF65516U6866543H'; // $authorization->getId();
|
||||||
use PayPal\Api\Authorization;
|
use PayPal\Api\Authorization;
|
||||||
|
|
||||||
|
|
||||||
// ### VoidAuthorization
|
// ### VoidAuthorization
|
||||||
// You can void a previously authorized payment
|
// You can void a previously authorized payment
|
||||||
// by invoking the $authorization->void method
|
// by invoking the $authorization->void method
|
||||||
|
|||||||
@@ -70,6 +70,4 @@ class AddressTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getNormalizationStatus(), "TestSample");
|
$this->assertEquals($obj->getNormalizationStatus(), "TestSample");
|
||||||
$this->assertEquals($obj->getStatus(), "TestSample");
|
$this->assertEquals($obj->getStatus(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,4 @@ class AgreementStateDescriptorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getNote(), "TestSample");
|
$this->assertEquals($obj->getNote(), "TestSample");
|
||||||
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,5 +69,4 @@ class AgreementTransactionTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getTimeStamp(), "TestSample");
|
$this->assertEquals($obj->getTimeStamp(), "TestSample");
|
||||||
$this->assertEquals($obj->getTimeZone(), "TestSample");
|
$this->assertEquals($obj->getTimeZone(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,4 @@ class AgreementTransactionsTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getAgreementTransactionList(), AgreementTransactionTest::getObject());
|
$this->assertEquals($obj->getAgreementTransactionList(), AgreementTransactionTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,4 @@ class AlternatePaymentTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
||||||
$this->assertEquals($obj->getAlternatePaymentProviderId(), "TestSample");
|
$this->assertEquals($obj->getAlternatePaymentProviderId(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,4 @@ class AmountTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getTotal(), "12.34");
|
$this->assertEquals($obj->getTotal(), "12.34");
|
||||||
$this->assertEquals($obj->getDetails(), DetailsTest::getObject());
|
$this->assertEquals($obj->getDetails(), DetailsTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,4 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getValidUntil(), "TestSample");
|
$this->assertEquals($obj->getValidUntil(), "TestSample");
|
||||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,5 +55,4 @@ class BankAccountsListTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getCount(), 123);
|
$this->assertEquals($obj->getCount(), 123);
|
||||||
$this->assertEquals($obj->getNextId(), "TestSample");
|
$this->assertEquals($obj->getNextId(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,4 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
||||||
$this->assertEquals($obj->getMandateReferenceNumber(), "TestSample");
|
$this->assertEquals($obj->getMandateReferenceNumber(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,5 +67,4 @@ class BillingInfoTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getNotificationChannel(), "TestSample");
|
$this->assertEquals($obj->getNotificationChannel(), "TestSample");
|
||||||
$this->assertEquals($obj->getPhone(), PhoneTest::getObject());
|
$this->assertEquals($obj->getPhone(), PhoneTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,4 @@ class BillingTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getBillingAgreementId(), "TestSample");
|
$this->assertEquals($obj->getBillingAgreementId(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,5 +57,4 @@ class CancelNotificationTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getSendToMerchant(), true);
|
$this->assertEquals($obj->getSendToMerchant(), true);
|
||||||
$this->assertEquals($obj->getSendToPayer(), true);
|
$this->assertEquals($obj->getSendToPayer(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,4 @@ class CarrierAccountTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getPhoneSource(), "TestSample");
|
$this->assertEquals($obj->getPhoneSource(), "TestSample");
|
||||||
$this->assertEquals($obj->getCountryCode(), CountryCodeTest::getObject());
|
$this->assertEquals($obj->getCountryCode(), CountryCodeTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,4 @@ class CarrierAccountTokenTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getCarrierAccountId(), "TestSample");
|
$this->assertEquals($obj->getCarrierAccountId(), "TestSample");
|
||||||
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,5 +100,4 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj = new CartBase();
|
$obj = new CartBase();
|
||||||
$obj->setOrderUrl(null);
|
$obj->setOrderUrl(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,5 +55,4 @@ class ChargeModelTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getType(), "TestSample");
|
$this->assertEquals($obj->getType(), "TestSample");
|
||||||
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,4 @@ class CostTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getPercent(), "12.34");
|
$this->assertEquals($obj->getPercent(), "12.34");
|
||||||
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,4 @@ class CountryCodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getCountryCode(), "TestSample");
|
$this->assertEquals($obj->getCountryCode(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,4 @@ class CreateProfileResponseTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getId(), "TestSample");
|
$this->assertEquals($obj->getId(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ class CreditCardHistoryTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
$card = self::createCreditCard();
|
$card = self::createCreditCard();
|
||||||
$card->setBillingAddress(AddressTest::getObject());
|
$card->setBillingAddress(AddressTest::getObject());
|
||||||
$card->setLinks(array(LinksTest::getObject()));
|
$card->setLinks(array(LinksTest::getObject()));
|
||||||
|
|||||||
@@ -57,5 +57,4 @@ class CreditCardListTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getTotalItems(), 123);
|
$this->assertEquals($obj->getTotalItems(), 123);
|
||||||
$this->assertEquals($obj->getTotalPages(), 123);
|
$this->assertEquals($obj->getTotalPages(), 123);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,4 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getValidUntil(), "TestSample");
|
$this->assertEquals($obj->getValidUntil(), "TestSample");
|
||||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,4 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getExpireMonth(), 123);
|
$this->assertEquals($obj->getExpireMonth(), 123);
|
||||||
$this->assertEquals($obj->getExpireYear(), 123);
|
$this->assertEquals($obj->getExpireYear(), 123);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,4 @@ class CreditFinancingOfferedTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getPayerAcceptance(), true);
|
$this->assertEquals($obj->getPayerAcceptance(), true);
|
||||||
$this->assertEquals($obj->getCartAmountImmutable(), true);
|
$this->assertEquals($obj->getCartAmountImmutable(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,4 @@ class CreditTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getId(), "TestSample");
|
$this->assertEquals($obj->getId(), "TestSample");
|
||||||
$this->assertEquals($obj->getType(), "TestSample");
|
$this->assertEquals($obj->getType(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,5 +87,4 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj->setWebUrl(null);
|
$obj->setWebUrl(null);
|
||||||
$this->assertNull($obj->getWebUrl());
|
$this->assertNull($obj->getWebUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,4 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getCurrency(), "TestSample");
|
$this->assertEquals($obj->getCurrency(), "TestSample");
|
||||||
$this->assertEquals($obj->getValue(), "12.34");
|
$this->assertEquals($obj->getValue(), "12.34");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,4 @@ class CustomAmountTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getLabel(), "TestSample");
|
$this->assertEquals($obj->getLabel(), "TestSample");
|
||||||
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,4 @@ class DetailsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getGiftWrap(), "12.34");
|
$this->assertEquals($obj->getGiftWrap(), "12.34");
|
||||||
$this->assertEquals($obj->getFee(), "12.34");
|
$this->assertEquals($obj->getFee(), "12.34");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,4 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample");
|
$this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample");
|
||||||
$this->assertEquals($obj->getCode(), "TestSample");
|
$this->assertEquals($obj->getCode(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,4 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getDebugId(), "TestSample");
|
$this->assertEquals($obj->getDebugId(), "TestSample");
|
||||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,4 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getMandateReferenceNumber(), "TestSample");
|
$this->assertEquals($obj->getMandateReferenceNumber(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,4 @@ class ExternalFundingTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getDisplayText(), "TestSample");
|
$this->assertEquals($obj->getDisplayText(), "TestSample");
|
||||||
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
|
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,5 +64,4 @@ class FileAttachmentTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj = new FileAttachment();
|
$obj = new FileAttachment();
|
||||||
$obj->setUrl(null);
|
$obj->setUrl(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,5 +63,4 @@ class FlowConfigTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj = new FlowConfig();
|
$obj = new FlowConfig();
|
||||||
$obj->setBankTxnPendingUrl(null);
|
$obj->setBankTxnPendingUrl(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,4 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getName(), "TestSample");
|
$this->assertEquals($obj->getName(), "TestSample");
|
||||||
$this->assertEquals($obj->getDescription(), "TestSample");
|
$this->assertEquals($obj->getDescription(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,4 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getPaymentDebitDate(), "TestSample");
|
$this->assertEquals($obj->getPaymentDebitDate(), "TestSample");
|
||||||
$this->assertEquals($obj->getProcessingType(), "TestSample");
|
$this->assertEquals($obj->getProcessingType(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,4 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getBilling(), BillingTest::getObject());
|
$this->assertEquals($obj->getBilling(), BillingTest::getObject());
|
||||||
$this->assertEquals($obj->getAlternatePayment(), AlternatePaymentTest::getObject());
|
$this->assertEquals($obj->getAlternatePayment(), AlternatePaymentTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,4 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getInstallmentInfo(), InstallmentInfoTest::getObject());
|
$this->assertEquals($obj->getInstallmentInfo(), InstallmentInfoTest::getObject());
|
||||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,4 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject());
|
$this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject());
|
||||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,5 +61,4 @@ class HyperSchemaTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getPathStart(), "TestSample");
|
$this->assertEquals($obj->getPathStart(), "TestSample");
|
||||||
$this->assertEquals($obj->getMediaType(), "TestSample");
|
$this->assertEquals($obj->getMediaType(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,4 @@ class ImageTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getImage(), "TestSample");
|
$this->assertEquals($obj->getImage(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,5 +80,4 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj = new Incentive();
|
$obj = new Incentive();
|
||||||
$obj->setLogoImageUrl(null);
|
$obj->setLogoImageUrl(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,5 +55,4 @@ class InputFieldsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getNoShipping(), 123);
|
$this->assertEquals($obj->getNoShipping(), 123);
|
||||||
$this->assertEquals($obj->getAddressOverride(), 123);
|
$this->assertEquals($obj->getAddressOverride(), 123);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,4 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getIssuer(), "TestSample");
|
$this->assertEquals($obj->getIssuer(), "TestSample");
|
||||||
$this->assertEquals($obj->getInstallmentOptions(), InstallmentOptionTest::getObject());
|
$this->assertEquals($obj->getInstallmentOptions(), InstallmentOptionTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,4 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getDiscountAmount(), CurrencyTest::getObject());
|
$this->assertEquals($obj->getDiscountAmount(), CurrencyTest::getObject());
|
||||||
$this->assertEquals($obj->getDiscountPercentage(), "TestSample");
|
$this->assertEquals($obj->getDiscountPercentage(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,5 +63,4 @@ class InvoiceAddressTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getState(), "TestSample");
|
$this->assertEquals($obj->getState(), "TestSample");
|
||||||
$this->assertEquals($obj->getPhone(), PhoneTest::getObject());
|
$this->assertEquals($obj->getPhone(), PhoneTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,5 +77,4 @@ class InvoiceItemTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj = new InvoiceItem();
|
$obj = new InvoiceItem();
|
||||||
$obj->setImageUrl(null);
|
$obj->setImageUrl(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Test\Api;
|
namespace PayPal\Test\Api;
|
||||||
use PayPal\Api\InvoiceNumber;
|
|
||||||
|
|
||||||
|
use PayPal\Api\InvoiceNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Cost
|
* Class Cost
|
||||||
@@ -51,5 +51,4 @@ class InvoiceNumberTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$this->assertEquals($obj->getNumber(), "1234");
|
$this->assertEquals($obj->getNumber(), "1234");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,4 @@ class InvoiceSearchResponseTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getTotalCount(), 123);
|
$this->assertEquals($obj->getTotalCount(), 123);
|
||||||
$this->assertEquals($obj->getInvoices(), InvoiceTest::getObject());
|
$this->assertEquals($obj->getInvoices(), InvoiceTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,4 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getShippingMethod(), "TestSample");
|
$this->assertEquals($obj->getShippingMethod(), "TestSample");
|
||||||
$this->assertEquals($obj->getShippingPhoneNumber(), "TestSample");
|
$this->assertEquals($obj->getShippingPhoneNumber(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,5 +92,4 @@ class ItemTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj = new Item();
|
$obj = new Item();
|
||||||
$obj->setUrl(null);
|
$obj->setUrl(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,5 +61,4 @@ class LinksTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getEnctype(), "TestSample");
|
$this->assertEquals($obj->getEnctype(), "TestSample");
|
||||||
$this->assertEquals($obj->getSchema(), HyperSchemaTest::getObject());
|
$this->assertEquals($obj->getSchema(), HyperSchemaTest::getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,4 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getValue(), "TestSample");
|
$this->assertEquals($obj->getValue(), "TestSample");
|
||||||
$this->assertEquals($obj->getUnit(), "TestSample");
|
$this->assertEquals($obj->getUnit(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,5 +71,4 @@ class MerchantInfoTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getAdditionalInfoLabel(), "TestSample");
|
$this->assertEquals($obj->getAdditionalInfoLabel(), "TestSample");
|
||||||
$this->assertEquals($obj->getAdditionalInfo(), "TestSample");
|
$this->assertEquals($obj->getAdditionalInfo(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,5 +116,4 @@ class MerchantPreferencesTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj->setNotifyUrl(null);
|
$obj->setNotifyUrl(null);
|
||||||
$this->assertNull($obj->getNotifyUrl());
|
$this->assertNull($obj->getNotifyUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,5 +86,4 @@ class MetadataTest extends \PHPUnit_Framework_TestCase
|
|||||||
$obj->setPayer_view_url(null);
|
$obj->setPayer_view_url(null);
|
||||||
$this->assertNull($obj->getPayer_view_url());
|
$this->assertNull($obj->getPayer_view_url());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,4 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($obj->getName(), "TestSample");
|
$this->assertEquals($obj->getName(), "TestSample");
|
||||||
$this->assertEquals($obj->getValue(), "TestSample");
|
$this->assertEquals($obj->getValue(), "TestSample");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user