Index: trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js |
— | — | @@ -53,7 +53,6 @@ |
54 | 54 | var cvv; |
55 | 55 | |
56 | 56 | function PopupCVV() { |
57 | | - payflowGatewayCVVExplain = 'ME ME Me'; |
58 | 57 | cvv = window.open("", 'cvvhelp','scrollbars=yes,resizable=yes,width=600,height=400,left=200,top=100'); |
59 | 58 | cvv.document.write( payflowproGatewayCVVExplain ); |
60 | 59 | cvv.focus(); |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -580,10 +580,6 @@ |
581 | 581 | |
582 | 582 | $queryString = implode( '&', $query ); |
583 | 583 | |
584 | | - /* FOR TESTING: This is what the NV pair looks like, with string length included |
585 | | - $payflow_query = "TRXTYPE=$payflow_data[trxtype]&TENDER=$payflow_data[tender]&USER=$payflow_data[user]&VENDOR=$payflow_data[vendor]&PARTNER=$payflow_data[partner]&PWD=$payflow_data[password]&ACCT=$data[card_num]&EXPDATE=$data[expiration]&AMT=$data[amount]&FIRSTNAME=$data[fname]&LASTNAME=$data[lname]&STREET=$data[street]&ZIP=$data[zip]&INVNUM=$payflow_data[order_id]&CVV2=$data[cvv]&CURRENCY=$data[currency]&VERBOSITY=$payflow_data[verbosity]&CUSTIP=$payflow_data[user_ip]"; |
586 | | - */ |
587 | | - |
588 | 584 | $payflow_query = $queryString; |
589 | 585 | |
590 | 586 | // assign header data necessary for the curl_setopt() function |
— | — | @@ -692,7 +688,7 @@ |
693 | 689 | } elseif( ( $errorCode == '4' ) ) { |
694 | 690 | $this->fnPayflowDisplayOtherResults( $responseMsg ); |
695 | 691 | } elseif( ( $errorCode == '5' ) ) { |
696 | | - $this->fnPayflowDisplayPending( $responseMsg ); |
| 692 | + $this->fnPayflowDisplayPending( $data, $responseArray, $responseMsg ); |
697 | 693 | } |
698 | 694 | |
699 | 695 | }// end display results |
— | — | @@ -835,9 +831,26 @@ |
836 | 832 | // display response message |
837 | 833 | $wgOut->addHTML( '<h3 class="response_message">' . $declinedDefault . $responseMsg . '</h3>' ); |
838 | 834 | } |
839 | | - function fnPayflowDisplayPending( $responseMsg ) { |
| 835 | + |
| 836 | + function fnPayflowDisplayPending( $data, $responseArray, $responseMsg ) { |
840 | 837 | global $wgOut; |
| 838 | + |
| 839 | + $transaction = ''; |
841 | 840 | |
| 841 | + // push to ActiveMQ server |
| 842 | + // include response message |
| 843 | + $transaction['response'] = $responseMsg; |
| 844 | + // include date |
| 845 | + $transaction['date'] = time(); |
| 846 | + // send both the country as text and the three digit ISO code |
| 847 | + $transaction['country_name'] = $countries[$data['country']]; |
| 848 | + $transaction['country_code'] = $data['country']; |
| 849 | + // put all data into one array |
| 850 | + $transaction += array_merge( $data, $responseArray ); |
| 851 | + |
| 852 | + // hook to call stomp functions |
| 853 | + wfRunHooks( 'gwPendingStomp', array( &$transaction ) ); |
| 854 | + |
842 | 855 | $thankyou = wfMsg( 'payflowpro_gateway-thankyou' ); |
843 | 856 | |
844 | 857 | // display response message |
Index: trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php |
— | — | @@ -61,6 +61,7 @@ |
62 | 62 | * |
63 | 63 | */ |
64 | 64 | $wgHooks['gwStomp'][] = 'sendSTOMP'; |
| 65 | +$wgHooks['gwPendingStomp'][] = 'sendPendingSTOMP'; |
65 | 66 | |
66 | 67 | |
67 | 68 | /* |
— | — | @@ -95,6 +96,38 @@ |
96 | 97 | return true; |
97 | 98 | } |
98 | 99 | |
| 100 | +/* |
| 101 | +* Hook to send transaction information to ActiveMQ server |
| 102 | +*/ |
| 103 | +function sendPendingSTOMP($transaction) { |
| 104 | + global $wgOut; |
| 105 | + global $wgStompServer, $wgPendingStompQueueName; |
| 106 | + |
| 107 | + $queueName = isset ( $wgStompQueueName ) ? $wgStompQueueName : 'pending'; |
| 108 | + |
| 109 | + // include a library |
| 110 | + require_once("Stomp.php"); |
| 111 | + |
| 112 | + $message = json_encode(createQueueMessage($transaction)); |
| 113 | + |
| 114 | + // make a connection |
| 115 | + $con = new Stomp($wgStompServer); |
| 116 | + |
| 117 | + // connect |
| 118 | + $con->connect(); |
| 119 | + |
| 120 | + // send a message to the queue |
| 121 | + $result = $con->send("/queue/$queueName", $message, array('persistent' => 'true')); |
| 122 | + |
| 123 | + if (!$result) { |
| 124 | + wfDebugLog('activemq_stomp', 'Send to Pending Q failed for this message: ' . $message); |
| 125 | +} |
| 126 | + |
| 127 | + $con->disconnect(); |
| 128 | + |
| 129 | + return true; |
| 130 | +} |
| 131 | + |
99 | 132 | /** |
100 | 133 | * Assign correct values to the array of data to be sent to the ActiveMQ server |
101 | 134 | * TODO: include optout and comments option in the donation page |