Skip to content

Commit

Permalink
Merge pull request #119 from anouarabdsslm/remove_global_definition
Browse files Browse the repository at this point in the history
Remove un-needed definition
  • Loading branch information
anouarabdsslm authored Oct 28, 2017
2 parents 4206b62 + 6d9e0ba commit f25f733
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions src/Anouar/Paypalpayment/PaypalPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
use PayPal\Rest\ApiContext;
use PayPal\Auth\OAuthTokenCredential;

class PaypalPayment{
class PaypalPayment
{


/**
Expand All @@ -51,167 +52,167 @@ public function amount()
/**
* @return \PayPal\Api\Details
*/
public function details()
public function details()
{
return new Details;
}

/**
* @return \PayPal\Api\Authorization
*/
public function authorization()
public function authorization()
{
return new Authorization;
}

/**
* @return \PayPal\Api\Capture
*/
public function capture()
public function capture()
{
return new Capture;
}

/**
* @return \PayPal\Api\CreditCard
*/
public function creditCard()
public function creditCard()
{
return new CreditCard;
}

/**
* @return \PayPal\Api\CreditCardToken
*/
public function creditCardToken()
public function creditCardToken()
{
return new CreditCardToken;
}

/**
* @return \PayPal\Api\FundingInstrument
*/
public function fundingInstrument()
public function fundingInstrument()
{
return new FundingInstrument;
}

/**
* @return \PayPal\Api\Item
*/
public function item()
public function item()
{
return new Item;
}

/**
* @return \PayPal\Api\ItemList
*/
public function itemList()
public function itemList()
{
return new ItemList;
}

/**
* @return \PayPal\Api\Links
*/
public function links()
public function links()
{
return new Links;
}

/**
* @return \PayPal\Api\Payee
*/
public function payee()
public function payee()
{
return new Payee;
}

/**
* @return \PayPal\Api\Payer
*/
public function payer()
public function payer()
{
return new Payer;
}

/**
* @return \PayPal\Api\PayerInfo
*/
public function payerInfo()
public function payerInfo()
{
return new PayerInfo;
}

/**
* @return \PayPal\Api\Payment
*/
public function payment()
public function payment()
{
return new Payment;
}

/**
* @return \PayPal\Api\PaymentExecution
*/
public function paymentExecution()
public function paymentExecution()
{
return new PaymentExecution;
}

/**
* @return \PayPal\Api\PaymentHistory
*/
public function paymentHistory()
public function paymentHistory()
{
return new PaymentHistory;
}

/**
* @return \PayPal\Api\RedirectUrls
*/
public function redirectUrls()
public function redirectUrls()
{
return new RedirectUrls;
}

/**
* @return \PayPal\Api\Refund
*/
public function refund()
public function refund()
{
return new Refund;
}

/**
* @return \PayPal\Api\RelatedResources
*/
public function relatedResources()
public function relatedResources()
{
return new RelatedResources;
}

/**
* @return \PayPal\Api\Sale
*/
public function sale()
public function sale()
{
return new Sale;
}

/**
* @return \PayPal\Api\ShippingAddress
*/
public function shippingAddress()
public function shippingAddress()
{
return new ShippingAddress;
}

/**
* @return \PayPal\Api\Transactions
*/
public function transactions()
public function transactions()
{
return new Transactions;
}
Expand Down Expand Up @@ -243,12 +244,10 @@ public function apiContext($clientId = null, $clientSecret = null, $requestId =
* @param null $ClientSecret
* @return PayPal/Auth/OAuthTokenCredential
*/
public static function OAuthTokenCredential($ClientId = null, $ClientSecret=null)
public static function OAuthTokenCredential($ClientId = null, $ClientSecret=null)
{
define("PP_CONFIG_PATH", __DIR__);

if(isset($ClientId) && isset($ClientSecret)) {
return new OAuthTokenCredential($ClientId, $ClientSecret);
if (isset($ClientId) && isset($ClientSecret)) {
return new OAuthTokenCredential($ClientId, $ClientSecret);
}

$configManager = PayPalConfigManager::getInstance();
Expand All @@ -262,11 +261,12 @@ public static function OAuthTokenCredential($ClientId = null, $ClientSecret=nul

$cred = new OAuthTokenCredential(
$configManager->get('acct1.ClientId'),
$configManager->get('acct1.ClientSecret'));
$configManager->get('acct1.ClientSecret')
);

return $cred;
}

/**
* Get the base URL
* @return mixed
Expand Down Expand Up @@ -303,5 +303,4 @@ public static function getAll($param, $apiContext = null)
}
return Payment::all($param);
}

}

0 comments on commit f25f733

Please sign in to comment.