Skip to content

Commit

Permalink
add cancelUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaireAlma committed Jan 25, 2024
1 parent 41e4441 commit c39fcc4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
28 changes: 27 additions & 1 deletion src/Entities/Insurance/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class Subscription
*/
private $subscriber;

/**
* @var $cancelUrl;
*/
private $cancelUrl;

/**
* @param string $contractId
* @param string $cmsReference
Expand All @@ -31,13 +36,34 @@ public function __construct(
$contractId,
$cmsReference,
$productPrice,
$subscriber
$subscriber,
$cancelUrl
)
{
$this->contractId = $contractId;
$this->cmsReference = $cmsReference;
$this->productPrice = $productPrice;
$this->subscriber = $subscriber;
$this->cancelUrl = $cancelUrl;
}

public function getAll()
{
return [
$this->contractId,
$this->cmsReference,
$this->productPrice,
$this->subscriber,
$this->cancelUrl
];
}

/**
* @return string
*/
public function getCancelUrl()
{
return $this->cancelUrl;
}

/**
Expand Down
12 changes: 8 additions & 4 deletions tests/Unit/Legacy/Endpoints/InsuranceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ public function subscriptionDataProvider()
'adr1',
'adr1',
null
)
),
'cancelUrl'
),
new Subscription(
'insurance_contract_3vt2jyvWWQc9wZCmWd1KtI',
Expand All @@ -344,7 +345,8 @@ public function subscriptionDataProvider()
'adr2',
'adr2',
'1988-08-22'
)
),
'cancelUrl'
)
],
null
Expand All @@ -366,7 +368,8 @@ public function subscriptionDataProvider()
'adr1',
'adr1',
null
)
),
'cancelUrl'
),
new Subscription(
'insurance_contract_3vt2jyvWWQc9wZCmWd1KtI',
Expand All @@ -383,7 +386,8 @@ public function subscriptionDataProvider()
'adr2',
'adr2',
'1988-08-22'
)
),
'cancelUrl'
)
],
'payment_id' => 'payment_11xlpX9QQYhd3xZVzNMrtdKw4myV7QET7X'
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Legacy/Entities/Insurance/SubscriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public function createNewSubscription()
$data['insurance_contract_id'],
$data['cms_reference'],
$data['product_price'],
$this->getSubscriber()
$this->getSubscriber(),
'cancelUrl'
);
}

Expand Down

0 comments on commit c39fcc4

Please sign in to comment.