for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PaymentGateway\PayPalSdk\Requests;
use PaymentGateway\PayPalSdk\Requests\Concerns\HasDescription;
use PaymentGateway\PayPalSdk\Subscriptions\Concerns\HasPaymentPreferences;
class UpdatePlanRequest
{
use HasDescription;
use HasPaymentPreferences;
protected string $id;
public function __construct(string $id)
$this->id = $id;
}
public function getId(): string
return $this->id;
public function toArray(): array
$request = [];
if ($this->description ?? null) {
$request[] = [
'op' => 'replace',
'path' => '/description',
'value' => $this->description
];
if ($this->paymentPreferences ?? null) {
'path' => '/payment_preferences/auto_bill_outstanding',
'value' => $this->paymentPreferences->isAutoBillOutstanding()
'path' => '/payment_preferences/payment_failure_threshold',
'value' => $this->paymentPreferences->getPaymentFailureThreshold()
'path' => '/payment_preferences/setup_fee_failure_action',
'value' => $this->paymentPreferences->getSetupFeeFailureAction()
'path' => '/payment_preferences/setup_fee',
'value' => $this->paymentPreferences->getSetupFee()->toArray()
return $request;