-
Notifications
You must be signed in to change notification settings - Fork 16
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
add ActiveRecord storage and minor fixes #26
Open
fullpipe
wants to merge
14
commits into
Payum:master
Choose a base branch
from
fullpipe:ac_storage_and_minor_fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+591
−12
Open
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5fd4b7f
add active record storage
fullpipe f9b0d47
update controller redirects
fullpipe c818962
update exceptions handler;
fullpipe c745282
add unsave notify action
fullpipe d1d27e8
update composer and readme
fullpipe 7cc34c5
add migration
fullpipe 9f19625
clean up
fullpipe 5bcc845
fix composer.json
fullpipe b12a239
fix composer.json
fullpipe df2d3e4
minor fixes
fullpipe a1c7de4
revert composer.json
fullpipe bd5b071
bug fix
fullpipe 17a30f1
Fix missed exception class
fullpipe 3fe9562
Bug fix
fullpipe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,238 @@ | ||
<?php | ||
|
||
namespace Payum\YiiExtension\Model; | ||
|
||
use Payum\Core\Model\PaymentInterface; | ||
|
||
/** | ||
* This is the model class for table "payum_payment_details". | ||
* | ||
* The followings are the available columns in table 'payum_payment_details': | ||
* | ||
* @property integer $id | ||
* @property string $number | ||
* @property string $description | ||
* @property string $client_email | ||
* @property string $client_id | ||
* @property string $currency_code | ||
* @property integer $total_amount | ||
* @property integer $currency_digits_after_decimal_point | ||
* | ||
* The followings are the available model relations: | ||
* @property PayumPaymentToken[] $payumPaymentTokens | ||
*/ | ||
class PaymentDetails extends \CActiveRecord implements PaymentInterface | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function init() | ||
{ | ||
$this->setDetails(array()); | ||
$this->currency_digits_after_decimal_point = 2; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function primaryKey() | ||
{ | ||
return 'id'; | ||
} | ||
|
||
/** | ||
* Get id. | ||
* | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getNumber() | ||
{ | ||
return $this->number; | ||
} | ||
|
||
/** | ||
* @param string $number | ||
*/ | ||
public function setNumber($number) | ||
{ | ||
$this->number = $number; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getDescription() | ||
{ | ||
return $this->description; | ||
} | ||
|
||
/** | ||
* @param string $description | ||
*/ | ||
public function setDescription($description) | ||
{ | ||
$this->description = $description; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getClientEmail() | ||
{ | ||
return $this->client_email; | ||
} | ||
|
||
/** | ||
* @param string $clientEmail | ||
*/ | ||
public function setClientEmail($clientEmail) | ||
{ | ||
$this->client_email = $clientEmail; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getClientId() | ||
{ | ||
return $this->client_id; | ||
} | ||
|
||
/** | ||
* @param string $clientId | ||
*/ | ||
public function setClientId($clientId) | ||
{ | ||
$this->client_id = $clientId; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getTotalAmount() | ||
{ | ||
return $this->total_amount; | ||
} | ||
|
||
/** | ||
* @param int $totalAmount | ||
*/ | ||
public function setTotalAmount($totalAmount) | ||
{ | ||
$this->total_amount = $totalAmount; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getCurrencyCode() | ||
{ | ||
return $this->currency_code; | ||
} | ||
|
||
/** | ||
* @param string $currencyCode | ||
* @param int $digitsAfterDecimalPoint | ||
*/ | ||
public function setCurrencyCode($currencyCode, $digitsAfterDecimalPoint = 2) | ||
{ | ||
$this->currency_code = $currencyCode; | ||
$this->currency_digits_after_decimal_point = $digitsAfterDecimalPoint; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getCurrencyDigitsAfterDecimalPoint() | ||
{ | ||
return $this->currency_digits_after_decimal_point; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getDetails() | ||
{ | ||
if (null !== $this->details) { | ||
return unserialize($this->details); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
* @param array|\Traversable $details | ||
*/ | ||
public function setDetails($details) | ||
{ | ||
if ($details instanceof \Traversable) { | ||
$details = iterator_to_array($details); | ||
} | ||
|
||
$this->details = serialize($details); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function tableName() | ||
{ | ||
return 'payum_payment_details'; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function rules() | ||
{ | ||
return array( | ||
array('number', 'required'), | ||
array('total_amount, currency_digits_after_decimal_point', 'numerical', 'integerOnly' => true), | ||
array('number, client_email, client_id, currency_code', 'length', 'max' => 255), | ||
array('description', 'safe'), | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function relations() | ||
{ | ||
return array( | ||
'payumPaymentTokens' => array(self::HAS_MANY, 'PayumPaymentToken', 'details_id'), | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return array( | ||
'id' => 'ID', | ||
'number' => 'Number', | ||
'description' => 'Description', | ||
'client_email' => 'Client Email', | ||
'client_id' => 'Client', | ||
'currency_code' => 'Currency Code', | ||
'total_amount' => 'Total Amount', | ||
'currency_digits_after_decimal_point' => 'Currency Digits After Decimal Point', | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public static function model($className = __CLASS__) | ||
{ | ||
return parent::model($className); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The master is 1.0-dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm... it is not