Virtuemart not sending new order "pending status" email - joomla

When i somebody create a new order that the status is pending, the virtuemart does not send the email order.
It sends just if the status is confirmed, or any others.
Someone know what can it be?

Answer from https://forum.virtuemart.net/index.php?topic=126593.0
The problem before was, that the email was sent twice. So we removed
sending emails for orderstatus Pending. Orderstatus Pending means that
the customer put something on the cashdesk, but did not pay or confirm
the order.
The only solution I've found and use:
In file
components/com_virtuemart/helpers/shopfunctionsf.php
ctrl+f to
$orderstatusForShopperEmail = VmConfig::get('email_os_s',array('U','C','S','R','X'));
On next line add
$orderstatusForShopperEmail[] = "P";

In VirtueMart 3.4 it is again possible to receive an email for order status P, Pending, but only for the vendor.
The status "pending" is triggered once you hit the payment button and ends when the payment plugin sends a command to change the status into a new status like confirmed.
If in the time between these two processes something goes wrong the status will stay on pending.
For a successful payment the status should never be P "pending" even though it is possible to choose it in that way.
For payment methods that do not process the payment immediately like "invoice", meaning waiting for a payment via bank transfer or similar, status U "confirmed by shopper" should be used. It is often seen that in this case "Pending" is used, please don't do that.
Please rename "confirmed by shopper" into "my pending", so you got a status "pending" for stuck payments in the shop system, and a "my pending" for pending payments after a successful order process.
The latter status U will send emails to the vendor and shopper if you choose so in VM configuration, tab Orders (formerly called Email).

Related

How to handle new_chat_members when a user joined to telegram group with telegram bot?

I'm trying to send a message to user, who joined to a group, with my telegram bot. I add bot to the group and bot is admin in group. and I set the Group Privacy off. I get user with new_chat_member when user joined to group, but the message send to user infinitely. And the update which is for when a member join to group is pending.
if(isset($arrayMessage['message'])) {
if (isset($arrayMessage['message']['new_chat_member'])) {
$text= "hello!";
$url= "https://api.telegram.org/bot".$token."/sendMessage?chat_id=".$chat_id."&text=".$text;
file_get_contents($url);
}
}
I'll assume you are using long polling for this answer. When using the getUpdates method, it will keep retrieving the existing unconfirmed updates until you confirm them by using the offset parameter.
See enter link description here
If you do not confirm the updates, you will keep receiving the same update, thus the infinite messages.

.NET Braintree : Transactions sent as charged for settlement never settled

I am integrating Braintree payment option in a site, currently in sand box. The setup was easy, docs helped a lot but I am confused about one thing.
When I submit a transaction as a settlement, it processes the transaction and also shows in transactions in the control panel but it is never settled. I want to know how can I be sure if the customer was charged so I can deliver the service he requested.
If an amount does not settle, and I have delivered the product then It will be a problem for my client.
It is showing all the transactions as this, including the paypal ones.
Please see the attached screen shot.
The code I am using:
var request = new TransactionRequest
{
Amount = 33.22,
PaymentMethodNonce = nonce,
OrderId = CustomerOrderId,
Options = new TransactionOptionsRequest
{
SubmitForSettlement = true
}
};
Usually BrainTree Settles all the transaction with in a time period(it may take a day).
submitted_for_settlement: This means a transaction has made which would get settled, but not immediately when the transaction occurs.
The real settlement happens under Disbursement, this runs daily and here they will disburse all the transactions which are in submitted_for_settlement status and during this process only
I would suggest you to add Disbursement Webhook in to your application, this helps you to get all the details of the disbursement from braintree.
Don't forget to save the Disbursement ID value, which you will get from disbursement webhook ONLY. We cannot see the disbursement ID in their console.
Use of Disbursement ID - this ID will be in the buyers CC Billing
To implement this please follow this docs.
https://developers.braintreepayments.com/reference/general/webhooks/disbursement/dotnet
https://developers.braintreepayments.com/guides/webhooks/parse/dotnet

How to stop order processing of same order once if order status is canceled in Magento?

How to stop processing of the same order once the order is cancelled ?
I'm using paypal payment method,While placing the order from paypal if I cancel the order from the paypal gateway (Cancel and return),it set the order status as cancelled and redirected to the cart page, but again if I press browser back button, then it redirects me back to the paypal payment gateway page,and the payment is done succesfully.My order status history shows as Pending Payment,Canceled,Order Processing,Preparing for delivery.
How can I stop this?
I tried to update the order status using event and observer, but still I unable to stop this processing.
$order = $observer->getEvent()->getPayment()->getOrder();
$order=Mage::getModel('sales/order')->load($order->getEntityId());
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true);
$order->setStatus("canceled");
$order->save();
i think problem with you status is change but the state is not changing try below code..
$order->setData('state', Mage_Sales_Model_Order::STATE_CANCELED);
$order->setStatus("canceled");
$history = $order->addStatusHistoryComment('', false);
$history->setIsCustomerNotified(false);
$order->save();

How Can I Use xmpp4r To Detect The Online/Offline Status Of A Given Jabber ID?

What is the proper xmpp4r way to know if a given contact is online before sending them a message?
Can you post sample xmpp4r code for doing this?
Here is my use case:
If contact online, send :normal message
Else, email contact
Here are things I have working code for:
Send messages of various types
Get a roster/contact list
Register a call back to detect changes in presence
However, I can't find a place that directly addresses a work flow like this:
Loop through each JID in your roster
If jid.is_online? == true, send IM
Else, send email
I've read that you should send a JID a message of type :headline and if that fails, you know the user is offline. In my tests, if the user is ONLINE, they'll receive a message of type headline. This is suboptimal, as users should only receive messages to read, not noise to determine online status.
I've read that on sign on, all of your contacts will bounce a presence status back at you, and that status is the sole indication that they are online - assuming that there isn't a disconnect or presence change you've yet to receive. So you should register a presence call back, record the initial users who ping you back, and then add or remove from the list based on your running roster presence callback.
If this is truly the way to do it:
Can I get some example code of how to collect all the "I'm here" presence confirmations on sign on via xmpp4r?
Why, oh why, was xmpp designed this way and why is this better than offering an "is_online_and_available" method?
So the answer here is adding a message call back and checking inside the block for the type:
m = Message.new(to, body)
cl.send(m)
cl.add_message_callback do |m|
if m.type == :error
puts "type: #{m.type}"
else
puts "not an error"
end
end
This requires threading as you have to be listening for the response.

I am trying to add a new gateway to CS-cart and it seems having troubles when i am sent back from the gateway

basically my script so far send values to the gateway then get redirected to CS cart .. in that page i grab the values returned and manipulate them.
i use fn finish and fn change order status to finish the order but no matter what i do i get a 404 page not found . i've tried redirecting to the order page but its creates a problem.
Here is the code i use when returning from gateway.
$StaTus_message = "<br>Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
$pp_response['customer_email'] = $_REQUEST['billing_cust_email'];
$pp_response['client_id'] = $_REQUEST['billing_cust_name'];
$pp_response['order_status'] = 'C';
$pp_response['reason_text'] = $StaTus_message;
fn_finish_payment($_REQUEST['Order_Id'], $pp_response);
fn_change_order_status($_REQUEST['Order_Id'], $pp_response['order_status']);
I know this is not a popular subject but i thought I'll give it a go.
Also I've being searching everywhere for documentation both at CS-cart's forum and the internet and couldn't find much.
Thanks in advanced.
Okay. So, the solution to that was exiting the script after the script sent the client to the gate way, and then upon re-enter using fn_change_order_status - to whatever you need, and then using fn_order_placement_routines to actually finalize the order and send email to client/merchant.
Hope that help people out there as I spent nearly 4 days to try and understand that.

Resources