diff --git a/lib/PayPal/Api/FlowConfig.php b/lib/PayPal/Api/FlowConfig.php new file mode 100644 index 0000000..7fba2d8 --- /dev/null +++ b/lib/PayPal/Api/FlowConfig.php @@ -0,0 +1,52 @@ +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; + } + + +} diff --git a/lib/PayPal/Api/InputFields.php b/lib/PayPal/Api/InputFields.php new file mode 100644 index 0000000..85d8c38 --- /dev/null +++ b/lib/PayPal/Api/InputFields.php @@ -0,0 +1,68 @@ +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; + } + + /** + * + * @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; + } +} diff --git a/lib/PayPal/Api/Payment.php b/lib/PayPal/Api/Payment.php index 6e6edde..ae53471 100644 --- a/lib/PayPal/Api/Payment.php +++ b/lib/PayPal/Api/Payment.php @@ -26,6 +26,7 @@ use PayPal\Validation\ArgumentValidator; * @property string state * @property \PayPal\Api\RedirectUrls redirect_urls * @property \PayPal\Api\Links links + * @property string experience_profile_id */ class Payment extends PPModel implements IResource { @@ -49,10 +50,10 @@ class Payment extends PPModel implements IResource /** * Identifier of the payment resource created. - * + * * * @param string $id - * + * * @return $this */ public function setId($id) @@ -73,10 +74,10 @@ class Payment extends PPModel implements IResource /** * Time the resource was created in UTC ISO8601 format. - * + * * * @param string $create_time - * + * * @return $this */ public function setCreateTime($create_time) @@ -122,10 +123,10 @@ class Payment extends PPModel implements IResource /** * Time the resource was last updated in UTC ISO8601 format. - * + * * * @param string $update_time - * + * * @return $this */ public function setUpdateTime($update_time) @@ -171,10 +172,10 @@ class Payment extends PPModel implements IResource /** * Intent of the payment - Sale or Authorization or Order. - * Valid Values: ["sale", "authorize", "order"] + * Valid Values: ["sale", "authorize", "order"] * * @param string $intent - * + * * @return $this */ public function setIntent($intent) @@ -195,10 +196,10 @@ class Payment extends PPModel implements IResource /** * Source of the funds for this payment represented by a PayPal account or a direct credit card. - * + * * * @param \PayPal\Api\Payer $payer - * + * * @return $this */ public function setPayer($payer) @@ -219,10 +220,10 @@ class Payment extends PPModel implements IResource /** * Cart for which the payment is done. - * + * * * @param \PayPal\Api\object $cart - * + * * @return $this */ public function setCart($cart) @@ -243,10 +244,10 @@ class Payment extends PPModel implements IResource /** * A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee - * + * * * @param \PayPal\Api\Transaction $transactions - * + * * @return $this */ public function setTransactions($transactions) @@ -267,10 +268,10 @@ class Payment extends PPModel implements IResource /** * state of the payment - * Valid Values: ["created", "approved", "failed", "canceled", "expired"] + * Valid Values: ["created", "approved", "failed", "canceled", "expired"] * * @param string $state - * + * * @return $this */ public function setState($state) @@ -291,10 +292,10 @@ class Payment extends PPModel implements IResource /** * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. - * + * * * @param \PayPal\Api\RedirectUrls $redirect_urls - * + * * @return $this */ public function setRedirectUrls($redirect_urls) @@ -340,10 +341,10 @@ class Payment extends PPModel implements IResource /** * Sets Links - * + * * * @param \PayPal\Api\Links $links - * + * * @return $this */ public function setLinks($links) @@ -362,6 +363,32 @@ class Payment extends PPModel implements IResource return $this->links; } + /** + * Set Experience_profile_id + * experience_profile_id of the payment + * + * @param string $experience_profile_id + * + * @return $this + */ + public function setExperienceProfileId($experience_profile_id) + { + $this->experience_profile_id = $experience_profile_id; + + return $this; + } + + /** + * Get Experience_profile_id + * Experience_profile_id of the payment + * + * @return string + */ + public function getExperienceProfileId() + { + return $this->experience_profile_id; + } + /** * Creates (and processes) a new Payment Resource. * @@ -438,14 +465,14 @@ class Payment extends PPModel implements IResource $payLoad = ""; $allowedParams = array( - 'count' => 1, - 'start_id' => 1, - 'start_index' => 1, - 'start_time' => 1, - 'end_time' => 1, - 'payee_id' => 1, - 'sort_by' => 1, - 'sort_order' => 1, + 'count' => 1, + 'start_id' => 1, + 'start_index' => 1, + 'start_time' => 1, + 'end_time' => 1, + 'payee_id' => 1, + 'sort_by' => 1, + 'sort_order' => 1, ); if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); @@ -457,4 +484,5 @@ class Payment extends PPModel implements IResource return $ret; } + } diff --git a/lib/PayPal/Api/Presentation.php b/lib/PayPal/Api/Presentation.php new file mode 100644 index 0000000..534a0c4 --- /dev/null +++ b/lib/PayPal/Api/Presentation.php @@ -0,0 +1,68 @@ +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; + } + + /** + * + * @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; + } +} diff --git a/lib/PayPal/Api/WebProfile.php b/lib/PayPal/Api/WebProfile.php new file mode 100644 index 0000000..b32467d --- /dev/null +++ b/lib/PayPal/Api/WebProfile.php @@ -0,0 +1,223 @@ +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 + */ + public function getId() + { + return $this->id; + } + + /** + * 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 + */ + public function getName() + { + return $this->name; + } + + + + + /** + * + * @param InputFields $input_fields + */ + 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) { + $this->flow_config = $flow_config; + return $this; + } + + /** + * + * @return FlowConfig + */ + public function getFlowConfig() { + return $this->flow_config; + } + + + /** + * + * @param Presentation $presentation + */ + public function setPresentation($presentation) { + $this->presentation = $presentation; + return $this; + } + + /** + * + * @return Presentation + */ + public function getPresentation() { + return $this->presentation; + } + + + /** + * Create + * + * @param \PayPal\Rest\ApiContext|null $apiContext + * + * @return $this + */ + 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; + } + + public function update($apiContext = null) + { + $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); + return true; + } + + /** + * Get all webProfiles of a merchant. + * + * @param \PayPal\Rest\ApiContext|null $apiContext + * + * @return WebProfiles + */ + public static function get_all($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); + $json = '{"web_profiles":'.$json.'}'; + + $ret = new WebProfiles(); + $ret->fromJson($json); + return $ret; + + } + + + +} diff --git a/lib/PayPal/Api/WebProfiles.php b/lib/PayPal/Api/WebProfiles.php new file mode 100644 index 0000000..0523ab2 --- /dev/null +++ b/lib/PayPal/Api/WebProfiles.php @@ -0,0 +1,37 @@ +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; + } + + + + + + +}