Skip to content

Checkout.com Magento 2 Module v1.0.1 #2

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

Merged
merged 68 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
28fad13
TOS Validation
david-fiaty-cko May 3, 2017
59bae21
TOS Validation
david-fiaty-cko May 3, 2017
61b2e7c
TOS Validation
david-fiaty-cko May 3, 2017
df40233
TOS Validation
david-fiaty-cko May 3, 2017
5dde665
TOS Validation
david-fiaty-cko May 3, 2017
08e512b
Admin field declarations
david-fiaty-cko May 3, 2017
87474e8
Admin fields values
david-fiaty-cko May 3, 2017
b3a546d
New order status
david-fiaty-cko May 3, 2017
f3b6fcb
Configuration functions
david-fiaty-cko May 3, 2017
1b8c15f
Configuration provider
david-fiaty-cko May 3, 2017
c1577cd
Design settings feature
david-fiaty-cko May 3, 2017
acfcdd9
AttemptN3D
david-fiaty-cko May 3, 2017
9bd45eb
Currency feature
david-fiaty-cko May 3, 2017
538df97
Currency feature
david-fiaty-cko May 3, 2017
ae0f76b
Currency feature
david-fiaty-cko May 3, 2017
406a7f8
Currency feature
david-fiaty-cko May 3, 2017
b3cbf57
Payment token
david-fiaty-cko May 9, 2017
d57e76c
Payment token
david-fiaty-cko May 9, 2017
6ddd964
Currency feature/Alternative payments
david-fiaty-cko May 9, 2017
71ba973
Currency feature
david-fiaty-cko May 9, 2017
7fbece5
Currency and alternative payments
david-fiaty-cko May 9, 2017
9e44dbf
Currency feature fix
david-fiaty-cko May 9, 2017
4d7e535
Currency feature
david-fiaty-cko May 9, 2017
60587e8
Payment mode
david-fiaty-cko May 9, 2017
ca40272
Merge remote-tracking branch 'checkout/master'
david-fiaty-cko May 30, 2017
b9ccf3f
RC1 update
david-fiaty-cko May 30, 2017
4a3b4c7
CCTypes update
david-fiaty-cko Jun 2, 2017
094cd30
Invoicing bug fix
david-fiaty-cko Jun 5, 2017
3394b18
Suspected fraud bug fix.
david-fiaty-cko Jun 5, 2017
5b91fe9
Embedded bug fix
david-fiaty-cko Jun 6, 2017
826d363
REST API + Bugfix update
david-fiaty-cko Jun 20, 2017
4e288a8
Code review and file system cleanup
david-fiaty-cko Jun 23, 2017
ac03ab1
Bug fix release
david-fiaty-cko Jun 26, 2017
f6d973d
Bug fix update
david-fiaty-cko Jun 27, 2017
12c5485
Feature update
david-fiaty-cko Jul 11, 2017
c158d56
Stable bug fix release
david-fiaty-cko Jul 28, 2017
74f2a53
RC Update
david-fiaty-cko Aug 3, 2017
a822a99
Readme.txt update
david-fiaty-cko Aug 3, 2017
4f12246
Readme.txt update
david-fiaty-cko Aug 3, 2017
8bd16bd
Readme.txt update
david-fiaty-cko Aug 3, 2017
594e764
Updated readme.txt
david-fiaty-cko Aug 3, 2017
dcffeb2
Updated readme.txt
david-fiaty-cko Aug 3, 2017
89bdf07
Updated readme.txt
david-fiaty-cko Aug 3, 2017
9408414
Updated readme.txt
david-fiaty-cko Aug 3, 2017
70bbf4d
Readme.txt update
david-fiaty-cko Aug 3, 2017
ffb5723
Updated Readme.txt
david-fiaty-cko Aug 4, 2017
e61e9fd
Updated readme.txt
david-fiaty-cko Aug 4, 2017
ae88fab
Updated readme.txt
david-fiaty-cko Aug 4, 2017
e52c8fd
Updated readme.txt
david-fiaty-cko Aug 4, 2017
2369fc4
Updated readme.txt
david-fiaty-cko Aug 4, 2017
b9ecb0b
Updated readme.txt
david-fiaty-cko Aug 4, 2017
fa5d9f0
Updated readme.txt
david-fiaty-cko Aug 4, 2017
91c8e98
Readme.txt
david-fiaty-cko Aug 4, 2017
b7deb1d
Updated readme.txt
david-fiaty-cko Aug 4, 2017
1e67a67
Updated readme.txt
david-fiaty-cko Aug 4, 2017
4951649
Updated readme.txt
david-fiaty-cko Aug 4, 2017
8a3a308
Updated readme.txt
david-fiaty-cko Aug 4, 2017
e2f4d6a
Updated readme.txt
david-fiaty-cko Aug 4, 2017
d432e52
Readme.txt
david-fiaty-cko Aug 4, 2017
9fd7841
Readme.txt
david-fiaty-cko Aug 4, 2017
e6890dd
Readme.txt update
david-fiaty-cko Aug 29, 2017
a0b6dcb
Module config update
david-fiaty-cko Aug 29, 2017
1f8f8b7
Admin config and debug update.
david-fiaty-cko Aug 30, 2017
8d396ef
Readme.txt update
david-fiaty-cko Aug 30, 2017
6205a76
Recurring payments
david-fiaty-cko Sep 6, 2017
e6382c6
Removed folder
david-fiaty-cko Sep 6, 2017
5b9391d
Removed file
david-fiaty-cko Sep 6, 2017
ef73c76
Code Cleanup
david-fiaty-cko Sep 19, 2017
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
83 changes: 83 additions & 0 deletions Api/Data/PlanInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/**
* Checkout.com Magento 2 Payment module (https://www.checkout.com)
*
* Copyright (c) 2017 Checkout.com (https://www.checkout.com)
* Author: David Fiaty | [email protected]
*
* License GNU/GPL V3 https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace CheckoutCom\Magento2\Api\Data;

interface PlanInterface
{
/**
* Constants for keys of data array.
*/
const ENTITY_ID = 'id';
const NAME = 'plan_name';
const STATUS = 'plan_status';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';

/**
* Get EntityId.
*
* @return int
*/
public function getEntityId();

/**
* Set EntityId.
*/
public function setEntityId($entityId);

/**
* Get Name.
*
* @return varchar
*/
public function getName();

/**
* Set Name.
*/
public function setName($name);

/**
* Get Status.
*
* @return int
*/
public function getStatus();

/**
* Set Status.
*/
public function setStatus($status);

/**
* Get UpdatedAt.
*
* @return timestamp
*/
public function getUpdatedAt();

/**
* Set UpdatedAt.
*/
public function setUpdatedAt($updatedAt);

/**
* Get CreatedAt.
*
* @return varchar
*/
public function getCreatedAt();

/**
* Set CreatedAt.
*/
public function setCreatedAt($createdAt);
}
81 changes: 81 additions & 0 deletions Api/Data/SubscriptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
/**
* Checkout.com Magento 2 Payment module (https://www.checkout.com)
*
* Copyright (c) 2017 Checkout.com (https://www.checkout.com)
* Author: David Fiaty | [email protected]
*
* License GNU/GPL V3 https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace CheckoutCom\Magento2\Api\Data;

interface SubscriptionInterface
{
/**
* Constants for keys of data array.
*/
const ENTITY_ID = 'id';
const STATUS = 'subscription_status';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
const TRACK_ID = 'track_id';

/**
* Get EntityId.
*
* @return int
*/
public function getEntityId();

/**
* Set EntityId.
*/
public function setEntityId($entityId);

/**
* Get TrackId.
*/
public function getTrackId();

/**
* Set TrackId.
*/
public function setTrackId($entityId);

/**
* Get Status.
*
* @return int
*/
public function getStatus();

/**
* Set Status.
*/
public function setStatus($status);

/**
* Get UpdatedAt.
*
* @return timestamp
*/
public function getUpdatedAt();

/**
* Set UpdatedAt.
*/
public function setUpdatedAt($updatedAt);

/**
* Get CreatedAt.
*
* @return varchar
*/
public function getCreatedAt();

/**
* Set CreatedAt.
*/
public function setCreatedAt($createdAt);
}
57 changes: 57 additions & 0 deletions Api/Data/UserCardsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* Checkout.com Magento 2 Payment module (https://www.checkout.com)
*
* Copyright (c) 2017 Checkout.com (https://www.checkout.com)
* Author: David Fiaty | [email protected]
*
* License GNU/GPL V3 https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace CheckoutCom\Magento2\Api\Data;

interface UserCardsInterface
{
/**
* Constants for keys of data array.
*/
const ENTITY_ID = 'id';
const STATUS = 'card_status';
const CREATED_AT = 'created_at';

/**
* Get EntityId.
*
* @return int
*/
public function getEntityId();

/**
* Set EntityId.
*/
public function setEntityId($entityId);

/**
* Get Status.
*
* @return int
*/
public function getStatus();

/**
* Set Status.
*/
public function setStatus($status);

/**
* Get CreatedAt.
*
* @return varchar
*/
public function getCreatedAt();

/**
* Set CreatedAt.
*/
public function setCreatedAt($createdAt);
}
23 changes: 23 additions & 0 deletions Api/MobilePaymentInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* Checkout.com Magento 2 Payment module (https://www.checkout.com)
*
* Copyright (c) 2017 Checkout.com (https://www.checkout.com)
* Author: David Fiaty | [email protected]
*
* License GNU/GPL V3 https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace CheckoutCom\Magento2\Api;

interface MobilePaymentInterface
{
/**
* Charge with card token.
*
* @api
* @param mixed $data.
* @return int.
*/
public function charge($data);
}
112 changes: 112 additions & 0 deletions Block/Adminhtml/Cards/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php
/**
* Checkout.com Magento 2 Payment module (https://www.checkout.com)
*
* Copyright (c) 2017 Checkout.com (https://www.checkout.com)
* Author: David Fiaty | [email protected]
*
* License GNU/GPL V3 https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace CheckoutCom\Magento2\Block\Adminhtml\Cards;

use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use CheckoutCom\Magento2\Gateway\Config\Config as GatewayConfig;
use Magento\Customer\Model\Session;
use Magento\Payment\Model\CcConfig;

class Form extends Template {

/**
* @var GatewayConfig
*/
protected $gatewayConfig;

/**
*
* @var CcConfig
*/
protected $ccConfig;

/**
* @var Session
*/
protected $session;

/**
* @var StoreManagerInterface
*/
protected $storeManager;

/**
* Form constructor.
* @param GatewayConfig $gatewayConfig
* @param CcConfig $ccConfig
* @param Session $session
* @param Context $context
* @param array $data
*/
public function __construct(GatewayConfig $gatewayConfig, CcConfig $ccConfig, Session $session, Context $context, array $data = []) {

$this->gatewayConfig = $gatewayConfig;
$this->ccConfig = $ccConfig;
$this->session = $session;
$this->storeManager = $context->getStoreManager();

parent::__construct($context, $data);
}

public function getSaveCardCheckAmount() {

// Get the configured amount
$amount = $this->_scopeConfig->getValue('payment/checkout_com/save_card_check_amount');

return $amount;
}

public function getSaveCardCheckCurrency() {

// Get the configured currency
$currency = $this->_scopeConfig->getValue('payment/checkout_com/save_card_check_currency');

return $currency;
}

/**
* Returns the customer instance from the session.
*
* @return \Magento\Customer\Model\Customer
*/
public function getCustomer() {
return $this->session->getCustomer();
}

/**
* Returns the gateway config.
*
* @return GatewayConfig
*/
public function getGatewayConfig() {
return $this->gatewayConfig;
}

/**
* Returns the url for the form.
*
* @return string
*/
public function getFormActionUrl() {
return $this->_urlBuilder->getRouteUrl('checkout_com/cards/store');
}

/**
* Returns the current user currency preference.
*
* @return string
*/
public function getCustomerCurrency() {
return $this->storeManager->getStore()->getCurrentCurrencyCode();
}

}
Loading