function prepareMessage($options = array()) { $options = array_merge($this->getOptions(), $options); if (!isset($options['_payment_ID'])) { return false; } //Show other recorded info $text_options['skip_prefix'] = "plugin_AMPPayment_"; $message = $this->udm->output('Text', $text_options); //Generate Receipt if (!($receipt = new PaymentReceipt($this->dbcon, $options['_payment_ID']))) { return false; } $message .= $receipt->output(); return $message; }
function test_readPayment() { $payment = new MockPayment($this); $payment->setReturnValue( 'readData', true ); $payment->setReturnValue( 'getData', array('Amount'=>'5', 'description'=>'shiny object', 'payment_item_ID'=>105, 'Status'=>'test', 'Payment_Type'=>'MonopolyMoney' )); $payment->expectCallCount( 'getData',2); $payment->setReturnValue( 'getData', '190', array('user_ID')); #$$payment->expectOnce( 'getData', array('user_ID') ); $cc = new MockPaymentType_CreditCard( $this ); $cc->setReturnValue( 'getData', array('Number'=>'56', 'Type'=>'Diner', 'Expiration'=>'20/02') ); $cc->expectOnce( 'getData', array()); $payment->paymentType = &$cc; $testobj = new PaymentReceipt( $this->dbcon); $testobj->payment = &$payment; $testobj->readPayment(1); $payment->tally(); $cc->tally(); }