Skip to content

Commit ca31701

Browse files
author
Florentin Garnier
committed
Integration of OSB endpoint
1 parent ee6caa3 commit ca31701

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Api/Api.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Api
2323
const ENDPOINT_SYSTEMPAY = 'SYSTEMPAY';
2424
const ENDPOINT_SCELLIUS = 'SCELLIUS';
2525
const ENDPOINT_CLICANDPAY = 'CLICANDPAY';
26+
const ENDPOINT_OSB = 'OSB';
2627

2728
/**
2829
* @var OptionsResolver
@@ -468,7 +469,7 @@ private function getModes(): array
468469

469470
private function getEndPoints(): array
470471
{
471-
return [null, self::ENDPOINT_SYSTEMPAY, self::ENDPOINT_SCELLIUS, self::ENDPOINT_CLICANDPAY];
472+
return [null, self::ENDPOINT_SYSTEMPAY, self::ENDPOINT_SCELLIUS, self::ENDPOINT_CLICANDPAY, self::ENDPOINT_OSB];
472473
}
473474

474475
private function getHashModes(): array
@@ -490,6 +491,10 @@ private function getUrl(): string
490491
return 'https://clicandpay.groupecdn.fr/vads-payment/';
491492
}
492493

494+
if (self::ENDPOINT_OSB === $this->config['endpoint']) {
495+
return 'https://secure.osb.pf/vads-payment/';
496+
}
497+
493498
return 'https://secure.payzen.eu/vads-payment/';
494499
}
495500

tests/Api/ApiTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,19 @@ public function provideCreateRequestUrl(): Generator
184184
],
185185
'https://scelliuspaiement.labanquepostale.fr/vads-payment/?vads_action_mode=INTERACTIVE&vads_page_action=PAYMENT&vads_payment_config=SINGLE&vads_return_mode=POST&vads_version=V2&vads_amount=1234&vads_currency=978&vads_trans_date=20200101120000&vads_trans_id=000001&vads_site_id=123456789&vads_ctx_mode=PRODUCTION&signature=p9TbeohlOZVPAmhEwfAlGxRJxFAKpNg5wYBSN9emuqs%3D',
186186
];
187+
188+
yield [
189+
[
190+
'endpoint' => Api::ENDPOINT_OSB,
191+
],
192+
[
193+
'vads_amount' => '1234',
194+
'vads_currency' => '978',
195+
'vads_trans_date' => '20200101120000',
196+
'vads_trans_id' => '000001',
197+
],
198+
'https://secure.osb.pf/vads-payment/?vads_action_mode=INTERACTIVE&vads_page_action=PAYMENT&vads_payment_config=SINGLE&vads_return_mode=POST&vads_version=V2&vads_amount=1234&vads_currency=978&vads_trans_date=20200101120000&vads_trans_id=000001&vads_site_id=123456789&vads_ctx_mode=PRODUCTION&signature=p9TbeohlOZVPAmhEwfAlGxRJxFAKpNg5wYBSN9emuqs%3D',
199+
];
187200
}
188201

189202
/**

0 commit comments

Comments
 (0)