This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mage_Webhook_Model_Formatter_Factory_Json implements Mage_Webhook_Model_Formatter_Factory_Interface | |
{ | |
const XML_PATH_DEFAULT_OPTIONS = 'global/webhook/formats/json/options/'; | |
protected $_config; | |
public function __construct(Mage_Core_Model_Config $config) | |
{ | |
$this->_config = $config; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mage_Webhook_Model_Formatter_Json implements Mage_Webhook_Model_Formatter_Interface | |
{ | |
const CONTENT_TYPE = 'application/json'; | |
const FORMAT = "json"; | |
/** | |
* @param Mage_Webhook_Model_Event_Interface $event | |
* @return Mage_Webhook_Model_Message | |
*/ | |
public function format(Mage_Webhook_Model_Event_Interface $event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Mage_Webhook_Model_Formatter_Interface | |
{ | |
const CONTENT_TYPE_HEADER = 'Content-type'; | |
/** | |
* @param Mage_Webhook_Model_Event_Interface $event | |
* @return Mage_Webhook_Model_Message | |
*/ | |
public function format(Mage_Webhook_Model_Event_Interface $event); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<global> | |
<webhook> | |
<webhooks> | |
<customer> | |
<deleted> | |
<label>Customer Deleted</label> | |
</deleted> | |
</customer> | |
</webhooks> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<mapping to="Mage_Webapi"> | |
<parent id="customer/get"> | |
<topic id="customer/deleted"/> | |
</parent> | |
</mapping> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<acl> | |
<resources> | |
<resource id="Magento_Webapi"> | |
<resource id="customer" title="Manage Customers" module="Magento_Customer"> | |
<resource id="customer/create" title="Create" sortOrder="10" /> | |
<resource id="customer/get" title="Retrieve" sortOrder="20" /> | |
<resource id="customer/update" title="Update" sortOrder="30" /> | |
<resource id="customer/delete" title="Delete" sortOrder="40" /> | |
</resource> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mage_Customer_Model_Customer_Webhook_Observer | |
{ | |
public function dispatchCustomerDeletedEvent($observer) | |
{ | |
$customer = $observer->getEvent()->getCustomer(); | |
try { | |
Mage::helper('Mage_Webhook_Helper_Data')->dispatchEvent('customer/deleted', array('customer' => $customer)); | |
} catch (Exception $e) { | |
Mage::logException($e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<global> | |
<events> | |
<customer_delete_commit_after> | |
<observers> | |
<customer_deleted_event> | |
<class>Mage_Customer_Model_Customer_Webhook_Observer</class> | |
<method>dispatchCustomerDeletedEvent</method> | |
</customer_deleted_event> | |
</observers> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
] NOTE: For up-to-date information that came to light after these Release Notes [ | |
] were added to this build, go to: [ | |
] [ | |
] http://www.magentocommerce.com/knowledge-base/entry/ee-113-later-release-notes [ | |
] [ | |
] In the future, you should always get Release Notes from magentocommerce.com. [ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//download the complete java code sample from https://github.com/paypal/paypal-access | |
/** | |
* Gets Access token by going to token service. Code is left blank so that user can fill it up manually. | |
* | |
* @return - Access token | |
*/ | |
private static String getAccessToken(String authorizationCode) { | |
StringBuilder tokenUrl = new StringBuilder( | |
"https://api.paypal.com/v1/identity/openidconnect/tokenservice"); |