Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYSHIP-2631 PayPal Create Order Request DTO #1186

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Cart/CartInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace PrestaShop\Module\PrestashopCheckout\Cart;

use PrestaShop\Module\PrestashopCheckout\DTO\Orders\PurchaseUnitRequest;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO\PurchaseUnitRequest;

interface CartInterface
{
Expand Down
3 changes: 3 additions & 0 deletions src/DTO/Orders/CreatePayPalOrderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

namespace PrestaShop\Module\PrestashopCheckout\DTO\Orders;

use PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO\PaymentSourceRequest;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO\PurchaseUnitRequest;

class CreatePayPalOrderRequest
{
/**
Expand Down
231 changes: 231 additions & 0 deletions src/PayPal/Order/DTO/AddressRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO;

class AddressRequest
{
/**
* @var string
*/
private $address_line_1;

/**
* @var string
*/
private $address_line_2;

/**
* @var string
*/
private $address_line_3;

/**
* @var string
*/
private $admin_area_1;

/**
* @var string
*/
private $admin_area_2;

/**
* @var string
*/
private $admin_area_3;

/**
* @var string
*/
private $admin_area_4;

/**
* @var string
*/
private $postal_code;

/**
* @var string
*/
private $country_code;

/**
* @return string
*/
public function getAddressLine1()
{
return $this->address_line_1;
}

/**
* @param string $address_line_1
*
* @return void
*/
public function setAddressLine1($address_line_1)
{
$this->address_line_1 = $address_line_1;
}

/**
* @return string
*/
public function getAddressLine2()
{
return $this->address_line_2;
}

/**
* @param string $address_line_2
*
* @return void
*/
public function setAddressLine2($address_line_2)
{
$this->address_line_2 = $address_line_2;
}

/**
* @return string
*/
public function getAddressLine3()
{
return $this->address_line_3;
}

/**
* @param string $address_line_3
*
* @return void
*/
public function setAddressLine3($address_line_3)
{
$this->address_line_3 = $address_line_3;
}

/**
* @return string
*/
public function getAdminArea1()
{
return $this->admin_area_1;
}

/**
* @param string $admin_area_1
*
* @return void
*/
public function setAdminArea1($admin_area_1)
{
$this->admin_area_1 = $admin_area_1;
}

/**
* @return string
*/
public function getAdminArea2()
{
return $this->admin_area_2;
}

/**
* @param string $admin_area_2
*
* @return void
*/
public function setAdminArea2($admin_area_2)
{
$this->admin_area_2 = $admin_area_2;
}

/**
* @return string
*/
public function getAdminArea3()
{
return $this->admin_area_3;
}

/**
* @param string $admin_area_3
*
* @return void
*/
public function setAdminArea3($admin_area_3)
{
$this->admin_area_3 = $admin_area_3;
}

/**
* @return string
*/
public function getAdminArea4()
{
return $this->admin_area_4;
}

/**
* @param string $admin_area_4
*
* @return void
*/
public function setAdminArea4($admin_area_4)
{
$this->admin_area_4 = $admin_area_4;
}

/**
* @return string
*/
public function getPostalCode()
{
return $this->postal_code;
}

/**
* @param string $postal_code
*
* @return void
*/
public function setPostalCode($postal_code)
{
$this->postal_code = $postal_code;
}

/**
* @return string
*/
public function getCountryCode()
{
return $this->country_code;
}

/**
* @param string $country_code
*
* @return void
*/
public function setCountryCode($country_code)
{
$this->country_code = $country_code;
}
}
70 changes: 70 additions & 0 deletions src/PayPal/Order/DTO/Amount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO;

class Amount
{
/**
* @var string
*/
private $currency_code;

/**
* @var string
*/
private $value;

/**
* @return string
*/
public function getCurrencyCode()
{
return $this->currency_code;
}

/**
* @param string $currency_code
*
* @return void
*/
public function setCurrencyCode($currency_code)
{
$this->currency_code = $currency_code;
}

/**
* @return string
*/
public function getValue()
{
return $this->value;
}

/**
* @param string $value
*
* @return void
*/
public function setValue($value)
{
$this->value = $value;
}
}
Loading
Loading