Skip to content

Commit

Permalink
Updates RecurringPayment to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
zaporylie committed Jul 30, 2024
1 parent d6246df commit 416c993
Show file tree
Hide file tree
Showing 17 changed files with 305 additions and 141 deletions.
50 changes: 9 additions & 41 deletions src/Model/RecurringPayment/Agreement.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,23 @@ class Agreement
*/
protected $campaign;

/**
* @var string
* @Serializer\Type("string")
*/
protected $currency;

/**
* @var string
* @Serializer\Type("string")
*/
protected $id;

/**
* @var string
* @Serializer\Type("string")
* @var \zaporylie\Vipps\Model\RecurringPayment\AgreementInterval
* @Serializer\Type("zaporylie\Vipps\Model\RecurringPayment\AgreementInterval")
*/
protected $interval;

/**
* @var int
* @Serializer\Type("integer")
*/
protected $intervalCount;

/**
* @var int
* @Serializer\Type("integer")
* @var \zaporylie\Vipps\Model\RecurringPayment\Pricing
* @Serializer\Type("zaporylie\Vipps\Model\RecurringPayment\Pricing")
*/
protected $price;
protected $pricing;

/**
* @var string
Expand Down Expand Up @@ -106,16 +94,6 @@ public function getCampaign()
return $this->campaign;
}

/**
* Gets currency value.
*
* @return string
*/
public function getCurrency()
{
return $this->currency;
}

/**
* Gets id value.
*
Expand All @@ -129,31 +107,21 @@ public function getId()
/**
* Gets interval value.
*
* @return string
* @return \zaporylie\Vipps\Model\RecurringPayment\AgreementInterval
*/
public function getInterval()
{
return $this->interval;
}

/**
* Gets intervalCount value.
*
* @return int
*/
public function getIntervalCount()
{
return $this->intervalCount;
}

/**
* Gets price value.
*
* @return int
* @return \zaporylie\Vipps\Model\RecurringPayment\Pricing
*/
public function getPrice()
public function getPricing()
{
return $this->price;
return $this->pricing;
}

/**
Expand Down
97 changes: 97 additions & 0 deletions src/Model/RecurringPayment/AgreementInterval.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

namespace zaporylie\Vipps\Model\RecurringPayment;

use JMS\Serializer\Annotation as Serializer;

/**
* Class Interval
*
* @todo: Currently this package is not used anywhere in the project. Use it for
* reference and comparison only.
*
* @package Vipps\Model\RecurringPayment
*/
class AgreementInterval
{
/**
* @var string
* @Serializer\Type("string")
*/
protected $unit;

/**
* @var int
* @Serializer\Type("integer")
*/
protected $count;

/**
* @var string
* @Serializer\Type("string")
*/
protected $text;

/**
* Gets unit value.
*
* @return string
*/
public function getUnit(): string {
return $this->unit;
}

/**
* Gets count value.
*
* @return int
*/
public function getCount(): int {
return $this->count;
}

/**
* Gets text value.
*
* @return string
*/
public function getText(): string {
return $this->text;
}

/**
* Sets unit variable.
*
* @param string $unit
*
* @return $this
*/
public function setUnit(string $unit) {
$this->unit = $unit;
return $this;
}

/**
* Sets count variable.
*
* @param int $count
*
* @return $this
*/
public function setCount(int $count) {
$this->count = $count;
return $this;
}

/**
* Sets text variable.
*
* @param string $text
*
* @return $this
*/
public function setText(string $text) {
$this->text = $text;
return $this;
}
}
12 changes: 6 additions & 6 deletions src/Model/RecurringPayment/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class Charge
protected $amount;

/**
* @var int
* @Serializer\Type("integer")
* @var \zaporylie\Vipps\Model\RecurringPayment\Summary
* @Serializer\Type("zaporylie\Vipps\Model\RecurringPayment\Summary")
*/
protected $amountRefunded;
protected $summary;

/**
* @var string
Expand Down Expand Up @@ -84,11 +84,11 @@ public function getAmount()
/**
* Gets amountRefunded value.
*
* @return int
* @return \zaporylie\Vipps\Model\RecurringPayment\Summary
*/
public function getAmountRefunded()
public function getSummary()
{
return $this->amountRefunded;
return $this->summary;
}

/**
Expand Down
97 changes: 97 additions & 0 deletions src/Model/RecurringPayment/Pricing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

namespace zaporylie\Vipps\Model\RecurringPayment;

use JMS\Serializer\Annotation as Serializer;

/**
* Class InitialCharge.
*
* @package Vipps\Model\RecurringPayment
*/
class Pricing
{
/**
* @var int
* @Serializer\Type("integer")
*/
protected $amount;

/**
* @var string
* @Serializer\Type("string")
*/
protected $currency;

/**
* @var string
* @Serializer\Type("string")
*/
protected $type;

/**
* Gets amount value.
*
* @return int
*/
public function getAmount(): int {
return $this->amount;
}

/**
* Gets currency value.
*
* @return string
*/
public function getCurrency(): string {
return $this->currency;
}

/**
* Gets type value.
*
* @return string
*/
public function getType(): string {
return $this->type;
}

/**
* Sets amount variable.
*
* @param int $amount
*
* @return $this
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}

/**
* Sets currency variable.
*
* @param string $currency
*
* @return $this
*/
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}

/**
* Sets transactionType variable.
*
* @param string $transactionType
*
* @return $this
*/
public function setType($transactionType)
{
$this->transactionType = $transactionType;
return $this;
}
}
Loading

0 comments on commit 416c993

Please sign in to comment.