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

Feature/payment option interface #107

Merged
merged 3 commits into from
Dec 27, 2019
Merged
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
84 changes: 84 additions & 0 deletions src/Support/Contracts/PaymentOptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

namespace AvoRed\Framework\Support\Contracts;

use AvoRed\Framework\Database\Models\Address;
use AvoRed\Framework\Database\Models\Order;

interface PaymentOptionInterface
{

/**
* Get Identifier for this Payment option.
*
* @return string
*/
public function identifier();

/**
* Get Title for this Payment Option.
*
* @return string
*/
public function name();

/**
* Check whether this payment option requires billing address data.
*
* @return boolean
*/
public function requiresAddress();

/**
* Set billing address data.
*
* @param \AvoRed\Framework\Database\Models\Address $address
*
* @return void
*/
public function setAddress(Address $address);

/**
* Get billing address data.
*
* @return \AvoRed\Framework\Database\Models\Address | null
*/
public function address();

/**
* Attempt to process this Payment Option.
*
* @return void
*/
public function process();

/**
* Attempts to link an order to a payment attempt.
*
* @param \AvoRed\Framework\Database\Models\Order $order
* @return void
*/
public function syncOrder(Order $order);

/**
* Payment Option View Path.
*
* @return string
*/
public function view();

/**
* Render Payment Option
*
* @return string
*/
public function render();

/**
* Payment Option View Data.
*
* @return array
*/
public function with();

}