These are chat archives for CORE-POS/IS4C

27th
Jun 2016
Finn
@thefinn93
Jun 27 2016 20:41
okay, more questions
how should my code be called?
eg
should i set a parser for PAX or something, which triggers a card transaction?
Andy Theuninck
@gohanman
Jun 27 2016 20:42
That sounds sensible enough to me
Finn
@thefinn93
Jun 27 2016 20:42
okay
then when I've got a successful transaction, how do i register that?
i've tried a couple of ways, with different failure modes in each one
i tried directly updating the database, using some code i found in.... somewhere in lib/ i think
which works, makes it show the $0 total
but it doesn't realize that the transaction is over
doing 0CA or similar works
Andy Theuninck
@gohanman
Jun 27 2016 20:44
Right
Finn
@thefinn93
Jun 27 2016 20:44
soo i figure i'm not calling something
or perhaps i should just be calling some function that will handle it all for me?
idk
Andy Theuninck
@gohanman
Jun 27 2016 20:47
Not the most readable example in the world, but you can force the main page to run an additional command https://github.com/CORE-POS/IS4C/blob/master/pos/is4c-nf/plugins/Paycards/gui/PaycardEmvSuccess.php#L98-L116 - e.g., redirect to pos2.php?reginput=TO&repeat=1 is equivalent to manually keying in TO for "tender out". Sending 0CA would work to albeit with an extra cash lineitem
Finn
@thefinn93
Jun 27 2016 20:47
ah cool ok
ah crap now i lost my database update code
Andy Theuninck
@gohanman
Jun 27 2016 20:50
You should be able to just call TransRecord::addtender
Finn
@thefinn93
Jun 27 2016 20:50
k
ah yeah i think that's what i was doing
do i only wanna call TO if they've paid at least CoreLocal::get('amtdue')?
or can i call that after receiving money regardless of how much is left to pay?
Andy Theuninck
@gohanman
Jun 27 2016 20:53
It shouldn't matter; if there's still balanced owed it just won't end the transaction
Finn
@thefinn93
Jun 27 2016 20:53
cool
Finn
@thefinn93
Jun 27 2016 21:00
Woah
it worked!
thanks <3
Andy Theuninck
@gohanman
Jun 27 2016 21:00
glad to hear it
Finn
@thefinn93
Jun 27 2016 21:01
i initially didn't realize TransRecord::addtender wanted a negative value for a payment
so i had a few seconds going wtf
this is exciting. Just need to clean up some papercuts then i'm ready to commit the pax module as an MVP
proly wont PR it yet, since I want to add support for things like paying other than the full amount on a card, EMV, signature collection.....
Andy Theuninck
@gohanman
Jun 27 2016 21:04
There's no rush from my perspective
Finn
@thefinn93
Jun 27 2016 21:05
yeah, i guess i'm just happy to be past the point of "I've never had a successful transaction" and into the "I just have a giant list of bugs to clean up"
which, tbh, isn't that giant