-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f809746
commit 68c622f
Showing
3 changed files
with
80 additions
and
0 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
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,21 @@ | ||
<?php | ||
|
||
namespace SincosSoftware\Vipps\Model\Agreement; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
/** | ||
* Class ResponseGetOrderStatus | ||
* | ||
* @package Vipps\Model\Payment | ||
*/ | ||
class ResponseGetAllAgreements | ||
{ | ||
|
||
/** | ||
* @var \SincosSoftware\Vipps\Model\Agreement\ResponseGetAgreement[] | ||
* @Serializer\Type("array<SincosSoftware\Vipps\Model\Agreement\ResponseGetAgreement>") | ||
*/ | ||
protected $agreements; | ||
|
||
} |
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,52 @@ | ||
<?php | ||
|
||
namespace SincosSoftware\Vipps\Resource\Agreement; | ||
|
||
use SincosSoftware\Vipps\Resource\HttpMethod; | ||
use SincosSoftware\Vipps\Resource\Payment\PaymentResourceBase; | ||
use SincosSoftware\Vipps\VippsInterface; | ||
|
||
class GetAllAgreements extends PaymentResourceBase | ||
{ | ||
|
||
/** | ||
* @var \SincosSoftware\Vipps\Resource\HttpMethod | ||
*/ | ||
protected $method = HttpMethod::GET; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $path = '/recurring/v2/agreements'; | ||
|
||
/** | ||
* InitiatePayment constructor. | ||
* | ||
* @param \SincosSoftware\Vipps\VippsInterface $vipps | ||
* @param string $subscription_key | ||
*/ | ||
public function __construct(VippsInterface $vipps, $subscription_key) | ||
{ | ||
parent::__construct($vipps, $subscription_key); | ||
} | ||
|
||
/** | ||
* @return \SincosSoftware\Vipps\Model\Agreement\ResponseGetAgreement | ||
*/ | ||
public function call() | ||
{ | ||
$response = $this->makeCall(); | ||
|
||
$body = $response->getBody()->getContents(); | ||
|
||
$responseObject = $this | ||
->getSerializer() | ||
->deserialize( | ||
$body, | ||
'array<array>', | ||
'json' | ||
); | ||
|
||
return $responseObject; | ||
} | ||
} |