From ad781e1f354a06c131f6c67b7b57f9879d484a0c Mon Sep 17 00:00:00 2001 From: nabiloo19 Date: Tue, 10 May 2022 11:55:12 +0300 Subject: [PATCH 1/4] New Webhooks Supported --- README.md | 141 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 82 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 04ac85b..145794f 100644 --- a/README.md +++ b/README.md @@ -211,95 +211,118 @@ You may find the supported [Webhook events](https://docs.salla.dev/docs/merchant #### Order Related Webhooks/Actions -| ** Action Name ** | ** Description ** | -|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------| -| [order.created](app/Actions/Order/Created.php) | This indicates a singular order has been created | -| [order.updated](app/Actions/Order/Updated.php) | Details, data and/or content of a specific order have been refreshed updated | -| [order.status.updated](app/Actions/Order/StatusUpdated.php) | Whenever there is an order status update, this is triggered | -| [order.cancelled](app/Actions/Order/Cancelled.php) | This happens when an order is cancelled | -| [order.refunded](app/Actions/Order/Refunded.php) | The refund action to refund the whole order is triggered. | -| [order.deleted](app/Actions/Order/) | This indicates an order has been deleted | -| [order.products.updated](app/Actions/Order/ProductsUpdated.php) | Order products is updated | -| [order.payment.updated](app/Actions/Order/PaymentUpdated.php) | A payment method has been updated | -| [order.coupon.updated](app/Actions/Order/CouponUpdated.php) | This is triggered whenever a Coupon is updated | -| [order.total.price.updated](app/Actions/Order/TotalPriceUpdated.php) | A total price of an order has been updated | -| [order.shipment.creating](app/Actions/Order/ShipmentCreating.php) | This indicates a new shipment is being created | -| [order.shipment.created](app/Actions/Order/ShipmentCreated.php) | This indicates a new shipment has been created | -| [order.shipment.cancelled](app/Actions/Order/ShipmentCancelled.php) | This indicates a an order shipment has been cancelled | -| [order.shipment.return.creating](app/Actions/Order/ShipmentReturnCreating.php) | This is triggered when a returned order shipment is being created | -| [order.shipment.return.created](app/Actions/Order/ShipmentReturnCreated.php) | This is triggered when a returned order shipment has been created | -| [order.shipment.return.cancelled](app/Actions/Order/ShipmentReturnCancelled.php) | This is triggered when a returned order shipment has been cancelled | -| [order.shipping.address.updated](app/Actions/Order/ShippingAddressUpdated.php) | Occurs when an Order shipping address is updated | +| ** Action Name ** | ** Description ** | +| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| [order.created](app/Actions/Order/Created.php) | This indicates a singular order has been created | +| [order.updated](app/Actions/Order/Updated.php) | Details, data and/or content of a specific order have been refreshed updated | +| [order.status.updated](app/Actions/Order/StatusUpdated.php) | Whenever there is an order status update, this is triggered | +| [order.cancelled](app/Actions/Order/Cancelled.php) | This happens when an order is cancelled | +| [order.refunded](app/Actions/Order/Refunded.php) | The refund action to refund the whole order is triggered. | +| [order.deleted](app/Actions/Order/) | This indicates an order has been deleted | +| [order.products.updated](app/Actions/Order/ProductsUpdated.php) | Order products is updated | +| [order.payment.updated](app/Actions/Order/PaymentUpdated.php) | A payment method has been updated | +| [order.coupon.updated](app/Actions/Order/CouponUpdated.php) | This is triggered whenever a Coupon is updated | +| [order.total.price.updated](app/Actions/Order/TotalPriceUpdated.php) | A total price of an order has been updated | +| [order.shipment.creating](app/Actions/Order/ShipmentCreating.php) | This indicates a new shipment is being created | +| [order.shipment.created](app/Actions/Order/ShipmentCreated.php) | This indicates a new shipment has been created | +| [order.shipment.cancelled](app/Actions/Order/ShipmentCancelled.php) | This indicates a an order shipment has been cancelled | +| [order.shipment.return.creating](app/Actions/Order/ShipmentReturnCreating.php) | This is triggered when a returned order shipment is being created | +| [order.shipment.return.created](app/Actions/Order/ShipmentReturnCreated.php) | This is triggered when a returned order shipment has been created | +| [order.shipment.return.cancelled](app/Actions/Order/ShipmentReturnCancelled.php) | This is triggered when a returned order shipment has been cancelled | +| [order.shipping.address.updated](app/Actions/Order/ShippingAddressUpdated.php) | Occurs when an Order shipping address is updated | +

(back to top)

+ +#### Product Related Webhooks/Actions + +| ** Action Name ** | ** Description ** | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | +| [product.created](app/Actions/Product/Created.php) | A new product is created. Payload of the new product are to accompanying the product | +| [product.updated](app/Actions/Product/Updated.php) | Add/Modify details of a product | +| [product.deleted](app/Actions/Product/Deleted.php) | Delete a product along with all its variants and images | +| [product.available](app/Actions/Product/Available.php) | Flags a product as stock available | +| [product.quantity.low](app/Actions/Product/QuantityLow.php) | Shows warnings whenever a stock is of low quantity |

(back to top)

-#### Products Related Webhooks/Actions +#### Shipping Companies Related Webhooks/Actions -| ** Action Name ** | ** Description ** | -|--------------------------------------------------------------|---------------------------------------------------------------------------------------| -| [product.created](app/Actions/Product/Created.php) | A new product is created. Payload of the new product are to accompanying the product | -| [product.updated](app/Actions/Product/Updated.php) | Add/Modify details of a product | -| [product.deleted](app/Actions/Product/Deleted.php) | Delete a product along with all its variants and images | -| [product.available](app/Actions/Product/Available.php) | Flags a product as stock available | -| [product.quantity.low](app/Actions/Product/QuantityLow.php) | Shows warnings whenever a stock is of low quantity | +| ** Action Name ** | ** Description ** | +| ------------------------ | ------------------------------------------------------------------------------------- | +| shipping.zone.created | This is triggered when a shipping zone has been created for a custom shipping company | +| shipping.zone.updated | This is triggered when a shipping zone has been updated for a custom shipping company | +| shipping.company.created | This is triggered when a custom shipping company has been created | +| shipping.company.updated | This is triggered when a custom shipping company has been updated | +| shipping.company.deleted | This is triggered when a custom shipping company has been deleted |

(back to top)

#### Customer Related Webhooks/Actions -| ** Action Name ** | ** Description ** | -|--------------------------------------------------------------|-------------------------------------------| -| [customer.created](app/Actions/Customer/Created.php) | Create a new customer record | -| [customer.updated](app/Actions/Customer/Updated.php) | Update details for a customer | -| [customer.login](app/Actions/Customer/Login.php) | Triggered whenever a customer log in | -| [customer.otp.request](app/Actions/Customer/OtpRequest.php) | One-Time Password request for a customer | +| ** Action Name ** | ** Description ** | +| ---------------------------------------------------------- | ---------------------------------------- | +| [customer.created](app/Actions/Customer/Created.php) | Create a new customer record | +| [customer.updated](app/Actions/Customer/Updated.php) | Update details for a customer | +| [customer.login](app/Actions/Customer/Login.php) | Triggered whenever a customer log in | +| [customer.otp.request](app/Actions/Customer/OtpRequest.php) | One-Time Password request for a customer |

(back to top)

#### Category Related Webhooks/Actions - -| ** Action Name ** | ** Description ** | -|-------------------------------------------------------|-------------------------------------------------------| -| [category.created](app/Actions/Category/Created.php) | Creates a new category for products to be put under | -| [category.updated](app/Actions/Category/Updated.php) | Add new or reform existing category details | +| ** Action Name ** | ** Description ** | +| --------------------------------------------------- | --------------------------------------------------- | +| [category.created](app/Actions/Category/Created.php) | Creates a new category for products to be put under | +| [category.updated](app/Actions/Category/Updated.php) | Add new or reform existing category details |

(back to top)

#### Brand Related Webhooks/Actions -| ** Action Name ** | ** Description ** | -|-------------------------------------------------|----------------------------------------------------------------------------------------| -| [brand.created](app/Actions/Brand/Created.php) | Creates a new Brand. | -| [brand.updated](app/Actions/Brand/Updated.php) | Triggered when Information about a sepcific Brand is updated/refurbished/streamlined | -| [brand.deleted](app/Actions/Brand/Deleted.php) | An existing brand is then deleted and removed from a store | +| ** Action Name ** | ** Description ** | +| --------------------------------------------- | ------------------------------------------------------------------------------------ | +| [brand.created](app/Actions/Brand/Created.php) | Creates a new Brand. | +| [brand.updated](app/Actions/Brand/Updated.php) | Triggered when Information about a sepcific Brand is updated/refurbished/streamlined | +| [brand.deleted](app/Actions/Brand/Deleted.php) | An existing brand is then deleted and removed from a store |

(back to top)

#### Store Related Webhooks/Actions -| ** Action Name ** | ** Description ** | -|--------------------------------------------------------------------|--------------------------------------| -| [store.branch.created](app/Actions/Store/BranchCreated.php) | Creates a new store. | -| [store.branch.updated](app/Actions/Store/BranchUpdated.php) | Updates an existing branch | -| [store.branch.setDefault](app/Actions/Store/BranchSetDefault.php) | Sets for default a specific branch | -| [store.branch.activated](app/Actions/Store/BranchActivated.php) | Activates a disabled branch | -| [store.branch.deleted](app/Actions/Store/BranchDeleted.php) | Deletes a branch | -| [storetax.created](app/Actions/Store/TaxCreated.php) | Creats a new Store Tax | +| ** Action Name ** | ** Description ** | +| ---------------------------------------------------------------- | ---------------------------------- | +| [store.branch.created](app/Actions/Store/BranchCreated.php) | Creates a new store. | +| [store.branch.updated](app/Actions/Store/BranchUpdated.php) | Updates an existing branch | +| [store.branch.setDefault](app/Actions/Store/BranchSetDefault.php) | Sets for default a specific branch | +| [store.branch.activated](app/Actions/Store/BranchActivated.php) | Activates a disabled branch | +| [store.branch.deleted](app/Actions/Store/BranchDeleted.php) | Deletes a branch | +| [storetax.created](app/Actions/Store/TaxCreated.php) | Creats a new Store Tax |

(back to top)

+#### Cart Related Webhooks/Actions + +| ** Action Name ** | ** Description ** | +| ------------------------------------------------------------ | ----------------------------------------------- | +| [abandoned.cart](app/Actions/Miscellaneous/AbandonedCart.php) | Outputs a list of abandoned carts | +| [coupon.applied](app/Actions/Miscellaneous/CouponApplied.php) | Creates a discount code in the form of a coupon | + +

(back to top)

+ +#### Special Offer Related Webhooks/Actions + +| ** Action Name ** | ** Description ** | +| ------------------------------------------------------------------------ | --------------------------- | +| [specialoffer.created](app/Actions/Miscellaneous/SpecialofferCreated.php) | Creates a new special offer | +| [specialoffer.updated](app/Actions/Miscellaneous/SpecialofferUpdated.php) | Updates a special offer | + +

(back to top)

-#### Coupon Related Webhooks/Actions +#### Miscellaneous Related Webhooks/Actions -| ** Action Name ** | ** Description ** | -|----------------------------------------------------------------------------|---------------------------------------------------| -| [coupon.applied](app/Actions/Miscellaneous/CouponApplied.php) | Creates a discount code in the form of a coupon | -| [review.added](app/Actions/Miscellaneous/ReviewAdded.php) | A product review has been added | -| [abandoned.cart](app/Actions/Miscellaneous/AbandonedCart.php) | Outputs a list of abandoned carts | -| [specialoffer.created](app/Actions/Miscellaneous/SpecialofferCreated.php) | Creates a new special offer | -| [specialoffer.updated](app/Actions/Miscellaneous/SpecialofferUpdated.php) | Updates a special offer | +| ** Action Name ** | ** Description ** | +| -------------------------------------------------------- | ------------------------------- | +| [review.added](app/Actions/Miscellaneous/ReviewAdded.php) | A product review has been added |

(back to top)

From e8ad831684f410284d8fc89a7ccf5a5866fc32f8 Mon Sep 17 00:00:00 2001 From: nabiloo19 Date: Tue, 10 May 2022 11:57:33 +0300 Subject: [PATCH 2/4] TOC Updated --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 145794f..a11ff7d 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,16 @@
  • Webhooks
  • Support
  • From 8847ab8c1607eceea32580ca61a97190e12fdcd2 Mon Sep 17 00:00:00 2001 From: nabiloo19 Date: Tue, 10 May 2022 12:20:09 +0300 Subject: [PATCH 3/4] Important Note added about OAuth modes --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index a11ff7d..6036e9f 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,23 @@ List of existing apps assocaited to your account will be displayed as well as an

    (back to top)

    +__Important Note:__ +> If you are using [Easy mode.](#auth-modes.easy) the access token will push to the action ([`app.store.authorize`](app\template\Actions\app\store.authorize.js)) via webhook +> +> If you are using [Custom mode.](#auth-modes.custom) the browser will redirect you again to the [`store.authorize.js file`](app\template\Actions\app\store.authorize.js). + +#### Output URLs + +| URL | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| Local App Url | The local link for your App\. | +| Remote App Url | The online link to your App\. It will be always synced with the local Url | +| Webhook Url | The Url link that connects your App with any action that may happen at the Merchant store, e\.g\. \ncreate new product\. | +| OAuth Callback Url | The App entry page where the access token is generated; Note that this Url is available only for the `Custom` mode auth. | + +

    (back to top)

    + + ## Configure Authorization Modes From d3470115c52a23b0d4ed6e1d289bb3d1d217d576 Mon Sep 17 00:00:00 2001 From: Abdullah Al-taheri Date: Wed, 11 May 2022 11:45:55 +0300 Subject: [PATCH 4/4] Organizing and updating webhooks --- README.md | 20 +++++++++---------- .../{Miscellaneous => Cart}/AbandonedCart.php | 2 +- .../{Miscellaneous => Cart}/CouponApplied.php | 2 +- app/Actions/Order/Deleted.php | 19 ++++++++++++++++++ app/Actions/Shipping/CompanyCreated.php | 20 +++++++++++++++++++ app/Actions/Shipping/CompanyDeleted.php | 20 +++++++++++++++++++ app/Actions/Shipping/CompanyUpdated.php | 20 +++++++++++++++++++ app/Actions/Shipping/ZoneCreated.php | 20 +++++++++++++++++++ app/Actions/Shipping/ZoneUpdated.php | 20 +++++++++++++++++++ .../SpecialofferCreated.php | 2 +- .../SpecialofferUpdated.php | 2 +- 11 files changed, 133 insertions(+), 14 deletions(-) rename app/Actions/{Miscellaneous => Cart}/AbandonedCart.php (92%) rename app/Actions/{Miscellaneous => Cart}/CouponApplied.php (92%) create mode 100644 app/Actions/Order/Deleted.php create mode 100644 app/Actions/Shipping/CompanyCreated.php create mode 100644 app/Actions/Shipping/CompanyDeleted.php create mode 100644 app/Actions/Shipping/CompanyUpdated.php create mode 100644 app/Actions/Shipping/ZoneCreated.php create mode 100644 app/Actions/Shipping/ZoneUpdated.php rename app/Actions/{Miscellaneous => Specialoffer}/SpecialofferCreated.php (93%) rename app/Actions/{Miscellaneous => Specialoffer}/SpecialofferUpdated.php (93%) diff --git a/README.md b/README.md index 6036e9f..42b184b 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ You may find the supported [Webhook events](https://docs.salla.dev/docs/merchant | [order.status.updated](app/Actions/Order/StatusUpdated.php) | Whenever there is an order status update, this is triggered | | [order.cancelled](app/Actions/Order/Cancelled.php) | This happens when an order is cancelled | | [order.refunded](app/Actions/Order/Refunded.php) | The refund action to refund the whole order is triggered. | -| [order.deleted](app/Actions/Order/) | This indicates an order has been deleted | +| [order.deleted](app/Actions/Order/Deleted.php) | This indicates an order has been deleted | | [order.products.updated](app/Actions/Order/ProductsUpdated.php) | Order products is updated | | [order.payment.updated](app/Actions/Order/PaymentUpdated.php) | A payment method has been updated | | [order.coupon.updated](app/Actions/Order/CouponUpdated.php) | This is triggered whenever a Coupon is updated | @@ -268,11 +268,11 @@ You may find the supported [Webhook events](https://docs.salla.dev/docs/merchant | ** Action Name ** | ** Description ** | | ------------------------ | ------------------------------------------------------------------------------------- | -| shipping.zone.created | This is triggered when a shipping zone has been created for a custom shipping company | -| shipping.zone.updated | This is triggered when a shipping zone has been updated for a custom shipping company | -| shipping.company.created | This is triggered when a custom shipping company has been created | -| shipping.company.updated | This is triggered when a custom shipping company has been updated | -| shipping.company.deleted | This is triggered when a custom shipping company has been deleted | +| [shipping.zone.created](app/Actions/Shipping/ZoneCreated.php) | This is triggered when a shipping zone has been created for a custom shipping company | +| [shipping.zone.updated](app/Actions/Shipping/ZoneUpdated.php) | This is triggered when a shipping zone has been updated for a custom shipping company | +| [shipping.company.created](app/Actions/Shipping/CompanyCreated.php) | This is triggered when a custom shipping company has been created | +| [shipping.company.updated](app/Actions/Shipping/CompanyUpdated.php) | This is triggered when a custom shipping company has been updated | +| [shipping.company.deleted](app/Actions/Shipping/CompanyDeleted.php) | This is triggered when a custom shipping company has been deleted |

    (back to top)

    @@ -323,8 +323,8 @@ You may find the supported [Webhook events](https://docs.salla.dev/docs/merchant | ** Action Name ** | ** Description ** | | ------------------------------------------------------------ | ----------------------------------------------- | -| [abandoned.cart](app/Actions/Miscellaneous/AbandonedCart.php) | Outputs a list of abandoned carts | -| [coupon.applied](app/Actions/Miscellaneous/CouponApplied.php) | Creates a discount code in the form of a coupon | +| [abandoned.cart](app/Actions/Cart/AbandonedCart.php) | Outputs a list of abandoned carts | +| [coupon.applied](app/Actions/Cart/CouponApplied.php) | Creates a discount code in the form of a coupon |

    (back to top)

    @@ -332,8 +332,8 @@ You may find the supported [Webhook events](https://docs.salla.dev/docs/merchant | ** Action Name ** | ** Description ** | | ------------------------------------------------------------------------ | --------------------------- | -| [specialoffer.created](app/Actions/Miscellaneous/SpecialofferCreated.php) | Creates a new special offer | -| [specialoffer.updated](app/Actions/Miscellaneous/SpecialofferUpdated.php) | Updates a special offer | +| [specialoffer.created](app/Actions/Specialoffer/SpecialofferCreated.php) | Creates a new special offer | +| [specialoffer.updated](app/Actions/Specialoffer/SpecialofferUpdated.php) | Updates a special offer |

    (back to top)

    diff --git a/app/Actions/Miscellaneous/AbandonedCart.php b/app/Actions/Cart/AbandonedCart.php similarity index 92% rename from app/Actions/Miscellaneous/AbandonedCart.php rename to app/Actions/Cart/AbandonedCart.php index 2fd82d3..06d6575 100644 --- a/app/Actions/Miscellaneous/AbandonedCart.php +++ b/app/Actions/Cart/AbandonedCart.php @@ -1,6 +1,6 @@