-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ajout d'un cas de test sur la classe paybox
- Loading branch information
Showing
1 changed file
with
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,29 @@ protected function generateDateProvider() | |
<input type="hidden" name="PBX_HMAC" value="6391DD0A5051FEC38C0B5C2A016FB98B3423BF40FDA30213752F07F1AC4FB79F9B19BFF4C797736F7B8796DDBEFC8EAF63BE47B0F337C28D11CABA4280FF3FE0"> | ||
<button type="submit" class="button button--call-to-action paiement">Régler par carte</button> | ||
</form> | ||
EOF; | ||
|
||
$avecBilling = <<<EOF | ||
<form method="POST" action="https://preprod-tpeweb.paybox.com/cgi/MYchoix_pagepaiement.cgi"> | ||
<input type="hidden" name="PBX_SITE" value="1999888"> | ||
<input type="hidden" name="PBX_RANG" value="32"> | ||
<input type="hidden" name="PBX_IDENTIFIANT" value="110647233"> | ||
<input type="hidden" name="PBX_TOTAL" value="2500"> | ||
<input type="hidden" name="PBX_DEVISE" value="978"> | ||
<input type="hidden" name="PBX_LANGUE" value="FRA"> | ||
<input type="hidden" name="PBX_CMD" value="TEST Paybox"> | ||
<input type="hidden" name="PBX_PORTEUR" value="[email protected]"> | ||
<input type="hidden" name="PBX_RETOUR" value="total:M;cmd:R;autorisation:A;transaction:T;status:E"> | ||
<input type="hidden" name="PBX_HASH" value="SHA512"> | ||
<input type="hidden" name="PBX_TIME" value="2018-03-02T20:20:19+01:00"> | ||
<input type="hidden" name="PBX_SOURCE" value="HTML"> | ||
<input type="hidden" name="PBX_TYPEPAIEMENT" value="CARTE"> | ||
<input type="hidden" name="PBX_TYPECARTE" value="CB"> | ||
<input type="hidden" name="PBX_SHOPPINGCART" value="<?xml version="1.0" encoding="utf-8"?><shoppingcart><total><totalQuantity>1</totalQuantity></total></shoppingcart>"> | ||
<input type="hidden" name="PBX_BILLING" value="<?xml version="1.0" encoding="utf-8"?><Billing><Address><FirstName>Jean</FirstName><LastName>Maurice</LastName><Address1>20 rue des fleurs</Address1><ZipCode>75003</ZipCode><City>Paris</City><CountryCode>250</CountryCode></Address></Billing>"> | ||
<input type="hidden" name="PBX_HMAC" value="FAC38D4D5393F54D5AB200CF37A87CAA086BBEBD424236A78DDF8006A57CF0E105E2C54F5365794E1B412B9D56ADE614D0ED709C146FCAE6F5F3A304B7394ADE"> | ||
<button type="submit" class="button button--call-to-action paiement">Régler par carte</button> | ||
</form> | ||
EOF; | ||
|
||
$urlRetour = <<<EOF | ||
|
@@ -81,6 +104,7 @@ protected function generateDateProvider() | |
$testIdentifiant = '110647233'; | ||
|
||
$billingEmpty = new PayboxBilling('', '', '', '', '', ''); | ||
$billing = new PayboxBilling('Jean', 'Maurice', '20 rue des fleurs', '75003', 'Paris', 250); | ||
|
||
return [ | ||
[ | ||
|
@@ -99,6 +123,22 @@ protected function generateDateProvider() | |
'paybox_billing' => $billingEmpty, | ||
'expected' => $casGeneral, | ||
], | ||
[ | ||
'case' => 'Avec un billing', | ||
'domain_server' => $preprodDomainServer, | ||
'secret_key' => $preprodTestSecretKey, | ||
'site' => $testSite, | ||
'rang' => $testRang, | ||
'identifiant' => $testIdentifiant, | ||
'current_date' => new \DateTimeImmutable('2018-03-02 20:20:19'), | ||
'callback' => function(TestedClass $paybox) { | ||
$paybox->setTotal(2500); | ||
$paybox->setCmd('TEST Paybox'); | ||
$paybox->setPorteur('[email protected]'); | ||
}, | ||
'paybox_billing' => $billing, | ||
'expected' => $avecBilling, | ||
], | ||
[ | ||
'case' => 'URL de retour', | ||
'domain_server' => $preprodDomainServer, | ||
|