Skip to content

Commit

Permalink
fix: vpos to card rename
Browse files Browse the repository at this point in the history
  • Loading branch information
bernard-ng committed Oct 15, 2024
1 parent 3abdc21 commit ff21017
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
10 changes: 4 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This changelog references the relevant changes (bug and security fixes) done

## 2.0.1
- Fixed: vpos urls for production and test environments in `Environment`

### 2.0.0
### 2.0.x
- Rename: vpos to card
- Fixed: vpos urls for production and test environments in `Environment`
- Added: `isSuccessful` to `Transaction` class
- Breaking Change: `pay` supports both `vpos` and `mobile` request
- Added: `vpos` and `mobile` method to `Client`
Expand All @@ -15,8 +15,6 @@ This changelog references the relevant changes (bug and security fixes) done
- Added: Support for `check`, `vpos`, `mobile` urls in `Environment`,
- Removed: `getPaymentBaseUrl` method in `Environment`

### 1.0.1
### 1.0.x
- Fixed: allow `$message` to be an empty string in `PaymentResponse`

### 1.0.0
- Initial release
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function card(CardRequest $request): CardResponse
/** @var CardResponse $response */
$response = $this->getMappedData(
type: CardResponse::class,
data: $this->http->request('POST', $this->environment->getVposAskUrl(), [
data: $this->http->request('POST', $this->environment->getCardPaymentUrl(), [
'json' => $request->getPayload(),
])->toArray()
);
Expand Down
10 changes: 1 addition & 9 deletions src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum Environment: string
case LIVE = 'prod';
case SANDBOX = 'dev';

public function getVposAskUrl(): string
public function getCardPaymentUrl(): string
{
return match ($this) {
self::LIVE => 'https://cardpayment.flexpay.cd/v1.1/pay',
Expand All @@ -29,14 +29,6 @@ public function getMobilePaymentUrl(): string
};
}

public function getVposPaymentUrl(string $orderNumber): string
{
return match ($this) {
self::LIVE => sprintf('https://cardpayment.flexpay.cd/vpos/pay/%s', $orderNumber),
self::SANDBOX => sprintf('https://beta-cardpayment.flexpay.cd/vpos/pay/%s', $orderNumber),
};
}

public function getCheckStatusUrl(string $orderNumber): string
{
return match ($this) {
Expand Down
4 changes: 2 additions & 2 deletions tests/EnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public function testGetCardPaymentUrl(): void
{
$this->assertEquals(
'https://cardpayment.flexpay.cd/v1.1/pay',
$this->prod->getVposAskUrl()
$this->prod->getCardPaymentUrl()
);
$this->assertEquals(
'https://beta-cardpayment.flexpay.cd/v1.1/pay',
$this->dev->getVposAskUrl()
$this->dev->getCardPaymentUrl()
);
}

Expand Down

0 comments on commit ff21017

Please sign in to comment.