You are here

interface CheckoutSdkInterface in Commerce PayPal 8

Hierarchy

Expanded class hierarchy of CheckoutSdkInterface

All classes that implement CheckoutSdkInterface

File

src/CheckoutSdkInterface.php, line 8

Namespace

Drupal\commerce_paypal
View source
interface CheckoutSdkInterface {

  /**
   * Gets an access token.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function getAccessToken();

  /**
   * Gets a client token.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function getClientToken();

  /**
   * Creates an order in PayPal.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   * @param \Drupal\address\AddressInterface $billing_address
   *   (optional) A billing address to pass to PayPal as the payer information.
   *   This is used in checkout to pass the entered address that is not yet
   *   submitted and associated to the order.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function createOrder(OrderInterface $order, AddressInterface $billing_address = NULL);

  /**
   * Get an existing order from PayPal.
   *
   * @param string $remote_id
   *   The PayPal order ID.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function getOrder($remote_id);

  /**
   * Updates an existing PayPal order.
   *
   * @param string $remote_id
   *   The PayPal order ID.
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function updateOrder($remote_id, OrderInterface $order);

  /**
   * Authorize payment for order.
   *
   * @param string $remote_id
   *   The PayPal order ID.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function authorizeOrder($remote_id);

  /**
   * Capture payment for order.
   *
   * @param string $remote_id
   *   The PayPal order ID.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function captureOrder($remote_id);

  /**
   * Captures an authorized payment, by ID.
   *
   * @param string $authorization_id
   *   The PayPal-generated ID for the authorized payment to capture.
   * @param array $parameters
   *   (optional An array of parameters to pass as the request body.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function capturePayment($authorization_id, array $parameters = []);

  /**
   * Reauthorizes an authorized PayPal account payment, by ID.
   *
   * @param string $authorization_id
   *   The PayPal-generated ID of the authorized payment to reauthorize.
   * @param array $parameters
   *   (optional An array of parameters to pass as the request body.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function reAuthorizePayment($authorization_id, array $parameters = []);

  /**
   * Refunds a captured payment, by ID.
   *
   * @param string $capture_id
   *   The PayPal-generated ID for the captured payment to refund.
   * @param array $parameters
   *   (optional An array of parameters to pass as the request body.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function refundPayment($capture_id, array $parameters = []);

  /**
   * Voids, or cancels, an authorized payment, by ID.
   *
   * @param string $authorization_id
   *   The PayPal-generated ID of the authorized payment to void.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The HTTP response.
   */
  public function voidPayment($authorization_id);

}

Members

Namesort descending Modifiers Type Description Overrides
CheckoutSdkInterface::authorizeOrder public function Authorize payment for order. 1
CheckoutSdkInterface::captureOrder public function Capture payment for order. 1
CheckoutSdkInterface::capturePayment public function Captures an authorized payment, by ID. 1
CheckoutSdkInterface::createOrder public function Creates an order in PayPal. 1
CheckoutSdkInterface::getAccessToken public function Gets an access token. 1
CheckoutSdkInterface::getClientToken public function Gets a client token. 1
CheckoutSdkInterface::getOrder public function Get an existing order from PayPal. 1
CheckoutSdkInterface::reAuthorizePayment public function Reauthorizes an authorized PayPal account payment, by ID. 1
CheckoutSdkInterface::refundPayment public function Refunds a captured payment, by ID. 1
CheckoutSdkInterface::updateOrder public function Updates an existing PayPal order. 1
CheckoutSdkInterface::voidPayment public function Voids, or cancels, an authorized payment, by ID. 1