Skip to content

Commit

Permalink
Feature: Paypal PDP flow (rvvup#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
aashwin-rvvup authored Feb 21, 2023
1 parent 79be693 commit 72a3d05
Show file tree
Hide file tree
Showing 105 changed files with 5,474 additions and 460 deletions.
16 changes: 16 additions & 0 deletions Api/CartExpressPaymentRemoveInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface CartExpressPaymentRemoveInterface
{
/**
* Remove the payment data of express payment for the specified cart.
*
* @param string $cartId
* @return bool
*/
public function execute(string $cartId): bool;
}
18 changes: 18 additions & 0 deletions Api/CartPaymentActionsGetInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface CartPaymentActionsGetInterface
{
/**
* Get the payment actions for the cart ID.
*
* @param string $cartId
* @param bool $expressActions
* @return \Rvvup\Payments\Api\Data\PaymentActionInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function execute(string $cartId, bool $expressActions = false): array;
}
19 changes: 19 additions & 0 deletions Api/CartResetInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface CartResetInterface
{
/**
* Reset the data of the specified cart, empties items & addresses.
*
* @param string $cartId
* @return string
* @throws \Magento\Framework\Exception\CouldNotSaveException
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function execute(string $cartId): string;
}
22 changes: 22 additions & 0 deletions Api/ExpressPaymentCreateInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface ExpressPaymentCreateInterface
{
/**
* Create an Express order for the specified cart & rvvup payment method.
*
* Set checkout session flag & return Payment Method Actions.
*
* @param string $cartId
* @param string $methodCode
* @return \Rvvup\Payments\Api\Data\PaymentActionInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Rvvup\Payments\Exception\PaymentValidationException
*/
public function execute(string $cartId, string $methodCode): array;
}
17 changes: 17 additions & 0 deletions Api/GuestCartExpressPaymentRemoveInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface GuestCartExpressPaymentRemoveInterface
{
/**
* Remove the payment data of express payment for the specified cart & rvvup payment method for a guest user.
*
* @param string $cartId
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function execute(string $cartId): bool;
}
19 changes: 19 additions & 0 deletions Api/GuestCartPaymentActionsGetInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface GuestCartPaymentActionsGetInterface
{
/**
* Get the payment actions for the cart ID.
*
* @param string $cartId
* @param bool $expressActions
* @return \Rvvup\Payments\Api\Data\PaymentActionInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function execute(string $cartId, bool $expressActions = false): array;
}
19 changes: 19 additions & 0 deletions Api/GuestCartResetInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface GuestCartResetInterface
{
/**
* Reset the data of the specified guest cart, empties items & addresses.
*
* @param string $cartId
* @return string
* @throws \Magento\Framework\Exception\CouldNotSaveException
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function execute(string $cartId): string;
}
20 changes: 20 additions & 0 deletions Api/GuestExpressPaymentCreateInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface GuestExpressPaymentCreateInterface
{
/**
* Create an Express order for the specified cart & rvvup payment method for a guest user.
*
* @param string $cartId
* @param string $methodCode
* @return \Rvvup\Payments\Api\Data\PaymentActionInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Rvvup\Payments\Exception\PaymentValidationException
*/
public function execute(string $cartId, string $methodCode): array;
}
2 changes: 2 additions & 0 deletions Api/GuestPaymentActionsGetInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface GuestPaymentActionsGetInterface
*
* @param string $cartId
* @return \Rvvup\Payments\Api\Data\PaymentActionInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function execute(string $cartId): array;
}
17 changes: 0 additions & 17 deletions Api/PaymentActionsGetInterface.php

This file was deleted.

2 changes: 1 addition & 1 deletion Api/PaymentMethodsAssetsGetInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
interface PaymentMethodsAssetsGetInterface
{
/**
* Get the assets for all payment methods available for the value & currency.
* Get the assets for all/selected payment methods available for the value & currency.
*
* @param string $value
* @param string $currency
Expand Down
18 changes: 18 additions & 0 deletions Api/PaymentMethodsSettingsGetInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Rvvup\Payments\Api;

interface PaymentMethodsSettingsGetInterface
{
/**
* Get the settings for all/selected payment methods available for the value & currency.
*
* @param string $value
* @param string $currency
* @param array|string[] $methodCodes // Leave empty for all.
* @return array
*/
public function execute(string $value, string $currency, array $methodCodes = []): array;
}
Loading

0 comments on commit 72a3d05

Please sign in to comment.