Jump to content

souzadavi

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

10 Good

About souzadavi

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. souzadavi

    Callback confirm payment twice in MOIP

    The callback file give the log duplicated, look couple of log in moip_wmcs_boleto_direto.txt.......... Yesterday a talk to the gateway payment, and they said the callback file is calling twice or more... they will try to fix it.... thanks for your attention Kian ----------------------------------- Status: PAID Data: 26/06/2018 04:30:29Valor Adicionado na Invoice:10531 Adicionado o Pagamento ----------------------------------- NAME GATEWAYArray ( remove the parameters [] ) Data: 26/06/2018 04:30:29 PAID1 ----------------------------------- Status: PAID Data: 26/06/2018 04:30:29Valor Adicionado na Invoice:10531 Adicionado o Pagamento ----------------------------------- NAME GATEWAYArray ( remove the parameters [] ) Data: 26/06/2018 04:30:29 PAID1 ----------------------------------- Status: PAID Data: 28/06/2018 03:20:10Valor Adicionado na Invoice:10637 Adicionado o Pagamento ----------------------------------- NAME GATEWAYArray ( remove the parameters [] ) Data: 28/06/2018 03:20:10 PAID1 ----------------------------------- Status: PAID Data: 28/06/2018 03:20:10Valor Adicionado na Invoice:10637 Adicionado o Pagamento ----------------------------------- NAME GATEWAYArray ( remove the parameters [] ) Data: 28/06/2018 03:20:10 PAID1
  2. souzadavi

    Callback confirm payment twice in MOIP

    Didn't work, the gateway still confirmed twice or more by WHMCS system... very strange!!! the deal is there no answers from whmcs team. if ($success) { if($status == "PAID"){ try{ $statusInvoice = Capsule::table('tblinvoices')->select('status')->where('id', '=', $invoiceId)->first(); if($statusInvoice->status == "Unpaid" && $success == true){ addInvoicePayment($invoiceId,$transactionId,$paymentAmount,$paymentFee,$gatewayParams["name"]); $status = false; $success = false; } }catch (\Exception $e) { echo "I couldn't get invoice status. {$e->getMessage()}"; } } }
  3. souzadavi

    Callback confirm payment twice in MOIP

    Kian, thanks to write back, is much better how you said. I changed the code like you said. I will wait to seed if there is any change.. But is very strange because I call only once. addInvoicePayment() thanks
  4. Hello I did a small script to work with gateway MOIP (pagamento direto), but one thing very strange is happening, the payment it's confirmed twice or more by WHMCS system, the full script is at: https://bitbucket.org/linknacional/moip_boleto_direto/src/master/modules/gateways/moip_whmcs_boleto_direto/callback/moip_whmcs_boleto_direto.php The payment confirmation it's happening at same time, date, hour and seconds is the same. I tried supporting from WHMCS team, but without success. Any help here will be very nice. Below is the code wich getting payment duplication. I can't find why the payment is duplicating. if($status == "PAID"){ try{ foreach (Capsule::table('tblinvoices')->select('status')->where('id', '=', $invoiceId)->get() as $statusInvoice){ if($statusInvoice->status == "Unpaid" && $success == true){ addInvoicePayment($invoiceId,$transactionId,$paymentAmount,$paymentFee,$gatewayParams["name"]); $status = false; $success = false; } } }catch (\Exception $e) { echo "I couldn't get invoice status. {$e->getMessage()}"; } } PS: attached the invoice transaction log. THANKs in advance...
  5. I fixed it with whmcs help, thanks guys.... the solution was: $myclientcustomfields = array(); foreach($params["clientdetails"]["customfields"] as $key => $value){ $myclientcustomfields[$value['id']] = $value['value']; } $mycustomFieldValue = $myclientcustomfields[$params['customFieldSaved']]; I really don know why the whmcs api docs say one thing and in the real world, another thing happen... but the solution to get the customfields values was this for me....
  6. I got it!! thanks for whmcs support team and programmers friends.... the solution was: I created a function: function get_customfield_id() { $fields = mysql_query("SELECT id, fieldname FROM tblcustomfields WHERE type = 'client';"); if (!$fields) { return '<br><br>Erro geral no banco de dados'; } elseif (mysql_num_rows($fields) >= 1) { $dropFieldArray = array(); $tutorial = '<br><br>Para sua comodidade, listamos abaixo os campos que podem ser usados e seus IDs. Basta pegar o ID e preencher acima. <ul>'; while ($field = mysql_fetch_assoc($fields)) { // the dropdown field type renders a select menu of options $dropFieldArray[$field['id']] = $field['fieldname']; } return $dropFieldArray; } else { return array('0' => 'nada definido'); } } and into _config() method i just give a call to this function like this: 'birthday' => array( 'FriendlyName' => 'Birthday Date', 'Type' => 'dropdown', 'Options' =>get_customfield_id(), 'Description' => 'Birthday date type the array number here', ),
  7. Hello how do I get the customfields values in gateway modules? Can I get the value of customFields by name? I did a lot of tries, but I didn't figured out... In Gateway config module I should set the ID of each customfield. Exemplo: ID Cutomer Field: 2 | Name: CPF ID Cutomer Field: 15 | Name: WhatsApp ID Cutomer Field: 19 | Name: moipCC print_r($params["clientdetails"]["customfields"]); Array ( [0] => Array ( [id] => 2 [value] => 222745448840 ) [1] => Array ( [id] => 15 [value] => 16994513223 ) [2] => Array ( [id] => 19 [value] => ) How do I get the value of ID Customer Field 15 without know the Array key. Thanks
  8. Hello? Any one??? thanks
  9. souzadavi

    Return array creditcard payment

    The answer of the whmcs support: John KiplingStaff Merchant gateways can leverage a callback file to handle out-of-sequence payments. You can use the callback file per the example in the gateway module: https://github.com/WHMCS/sample-gateway-module/blob/master/modules/gateways/callback/gatewaymodule.php You'd just need to pass the URL to the callback file to your payment gateway in the _capture function, so that it knows to send the payment details to the callback file when required. Related documentation: https://developers.whmcs.com/payment-gateways/callbacks/ In the instances when payment is held for manual review, you might like to add a message to the invoice letting the customer know that payment has been processed but is pending review. This can be done by redirecting the client to the following URL after payment: .$CONFIG["SystemURL"].'/viewinvoice.php?id='.$invoiceid.'&pendingreview=true"
  10. YESSSS.... Olá Edvan, obrigado pelo retorno... É exatamente isso que eu preciso...
  11. No one?? function GATEWAYNAME_config() { return array( // the dropdown field type renders a select menu of options 'dropdownField' => array( 'FriendlyName' => 'Dropdown Field', 'Type' => 'dropdown',//// HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? 'Options' => $params["customfield"], 'Description' => 'Choose one', )); } HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? I would like to show a dropdownfield in config of gateway, the custom customers fields is like birthday, brazilian document numbers etc. I set it by number in a text box, is very hard, because is doubt.. I would like to bring it automatic with dropdown (select and option) at gateway config in admin. is it clear? i hope so... Thanks
  12. Hello, I'm trying to create a payment module with credit card, is almost done, I only have a doubts about the validation of payment, I need to do it on method capture or create a callback for that module? Also sometimes the credit card has another return, analyzing, or waiting, i tried to setup other status without success. Sometime the credit card need sometime to confirm the payment, so how do I setup it on capture method or callback file? Also the documentation at: https://developers.whmcs.com/payment-gateways/merchant-gateway/ show return array( 'status' => ($data->success == 1) ? 'success' : 'declined', 'rawdata' => $data, 'transid' => $data->transaction_id, 'fees' => $data->fees, ); thanks
  13. Hello I'm trying to create a gateway payment integrate with whmcs credit card default system. In Gateway payment configs (admin/configgateways.php) I would like to set an option of each customfields with dropbox than input text. check the image: https://prnt.sc/jffxs1 I need to set it on method getwayname_config() check the image: https://prnt.sc/jffyap function GATEWAYNAME_config() { return array( // the dropdown field type renders a select menu of options 'dropdownField' => array( 'FriendlyName' => 'Dropdown Field', 'Type' => 'dropdown',//// HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? 'Options' => $params["clientdetails"]["customfields"], 'Description' => 'Choose one', )); } How to populate the dropdown field on admin payment gateway config with customsfields names? any help will great!!! thanks
  14. Hello, there is anyone available to build this: https://requests.whmcs.com/topic/admin-notes I really need it... I would like to pay for the hours spend. thanks
  15. souzadavi

    New homepage file

    I got a solution from WHMCS ticket!!! <?php use WHMCS\Database\Capsule; use WHMCS\View\Menu\Item as MenuItem; define("CLIENTAREA", true); // Set the template you want to use for the custom page BEFORE init.php is called $GLOBALS['_REQUEST']['systpl'] = 'five'; require("init.php"); // WHATEVER YOU ARE DOING IN HERE // Set the session back to the default template: $GLOBALS['_SESSION']['Template'] = 'six'; $ca->output();
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines