-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from xendit/feature/subscription
Feature/subscription
- Loading branch information
Showing
39 changed files
with
1,208 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,4 +87,6 @@ fabric.properties | |
|
||
*.zip | ||
|
||
telepresence.log | ||
telepresence.log | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
namespace Xendit\M2Invoice\Block; | ||
|
||
use Magento\Framework\Registry; | ||
use Magento\Framework\View\Element\Template; | ||
use Magento\Framework\View\Element\Template\Context; | ||
use Xendit\M2Invoice\Helper\Data; | ||
|
||
class CustomView extends Template | ||
{ | ||
private $dataHelper; | ||
|
||
public function __construct( | ||
Context $context, | ||
Registry $registry, | ||
Data $dataHelper, | ||
array $data = [] | ||
) { | ||
$this->registry = $registry; | ||
$this->dataHelper = $dataHelper; | ||
|
||
parent::__construct($context, $data); | ||
} | ||
|
||
/** | ||
* Retrieve current order model instance | ||
* | ||
* @return \Magento\Sales\Model\Order | ||
*/ | ||
public function getOrder() | ||
{ | ||
return $this->registry->registry('current_order'); | ||
} | ||
|
||
public function getPaymentMethod() | ||
{ | ||
return $this->getOrder()->getPayment()->getMethodInstance()->getCode(); | ||
} | ||
|
||
public function getSubscriptionConfig() | ||
{ | ||
$data = array(); | ||
$data['card_subscription_interval'] = $this->dataHelper->getSubscriptionInterval(); | ||
$data['card_subscription_interval_count'] = $this->dataHelper->getSubscriptionIntervalCount(); | ||
|
||
return $data; | ||
} | ||
|
||
public function getInstallmentData() | ||
{ | ||
return $this->getOrder()->getPayment()->getAdditionalInformation('xendit_installment'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.