Skip to content

Commit

Permalink
POSS3::transaction renvoie l'id de la transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
feuloren committed Dec 3, 2013
1 parent 196d1d7 commit 2150afa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/Payutc/Service/POSS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,18 @@ 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);

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)
Expand Down
6 changes: 4 additions & 2 deletions tests/Payutc/Service/Poss3RwdbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2150afa

Please sign in to comment.