Skip to content

Commit

Permalink
Merge pull request #9 from superbrave/SQOP-2603
Browse files Browse the repository at this point in the history
feat: Added extra information about orders
  • Loading branch information
hansgoed authored Feb 26, 2020
2 parents d8ec444 + 5811089 commit 80c8794
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/Message/CreateTransactionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function getData(): array
'ContractProfileId' => $this->getContractProfileId(),
'AmountInCents' => $this->getAmountInteger(),
'CurrencyCode' => $this->getCurrencyCode(),
'Reference' => $this->getReference(),
'Reference' => $this->getTransactionId(),
],
'Postback' => [
'UrlCompleted' => $this->getReturnUrl(),
Expand All @@ -47,7 +47,14 @@ public function getData(): array
'Timestamp' => $this->getTimestamp()->format(self::TIMESTAMP_FORMAT),
'LanguageCode' => $this->getLanguageCode(),
'CountryCode' => $this->getCountryCode(),
'Reference' => $this->getReference(),
'Reference' => $this->getTransactionId(),
'Order' => [
'OrderNumber' => $this->getReference(),
'CurrencyCode' => $this->getCurrencyCode(),
'TotalGrossAmountCents' => $this->getAmountInteger(),
'TotalNetAmountCents' => $this->getAmountInteger(),
],
'Description' => $this->getTransactionId(),
],
];

Expand Down
13 changes: 10 additions & 3 deletions tests/Message/CreateTransactionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function testGetData(): void
{
$this->request->setAmountInteger(1337);
$this->request->setCurrencyCode('EUR');
$this->request->setTransactionId('2fad9b1b-a2d3-455c-bc29-b79516fd3257-random-uuid-hex');
$this->request->setReference('2fad9b1b-a2d3-455c-bc29-b79516fd3257');

$this->request->setReturnUrl('https://www.superbrave.nl/return-url');
$this->request->setCancelUrl('https://www.superbrave.nl/cancel-url');
$this->request->setNotifyUrl('https://www.superbrave.nl/notify-url');
Expand All @@ -55,7 +55,7 @@ public function testGetData(): void
'ContractProfileId' => '64eb3717-8b5d-4088-8108-93224675e538',
'AmountInCents' => 1337,
'CurrencyCode' => 'EUR',
'Reference' => '2fad9b1b-a2d3-455c-bc29-b79516fd3257',
'Reference' => '2fad9b1b-a2d3-455c-bc29-b79516fd3257-random-uuid-hex',
],
'Postback' => [
'UrlCompleted' => 'https://www.superbrave.nl/return-url',
Expand All @@ -80,7 +80,14 @@ public function testGetData(): void
'Timestamp' => '2019-03-09T12:00:00Z',
'LanguageCode' => 'nl',
'CountryCode' => 'NL',
'Reference' => '2fad9b1b-a2d3-455c-bc29-b79516fd3257',
'Order' => [
'OrderNumber' => '2fad9b1b-a2d3-455c-bc29-b79516fd3257',
'CurrencyCode' => 'EUR',
'TotalGrossAmountCents' => 1337,
'TotalNetAmountCents' => 1337,
],
'Reference' => '2fad9b1b-a2d3-455c-bc29-b79516fd3257-random-uuid-hex',
'Description' => '2fad9b1b-a2d3-455c-bc29-b79516fd3257-random-uuid-hex',
],
];
$this->assertEquals($expectedData, $this->request->getData());
Expand Down

0 comments on commit 80c8794

Please sign in to comment.