久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在付款捕獲后調(diào)用 Magento 事件觀察器

Calling a Magento event Observer AFTER payment capture(在付款捕獲后調(diào)用 Magento 事件觀察器)
本文介紹了在付款捕獲后調(diào)用 Magento 事件觀察器的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我正在嘗試在訂單創(chuàng)建后調(diào)用觀察員,并在付款后被捕獲.到目前為止,我已經(jīng)嘗試過(guò);checkout_submit_all_after,sales_order_payment_place_end,sales_order_place_after,sales_order_payment_pay,sales_order_payment_capture,sales_order_payment_transaction_save_after

Im trying to call an Observer after the order has been created, and AFTER payment has been captured. So far I've tried; checkout_submit_all_after, sales_order_payment_place_end, sales_order_place_after, sales_order_payment_pay, sales_order_payment_capture, sales_order_payment_transaction_save_after

只是列舉主要的.我還在 dispatchEvent() 中記錄了所有事件調(diào)度,但沒(méi)有發(fā)現(xiàn)任何突出的東西,只有在我需要它時(shí)才會(huì)被觸發(fā).我遇到的問(wèn)題是訂單的狀態(tài)始終是付款待處理"或在此之前的狀態(tài);這意味著我不知道訂單會(huì)失敗還是成功.

Just to name the main ones. I've also logged all Event Dispaches inside dispatchEvent() but found nothing that stands out and is only fired when i need it. the issue i'm having is that the status of the order is always ether 'Payment Pending' or something that predated this; meaning that i don't know whether the order will fail or succeed.

我的目標(biāo)是僅在成功的訂單上觸發(fā)一個(gè)函數(shù).謝謝.

My aim, is to fire a function only on successful orders. thanks.

推薦答案

經(jīng)過(guò)多次測(cè)試,我發(fā)現(xiàn)以下 Observer 可以解決問(wèn)題;

after much more testing i found the following Observer to do the trick;

checkout_onepage_controller_success_action

這僅返回訂單 ID,所以;

This returns just the order id, so;

$order_id = $observer->getData('order_ids');
$order = Mage::getModel('sales/order')->load($order_id);

并且您看到訂單狀態(tài)為處理中"并且付款已批準(zhǔn)(或未批準(zhǔn)).

and you see that the order status is 'processing' and the payment is aproved (or not).

這篇關(guān)于在付款捕獲后調(diào)用 Magento 事件觀察器的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個(gè)表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動(dòng)填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 碰碰视频 | 日韩三级 | 国产精品视频导航 | 亚洲视频在线一区 | 国产精品久久久久久福利一牛影视 | 日韩欧美国产精品 | 久久福利网站 | 精品国产青草久久久久福利 | 中文字幕在线一区二区三区 | 找个黄色片 | 成人小视频在线观看 | 久久久夜 | 亚洲成人一二区 | 国产有码 | 激情六月天 | 午夜精品影院 | 美日韩免费视频 | 色婷婷综合久久久中文字幕 | 看片国产| 免费a v网站 | 久久精品这里精品 | 午夜小视频在线播放 | 日韩欧美在线一区 | 国产精品亚洲精品日韩已方 | 国产免费黄网 | 国产重口老太伦 | 久久久国产一区二区三区 | 91视频精选 | 一级做受毛片免费大片 | 狠狠草视频 | 美女一级毛片 | 午夜视频在线免费观看 | 中文字幕伊人 | 欧美一级免费观看 | 日韩在线观看 | www.久久| 成人性生交大片 | 久久成人一区 | 亚洲视频国产视频 | 国产精品毛片一区二区在线看 | 人人人人人爽 |