-
Notifications
You must be signed in to change notification settings - Fork 14
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 #45 from SwedbankPay/feature/woo-66-initiatingSyst…
…emUserAgent Add InitiatingSystemUserAgent
- Loading branch information
Showing
7 changed files
with
297 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
use SwedbankPay\Api\Service\Payment\Resource\Request\Payment; | ||
|
||
class PaymentRequestTest extends TestCase | ||
{ | ||
public function testInitiatingSystemUserAgent() | ||
{ | ||
$payment = new Payment(); | ||
|
||
$this->assertTrue(method_exists($payment, 'getInitiatingSystemUserAgent')); | ||
$this->assertTrue(method_exists($payment, 'setInitiatingSystemUserAgent')); | ||
|
||
$result = $payment->setInitiatingSystemUserAgent('swedbankpay-sdk-php/123'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Payment\Resource\Request\Data\PaymentRequestInterface', | ||
$result | ||
); | ||
|
||
$result = $payment->getInitiatingSystemUserAgent(); | ||
$this->assertEquals('swedbankpay-sdk-php/123', $result); | ||
} | ||
} |
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,177 @@ | ||
<?php | ||
|
||
use SwedbankPay\Api\Service\Paymentorder\Resource\Request\Paymentorder; | ||
|
||
class PaymentorderTest extends TestCase | ||
{ | ||
public function testInitiatingSystemUserAgent() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getInitiatingSystemUserAgent')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setInitiatingSystemUserAgent')); | ||
|
||
$result = $paymentOrder->setInitiatingSystemUserAgent('swedbankpay-sdk-php/123'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getInitiatingSystemUserAgent(); | ||
$this->assertEquals('swedbankpay-sdk-php/123', $result); | ||
} | ||
|
||
public function testCurrency() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getCurrency')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setCurrency')); | ||
|
||
$result = $paymentOrder->setCurrency('SEK'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getCurrency(); | ||
$this->assertEquals('SEK', $result); | ||
} | ||
|
||
public function testAmount() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getAmount')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setAmount')); | ||
|
||
$result = $paymentOrder->setAmount(1); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getAmount(); | ||
$this->assertEquals(1, $result); | ||
} | ||
|
||
public function testVatAmount() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getVatAmount')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setVatAmount')); | ||
|
||
$result = $paymentOrder->setVatAmount(1); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getVatAmount(); | ||
$this->assertEquals(1, $result); | ||
} | ||
|
||
public function testDescription() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getDescription')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setDescription')); | ||
|
||
$result = $paymentOrder->setDescription('Description'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getDescription(); | ||
$this->assertEquals('Description', $result); | ||
} | ||
|
||
public function testUserAgent() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getUserAgent')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setUserAgent')); | ||
|
||
$result = $paymentOrder->setUserAgent('UserAgent'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getUserAgent(); | ||
$this->assertEquals('UserAgent', $result); | ||
} | ||
|
||
public function testLanguage() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getLanguage')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setLanguage')); | ||
|
||
$result = $paymentOrder->setLanguage('en-US'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getLanguage(); | ||
$this->assertEquals('en-US', $result); | ||
} | ||
|
||
public function testGeneratePaymentToken() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'isGeneratePaymentToken')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setGeneratePaymentToken')); | ||
|
||
$result = $paymentOrder->setGeneratePaymentToken(true); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->isGeneratePaymentToken(); | ||
$this->assertEquals(true, $result); | ||
} | ||
|
||
public function testDisablePaymentMenu() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'isDisablePaymentMenu')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setDisablePaymentMenu')); | ||
|
||
$result = $paymentOrder->setDisablePaymentMenu(true); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->isDisablePaymentMenu(); | ||
$this->assertEquals(true, $result); | ||
} | ||
|
||
public function testPayerReference() | ||
{ | ||
$paymentOrder = new Paymentorder(); | ||
|
||
$this->assertTrue(method_exists($paymentOrder, 'getPayerReference')); | ||
$this->assertTrue(method_exists($paymentOrder, 'setPayerReference')); | ||
|
||
$result = $paymentOrder->setPayerReference('123'); | ||
$this->assertInstanceOf( | ||
'\SwedbankPay\Api\Service\Paymentorder\Resource\Request\Data\PaymentorderInterface', | ||
$result | ||
); | ||
|
||
$result = $paymentOrder->getPayerReference(); | ||
$this->assertEquals('123', $result); | ||
} | ||
|
||
} |