forked from LiveCarta/PayPal-PHP-SDK
Enabled Payment Experience
- Updated Api to enabled Payment Experience - Updated Tests and Samples - Added Json Validator - Ability for PPModel to return array of self objects
This commit is contained in:
43
lib/PayPal/Api/CreateProfileResponse.php
Normal file
43
lib/PayPal/Api/CreateProfileResponse.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class CreateProfileResponse
|
||||
*
|
||||
* Response schema for create profile api
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
*/
|
||||
class CreateProfileResponse extends PPModel
|
||||
{
|
||||
/**
|
||||
* ID of the payment web experience profile.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the payment web experience profile.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class FlowConfig
|
||||
*
|
||||
* Parameters for flow configuration.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string landing_page_type
|
||||
* @property string bank_txn_pending_url
|
||||
*/
|
||||
class FlowConfig extends PPModel {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string landing_page_type
|
||||
*/
|
||||
public function getLandingPageType() {
|
||||
return $this->landing_page_type;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string landing_page_type *
|
||||
*/
|
||||
|
||||
public function setLandingPageType($landing_page_type){
|
||||
$this->landing_page_type = $landing_page_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string bank_txn_pending_url
|
||||
*/
|
||||
public function getBankTxnPendingUrl() {
|
||||
return $this->bank_txn_pending_url;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string bank_txn_pending_url *
|
||||
*/
|
||||
|
||||
public function setBankTxnPendingUrl($bank_txn_pending_url){
|
||||
$this->bank_txn_pending_url = $bank_txn_pending_url;
|
||||
return $this;
|
||||
}
|
||||
class FlowConfig extends PPModel
|
||||
{
|
||||
/**
|
||||
* Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used.
|
||||
*
|
||||
*
|
||||
* @param string $landing_page_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLandingPageType($landing_page_type)
|
||||
{
|
||||
$this->landing_page_type = $landing_page_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLandingPageType()
|
||||
{
|
||||
return $this->landing_page_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used.
|
||||
*
|
||||
* @deprecated Instead use setLandingPageType
|
||||
*
|
||||
* @param string $landing_page_type
|
||||
* @return $this
|
||||
*/
|
||||
public function setLanding_page_type($landing_page_type)
|
||||
{
|
||||
$this->landing_page_type = $landing_page_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: `Billing` or `Login`. When set to `Billing`, the Non-PayPal account landing page is used. When set to `Login`, the PayPal account login landing page is used.
|
||||
* @deprecated Instead use getLandingPageType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanding_page_type()
|
||||
{
|
||||
return $this->landing_page_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL on the merchant site for transferring to after a bank transfer payment.
|
||||
*
|
||||
*
|
||||
* @param string $bank_txn_pending_url
|
||||
* @throws InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankTxnPendingUrl($bank_txn_pending_url)
|
||||
{
|
||||
UrlValidator::validate($bank_txn_pending_url, "BankTxnPendingUrl");
|
||||
$this->bank_txn_pending_url = $bank_txn_pending_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL on the merchant site for transferring to after a bank transfer payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBankTxnPendingUrl()
|
||||
{
|
||||
return $this->bank_txn_pending_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL on the merchant site for transferring to after a bank transfer payment.
|
||||
*
|
||||
* @deprecated Instead use setBankTxnPendingUrl
|
||||
*
|
||||
* @param string $bank_txn_pending_url
|
||||
* @return $this
|
||||
*/
|
||||
public function setBank_txn_pending_url($bank_txn_pending_url)
|
||||
{
|
||||
$this->bank_txn_pending_url = $bank_txn_pending_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL on the merchant site for transferring to after a bank transfer payment.
|
||||
* @deprecated Instead use getBankTxnPendingUrl
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBank_txn_pending_url()
|
||||
{
|
||||
return $this->bank_txn_pending_url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
@@ -7,62 +8,161 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class InputFields
|
||||
*
|
||||
* @property integer no_shipping
|
||||
* @property integer address_override
|
||||
* @property boolean allow-note
|
||||
* Parameters for input fields customization.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property bool allow_note
|
||||
* @property int no_shipping
|
||||
* @property int address_override
|
||||
*/
|
||||
class InputFields extends PPModel {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return integer no_shipping
|
||||
*/
|
||||
public function getNoShipping() {
|
||||
return $this->no_shipping;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param integer no_shipping *
|
||||
*/
|
||||
|
||||
public function setNoShipping($no_shipping){
|
||||
$this->no_shipping = $no_shipping;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return integer address_override
|
||||
*/
|
||||
public function getAddressOverride() {
|
||||
return $this->address_override;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param integer address_override *
|
||||
*/
|
||||
|
||||
public function setAddressOverride($address_override){
|
||||
$this->address_override = $address_override;
|
||||
return $this;
|
||||
}
|
||||
class InputFields extends PPModel
|
||||
{
|
||||
/**
|
||||
* Enables the buyer to enter a note to the merchant on the PayPal page during checkout.
|
||||
*
|
||||
*
|
||||
* @param bool $allow_note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowNote($allow_note)
|
||||
{
|
||||
$this->allow_note = $allow_note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the buyer to enter a note to the merchant on the PayPal page during checkout.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getAllowNote()
|
||||
{
|
||||
return $this->allow_note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the buyer to enter a note to the merchant on the PayPal page during checkout.
|
||||
*
|
||||
* @deprecated Instead use setAllowNote
|
||||
*
|
||||
* @param bool $allow_note
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllow_note($allow_note)
|
||||
{
|
||||
$this->allow_note = $allow_note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the buyer to enter a note to the merchant on the PayPal page during checkout.
|
||||
* @deprecated Instead use getAllowNote
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getAllow_note()
|
||||
{
|
||||
return $this->allow_note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`.
|
||||
*
|
||||
*
|
||||
* @param int $no_shipping
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNoShipping($no_shipping)
|
||||
{
|
||||
$this->no_shipping = $no_shipping;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getNoShipping()
|
||||
{
|
||||
return $this->no_shipping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`.
|
||||
*
|
||||
* @deprecated Instead use setNoShipping
|
||||
*
|
||||
* @param int $no_shipping
|
||||
* @return $this
|
||||
*/
|
||||
public function setNo_shipping($no_shipping)
|
||||
{
|
||||
$this->no_shipping = $no_shipping;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal displays the shipping address on the PayPal pages. When set to `1`, PayPal does not display shipping address fields whatsoever. When set to `2`, if you do not pass the shipping address, PayPal obtains it from the buyer's account profile. For digital goods, this field is required, and you must set it to `1`.
|
||||
* @deprecated Instead use getNoShipping
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getNo_shipping()
|
||||
{
|
||||
return $this->no_shipping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address.
|
||||
*
|
||||
*
|
||||
* @param int $address_override
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAddressOverride($address_override)
|
||||
{
|
||||
$this->address_override = $address_override;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAddressOverride()
|
||||
{
|
||||
return $this->address_override;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address.
|
||||
*
|
||||
* @deprecated Instead use setAddressOverride
|
||||
*
|
||||
* @param int $address_override
|
||||
* @return $this
|
||||
*/
|
||||
public function setAddress_override($address_override)
|
||||
{
|
||||
$this->address_override = $address_override;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: `0` or `1`. When set to `0`, the PayPal pages should not display the shipping address. When set to `1`, the PayPal pages should display the shipping address.
|
||||
* @deprecated Instead use getAddressOverride
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAddress_override()
|
||||
{
|
||||
return $this->address_override;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return boolean allow_note
|
||||
*/
|
||||
public function getAllowNote() {
|
||||
return $this->allow_note;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param boolean allow_note *
|
||||
*/
|
||||
|
||||
public function setAllowNote($allow_note){
|
||||
$this->allow_note = $allow_note;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
118
lib/PayPal/Api/Patch.php
Normal file
118
lib/PayPal/Api/Patch.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Patch
|
||||
*
|
||||
* A JSON patch object used for applying partial updates to resources.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string op
|
||||
* @property string path
|
||||
* @property \PayPal\Api\object value
|
||||
* @property string from
|
||||
*/
|
||||
class Patch extends PPModel
|
||||
{
|
||||
/**
|
||||
* The operation to perform.
|
||||
* Valid Values: ["add", "remove", "replace", "move", "copy", "test"]
|
||||
*
|
||||
* @param string $op
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOp($op)
|
||||
{
|
||||
$this->op = $op;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The operation to perform.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOp()
|
||||
{
|
||||
return $this->op;
|
||||
}
|
||||
|
||||
/**
|
||||
* String containing a JSON-Pointer value that references a location within the target document where the operation is performed.
|
||||
*
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* String containing a JSON-Pointer value that references a location within the target document where the operation is performed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
* New value to apply based on the operation. op=remove does not require value.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\object $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* New value to apply based on the operation. op=remove does not require value.
|
||||
*
|
||||
* @return \PayPal\Api\object
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string containing a JSON Pointer value that references the location in the target document from which to move the value. Required for use where op=move.
|
||||
*
|
||||
*
|
||||
* @param string $from
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFrom($from)
|
||||
{
|
||||
$this->from = $from;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string containing a JSON Pointer value that references the location in the target document from which to move the value. Required for use where op=move.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFrom()
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -374,7 +374,6 @@ class Payment extends PPModel implements IResource
|
||||
public function setExperienceProfileId($experience_profile_id)
|
||||
{
|
||||
$this->experience_profile_id = $experience_profile_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
@@ -7,62 +8,161 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Presentation
|
||||
*
|
||||
* Parameters for style and presentation.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string brand_name
|
||||
* @property string logo_image
|
||||
* @property string locale_code
|
||||
*/
|
||||
class Presentation extends PPModel {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string brand_name
|
||||
*/
|
||||
public function getBrandName() {
|
||||
return $this->brand_name;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string brand_name *
|
||||
*/
|
||||
|
||||
public function setBrandName($brand_name){
|
||||
$this->brand_name = $brand_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string logo_image
|
||||
*/
|
||||
public function getLogoImage() {
|
||||
return $this->logo_image;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string logo_image *
|
||||
*/
|
||||
|
||||
public function setLogoImage($logo_image){
|
||||
$this->logo_image = $logo_image;
|
||||
return $this;
|
||||
}
|
||||
class Presentation extends PPModel
|
||||
{
|
||||
/**
|
||||
* A label that overrides the business name in the PayPal account on the PayPal pages.
|
||||
*
|
||||
*
|
||||
* @param string $brand_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBrandName($brand_name)
|
||||
{
|
||||
$this->brand_name = $brand_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A label that overrides the business name in the PayPal account on the PayPal pages.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrandName()
|
||||
{
|
||||
return $this->brand_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* A label that overrides the business name in the PayPal account on the PayPal pages.
|
||||
*
|
||||
* @deprecated Instead use setBrandName
|
||||
*
|
||||
* @param string $brand_name
|
||||
* @return $this
|
||||
*/
|
||||
public function setBrand_name($brand_name)
|
||||
{
|
||||
$this->brand_name = $brand_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A label that overrides the business name in the PayPal account on the PayPal pages.
|
||||
* @deprecated Instead use getBrandName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand_name()
|
||||
{
|
||||
return $this->brand_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`.
|
||||
*
|
||||
*
|
||||
* @param string $logo_image
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLogoImage($logo_image)
|
||||
{
|
||||
$this->logo_image = $logo_image;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogoImage()
|
||||
{
|
||||
return $this->logo_image;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`.
|
||||
*
|
||||
* @deprecated Instead use setLogoImage
|
||||
*
|
||||
* @param string $logo_image
|
||||
* @return $this
|
||||
*/
|
||||
public function setLogo_image($logo_image)
|
||||
{
|
||||
$this->logo_image = $logo_image;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URL to logo image. Allowed vaues: `.gif`, `.jpg`, or `.png`.
|
||||
* @deprecated Instead use getLogoImage
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogo_image()
|
||||
{
|
||||
return $this->logo_image;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale of pages displayed by PayPal payment experience.
|
||||
*
|
||||
*
|
||||
* @param string $locale_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLocaleCode($locale_code)
|
||||
{
|
||||
$this->locale_code = $locale_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale of pages displayed by PayPal payment experience.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocaleCode()
|
||||
{
|
||||
return $this->locale_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale of pages displayed by PayPal payment experience.
|
||||
*
|
||||
* @deprecated Instead use setLocaleCode
|
||||
*
|
||||
* @param string $locale_code
|
||||
* @return $this
|
||||
*/
|
||||
public function setLocale_code($locale_code)
|
||||
{
|
||||
$this->locale_code = $locale_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale of pages displayed by PayPal payment experience.
|
||||
* @deprecated Instead use getLocaleCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocale_code()
|
||||
{
|
||||
return $this->locale_code;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string locale_code
|
||||
*/
|
||||
public function getLocaleCode() {
|
||||
return $this->logo_image;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string locale_code *
|
||||
*/
|
||||
|
||||
public function setLocaleCode($locale_code){
|
||||
$this->locale_code = $locale_code;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,46 +5,58 @@ namespace PayPal\Api;
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\CreateProfileResponse;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class WebProfile
|
||||
*
|
||||
* @property string id
|
||||
* @property string name
|
||||
* @property InputFields input_fields
|
||||
* @property FlowConfig flow_config
|
||||
* @property Presentation presentation
|
||||
* Payment Web experience profile resource
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string name
|
||||
* @property \PayPal\Api\FlowConfig flow_config
|
||||
* @property \PayPal\Api\InputFields input_fields
|
||||
* @property \PayPal\Api\Presentation presentation
|
||||
*/
|
||||
class WebProfile extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private static $credential;
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->input_fields = new InputFields();
|
||||
}
|
||||
//private $input_fields = array();
|
||||
/**
|
||||
* Set ID
|
||||
* ID of the web experience profile.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* ID of the web experience profile.
|
||||
*
|
||||
* @return string
|
||||
@@ -55,22 +67,20 @@ class WebProfile extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* Name of the web experience profile.
|
||||
*
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* Name of the web experience profile.
|
||||
*
|
||||
* @return string
|
||||
@@ -80,144 +90,243 @@ class WebProfile extends PPModel implements IResource
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parameters for flow configuration.
|
||||
*
|
||||
*
|
||||
* @param InputFields $input_fields
|
||||
* @param \PayPal\Api\FlowConfig $flow_config
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInputFields($input_fields) {
|
||||
$this->input_fields = $input_fields;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return InputFields
|
||||
*/
|
||||
public function getInputFields() {
|
||||
return $this->input_fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param FlowConfig $flow_config
|
||||
*/
|
||||
public function setFlowConfig($flow_config) {
|
||||
public function setFlowConfig($flow_config)
|
||||
{
|
||||
$this->flow_config = $flow_config;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for flow configuration.
|
||||
*
|
||||
* @return FlowConfig
|
||||
* @return \PayPal\Api\FlowConfig
|
||||
*/
|
||||
public function getFlowConfig() {
|
||||
public function getFlowConfig()
|
||||
{
|
||||
return $this->flow_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for flow configuration.
|
||||
*
|
||||
* @deprecated Instead use setFlowConfig
|
||||
*
|
||||
* @param \PayPal\Api\FlowConfig $flow_config
|
||||
* @return $this
|
||||
*/
|
||||
public function setFlow_config($flow_config)
|
||||
{
|
||||
$this->flow_config = $flow_config;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for flow configuration.
|
||||
* @deprecated Instead use getFlowConfig
|
||||
*
|
||||
* @param Presentation $presentation
|
||||
* @return \PayPal\Api\FlowConfig
|
||||
*/
|
||||
public function setPresentation($presentation) {
|
||||
public function getFlow_config()
|
||||
{
|
||||
return $this->flow_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for input fields customization.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\InputFields $input_fields
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInputFields($input_fields)
|
||||
{
|
||||
$this->input_fields = $input_fields;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for input fields customization.
|
||||
*
|
||||
* @return \PayPal\Api\InputFields
|
||||
*/
|
||||
public function getInputFields()
|
||||
{
|
||||
return $this->input_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for input fields customization.
|
||||
*
|
||||
* @deprecated Instead use setInputFields
|
||||
*
|
||||
* @param \PayPal\Api\InputFields $input_fields
|
||||
* @return $this
|
||||
*/
|
||||
public function setInput_fields($input_fields)
|
||||
{
|
||||
$this->input_fields = $input_fields;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for input fields customization.
|
||||
* @deprecated Instead use getInputFields
|
||||
*
|
||||
* @return \PayPal\Api\InputFields
|
||||
*/
|
||||
public function getInput_fields()
|
||||
{
|
||||
return $this->input_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for style and presentation.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Presentation $presentation
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPresentation($presentation)
|
||||
{
|
||||
$this->presentation = $presentation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for style and presentation.
|
||||
*
|
||||
* @return Presentation
|
||||
* @return \PayPal\Api\Presentation
|
||||
*/
|
||||
public function getPresentation() {
|
||||
public function getPresentation()
|
||||
{
|
||||
return $this->presentation;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create
|
||||
* Create a web experience profile by passing the name of the profile and other profile details in the request JSON to the request URI.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return $this
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return CreateProfileResponse
|
||||
*/
|
||||
public function create($apiContext = null)
|
||||
{
|
||||
|
||||
$payLoad = $this->toJSON();
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
|
||||
return $this;
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/", "POST", $payLoad);
|
||||
$ret = new CreateProfileResponse();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a web experience profile by passing the ID of the profile to the request URI. In addition, pass the profile details in the request JSON. If your request does not include values for all profile detail fields, the previously set values for the omitted fields are removed by this operation.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return bool
|
||||
*/
|
||||
public function update($apiContext = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$payLoad = $this->toJSON();
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
|
||||
$call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/".$this->getId(), "PUT", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete WebProfile resource for the given identifier.
|
||||
*
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function delete($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/{$this->getId()}", "DELETE", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/{$this->getId()}", "PUT", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all webProfiles of a merchant.
|
||||
* Partially update an existing web experience profile by passing the ID of the profile to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, path of the profile location to update, and a new value if needed to complete the operation.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return WebProfiles
|
||||
* @param Patch[] $patch
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return bool
|
||||
*/
|
||||
public static function get_all($apiContext = null)
|
||||
public function partial_update($patch, $apiContext = null)
|
||||
{
|
||||
$payLoad = "";
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($patch, 'patch');
|
||||
foreach ($patch as $patchObject) {
|
||||
$payload[] = $patchObject->toArray();
|
||||
}
|
||||
|
||||
$payLoad = json_encode($payload);
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles", "GET", $payLoad);
|
||||
$json = '{"web_profiles":'.$json.'}';
|
||||
|
||||
$ret = new WebProfiles();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/{$this->getId()}", "PATCH", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the details of a particular web experience profile by passing the ID of the profile to the request URI.
|
||||
*
|
||||
* @param string $profileId
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return WebProfile
|
||||
*/
|
||||
public static function get($profileId, $apiContext = null)
|
||||
{
|
||||
ArgumentValidator::validate($profileId, 'profileId');
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/$profileId", "GET", $payLoad);
|
||||
$ret = new WebProfile();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all web experience profiles that exist for a merchant (or subject).
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return WebProfile[]
|
||||
*/
|
||||
public static function get_list($apiContext = null)
|
||||
{
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/", "GET", $payLoad);
|
||||
return WebProfile::getList($json);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an existing web experience profile by passing the profile ID to the request URI.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($apiContext = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payment-experience/web-profiles/{$this->getId()}", "DELETE", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class WebProfiles
|
||||
*
|
||||
* @property array|\PayPal\Api\WebProfile $web_profiles
|
||||
*/
|
||||
class WebProfiles extends PPModel {
|
||||
/**
|
||||
* List of WebProfiles belonging to a merchant.
|
||||
*
|
||||
* @param array|\PayPal\Api\WebProfile $web_profiles
|
||||
*/
|
||||
public function setWebProfiles($web_profiles) {
|
||||
$this->web_profiles = $web_profiles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of web profiles belonging to a merchant.
|
||||
*
|
||||
* @return \PayPal\Api\WebProfile
|
||||
*/
|
||||
public function getWebProfiles() {
|
||||
return $this->web_profiles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Common;
|
||||
use PayPal\Validation\JsonValidator;
|
||||
use PayPal\Validation\ModelAccessorValidator;
|
||||
|
||||
/**
|
||||
@@ -28,9 +29,7 @@ class PPModel
|
||||
case "NULL":
|
||||
break;
|
||||
case "string":
|
||||
if (!$this->isJson($data)) {
|
||||
throw new \InvalidArgumentException("data should be either json or array representation of object");
|
||||
}
|
||||
JsonValidator::validate($data);
|
||||
$this->fromJson($data);
|
||||
break;
|
||||
case "array":
|
||||
@@ -41,15 +40,28 @@ class PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the string provided is json representation or not.
|
||||
* Returns a list of Object from Array or Json String. It is generally used when you json
|
||||
* contains an array of this object
|
||||
*
|
||||
* @param $string
|
||||
* @return bool
|
||||
* @param mixed $data Array object or json string representation
|
||||
* @return array
|
||||
*/
|
||||
private function isJson($string)
|
||||
public static function getList($data)
|
||||
{
|
||||
json_decode($string);
|
||||
return (json_last_error() == JSON_ERROR_NONE);
|
||||
if (!is_array($data) && JsonValidator::validate($data)) {
|
||||
//Convert to Array if Json Data Sent
|
||||
$data = json_decode($data, true);
|
||||
}
|
||||
if (!PPArrayUtil::isAssocArray($data)) {
|
||||
$list = array();
|
||||
//This means, root element is array
|
||||
foreach ($data as $k => $v) {
|
||||
$obj = new static;
|
||||
$obj->fromArray($v);
|
||||
$list[] = $obj;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,16 +151,14 @@ class PPModel
|
||||
*/
|
||||
public function fromArray($arr)
|
||||
{
|
||||
|
||||
foreach ($arr as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$clazz = PPReflectionUtil::getPropertyClass(get_class($this), $k);
|
||||
|
||||
if (PPArrayUtil::isAssocArray($v)) {
|
||||
/** @var self $o */
|
||||
$o = new $clazz();
|
||||
$o->fromArray($v);
|
||||
$this->__set($k, $o);
|
||||
$this->setValue($k, $o);
|
||||
} else {
|
||||
$arr = array();
|
||||
foreach ($v as $nk => $nv) {
|
||||
@@ -160,15 +170,25 @@ class PPModel
|
||||
$arr[$nk] = $nv;
|
||||
}
|
||||
}
|
||||
$this->__set($k, $arr);
|
||||
$this->setValue($k, $arr);
|
||||
}
|
||||
} else {
|
||||
$this->$k = $v;
|
||||
$this->$k = $v;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setValue($key, $value)
|
||||
{
|
||||
if (ModelAccessorValidator::validate($this, $this->convertToCamelCase($key))) {
|
||||
$setter = "set" . $this->convertToCamelCase($key);
|
||||
$this->$setter($value);
|
||||
} else {
|
||||
$this->__set($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills object value from Json string
|
||||
*
|
||||
@@ -200,4 +220,4 @@ class PPModel
|
||||
{
|
||||
return json_encode($this->toArray(), $options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,8 @@ class PPCredentialManager
|
||||
}
|
||||
|
||||
if (empty($credObj)) {
|
||||
throw new PPInvalidCredentialException("Invalid userId $userId");
|
||||
throw new PPInvalidCredentialException("Credential not found for " . ($userId ? $userId : " default user") .
|
||||
". Please make sure your configuration/APIContext has credential information");
|
||||
}
|
||||
return $credObj;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ class PPHttpConnection
|
||||
curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl());
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders());
|
||||
|
||||
//Determine Curl Options based on Method
|
||||
switch ($this->httpConfig->getMethod()) {
|
||||
case 'POST':
|
||||
@@ -101,6 +100,7 @@ class PPHttpConnection
|
||||
//Default Option if Method not of given types in switch case
|
||||
if ($this->httpConfig->getMethod() != NULL) {
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod());
|
||||
$this->logger->info("Method : " . $this->httpConfig->getMethod());
|
||||
}
|
||||
|
||||
//Logging Each Headers for debugging purposes
|
||||
@@ -142,10 +142,8 @@ class PPHttpConnection
|
||||
curl_close($ch);
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
//Close the curl request
|
||||
curl_close($ch);
|
||||
|
||||
//More Exceptions based on HttpStatus Code
|
||||
if (in_array($httpStatus, self::$retryCodes)) {
|
||||
$ex = new PPConnectionException(
|
||||
@@ -158,7 +156,8 @@ class PPHttpConnection
|
||||
} else if ($httpStatus < 200 || $httpStatus >= 300) {
|
||||
$ex = new PPConnectionException(
|
||||
$this->httpConfig->getUrl(),
|
||||
"Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}."
|
||||
"Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}.",
|
||||
$httpStatus
|
||||
);
|
||||
$ex->setData($result);
|
||||
throw $ex;
|
||||
|
||||
28
lib/PayPal/Validation/JsonValidator.php
Normal file
28
lib/PayPal/Validation/JsonValidator.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Validation;
|
||||
|
||||
/**
|
||||
* Class JsonValidator
|
||||
*
|
||||
* @package PayPal\Validation
|
||||
*/
|
||||
class JsonValidator
|
||||
{
|
||||
|
||||
/**
|
||||
* Helper method for validating if string provided is a valid json.
|
||||
*
|
||||
* @param string $string String representation of Json object
|
||||
* @return bool
|
||||
*/
|
||||
public static function validate($string)
|
||||
{
|
||||
json_decode($string);
|
||||
if (json_last_error() != JSON_ERROR_NONE) {
|
||||
//Throw an Exception for string or array
|
||||
throw new \InvalidArgumentException("Invalid JSON String");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user