diff --git a/src/Payutc/Service/POSS3.php b/src/Payutc/Service/POSS3.php index 78c19f6..e144a19 100644 --- a/src/Payutc/Service/POSS3.php +++ b/src/Payutc/Service/POSS3.php @@ -137,7 +137,9 @@ public function transaction($fun_id, $badge_id, $obj_ids) { } // Création de la transaction, validée immédiatement - Transaction::createAndValidate($buyer, $this->user(), $this->application()->getId(), $fun_id, $objects); + $tr = Transaction::createAndValidate($buyer, $this->user(), + $this->application()->getId(), + $fun_id, $objects); // Retourner les infos sur l'utilisateur $msg = $buyer->getMsgPerso($fun_id); @@ -145,7 +147,8 @@ public function transaction($fun_id, $badge_id, $obj_ids) { return array("firstname"=>$buyer->getFirstname(), "lastname"=>$buyer->getLastname(), "solde"=>$buyer->getCredit(), - "msg_perso"=>$msg); + "msg_perso"=>$msg, + "transaction_id"=>$tr->getId()); } public function getImage64($img_id, $outw = 0, $outh = 0) diff --git a/tests/Payutc/Service/Poss3RwdbTest.php b/tests/Payutc/Service/Poss3RwdbTest.php index fb22ab2..e16a4b5 100644 --- a/tests/Payutc/Service/Poss3RwdbTest.php +++ b/tests/Payutc/Service/Poss3RwdbTest.php @@ -49,7 +49,8 @@ public function testTransaction() 'firstname' => 'Thomas', 'lastname' => 'Recouvreux', 'solde' => $solde-280, - 'msg_perso' => 'http://payutc.github.io' + 'msg_perso' => 'http://payutc.github.io', + 'transaction_id' => 14 ); $this->assertEquals($o, $r->body); $this->assertEquals(200, $r->code); @@ -108,7 +109,8 @@ public function testTransactionWithQuanityAndReductions() 'firstname' => 'Thomas', 'lastname' => 'Recouvreux', 'solde' => $solde-760, - 'msg_perso' => 'http://payutc.github.io' + 'msg_perso' => 'http://payutc.github.io', + 'transaction_id' => 14 ); $this->assertEquals($o, $r->body); $this->assertEquals(200, $r->code);