How to get client service custom fields value in the whmcs hook? - hook

How do I get a client service custom Field value in whmcs hook?
I want to do something on AfterModuleCreate hook.

According to docs, the hook will receive the module parameters:
add_hook('AfterModuleCreate', 1, function($vars) {
$customFields = $vars['params']['customfields'];
$fieldValue = $customFields['FieldName'];
});

Related

DocuSign website cant call webhook listener

I try to receive signed file from Docusing using web hook listener, before it working file , but form 31-05-2022 Docusing cant call our web hook listener.
When i check log from Connect menu, i got this error on bottom
6/22/2022 | 3:52:07 pm
Error: Exception in EnvelopeIntegration.RunIntegration: ac08432f-18c4-471d-8720-caaf78fe4dfc :: No URI :: Error - Invalid URI: The URI is empty.;
This is the code i pass web hook listener url.
Dim eventNotification = New EventNotification()
eveventNotification.Url ="https://www.sample.com/webhook/default.aspx"
eventNotification.RequireAcknowledgment = "true"
eventNotification.IncludeDocuments = "true"
eventNotification.LoggingEnabled = "true"
May i know exact problem ? This final success receive from web listener is 5/30/2022, after that all are failure.
Thanks and Regards
Aravind
This error typically means you're using envelope-level EventNotifications, but you're not actually defining a valid url parameter when you're sending an envelope.
You'll want to check your Envelope Definition in your code, but you can also use API Request Logging to capture what your application is sending to DocuSign

How to pass a document's ID using Azure CosmoDB?

I am creating a simple CRUD app to learn Azure. I have created a logic app (standard model) and my APIs are designed using the workflow designer. I also have a CosmoDB to hold each object.
My GET API, that gets all the documents, looks like this:
And my GET API, that gets only one document, looks like this:
Here is what my CosmosDB looks like with the ID of the item that is successfully return when statically called:
So what do I need to replace the static ID with, in the *Document ID input so that I can pass in different IDs?
I have looked at the docs and it suggests documentId, but when I type this in I get this error:
Thanks!
Thank you #404 , posting your suggestion as an answer to help other community members.
" You should know the id you want to retrieve from the flow that feeds into the Get a document block (unless it's static). Since you only have a HTTP trigger your id should be supplied through that. As example by passing the id in the url as query parameter which you then refer to in your Document ID field."
Trigger a post request to logic app with Document ID in request body.
Try as below:

Using customer object information in private app

I'm currently trying to build a private app which will allow me to create a form which customers can use to update info like name, email address, etc.
I know that I can access this information in my template through the customer object:
https://help.shopify.com/themes/liquid/objects/customer
I also believe that I can send http requests through the admin api which would allow me to update a given customer object:
https://help.shopify.com/api/reference/customer#update
This is an example PUT request from that page
PUT /admin/customers/#{id}.json
{
"customer": {
"id": 207119551,
"email": "changed#email.address.com",
"note": "Customer is a great guy"
}
}
I think that in order to use this api (or at least use it securely) I need to use a private app. I found the following npm package which I would use to create the private app:
https://www.npmjs.com/package/shopify-node-api
This is an example of a PUT request from that page (I think this can be modified for customers):
var put_data = {
"product": {
"body_html": "<strong>Updated!</strong>"
}
}
Shopify.put('/admin/products/1234567.json', put_data, function(err, data, headers){
console.log(data);
});
Does anyone have any experience doing this as I'm unsure about a few things.
Will this PUT request be called when the url is loaded? So if I have an
<a> tag with href="/admin/products/1234567.json the request would load?
If so, this seems quite useless with the customer ID hardcoded in. Can I pass in the customer ID of whoever is logged in and clicking the link and use that as the last part of the request url somehow? In addition to this would it be possible to grab the form data that the user enters to use as the value for "email" or "note?
You should check out this answer shopify app proxy: send customer data or only customer ID for some pointers, discussion and links.
tl/dr; Don't rely on only the logged in customer id or you'll be opening yourself up to easy hackery.
So bascially you update the customer with the PUT you outlined in your question.
To get the id securely you:
Create a form with the customer id and make sure you have a server generated hash of that customer id to thwart bots (that's the reference post)
You post the customer data to a an app via a proxy url
You update the customer via a PUT to a constructed url.

How to post a Zapier trigger to the REST Hook Subscribe URL?

I'm using Zapier's REST Hooks. In my Zap, I also have a trigger field that is used to trigger the zap when the condition is met. In my case, the trigger field is "segment" - so as to only trigger the zap when the selected segment is created.
The trouble I'm having is POSTING the selected trigger field to the REST Hook Subscribe URL.
My first thought is to update the "REST Hook Subscribe URL" to be: https://domain.com/api/v1/hooks?filter={{segment}}
Which does work to pass the trigger field as a URL paramater. However, this creates an Error for the other Triggers, because the "segment" field does not exist.
How is this best accomplished?
The trick here is to use Zapier scripting to manipulate the requests made to your App's API.
The trigger fields are available with the bundle.trigger_fields object. So I passed these in the params during pre_subscribe like so:
'use strict';
var Zap = {
pre_subscribe: function(bundle) {
return {
url: bundle.request.url,
method: bundle.request.method,
auth: bundle.request.auth,
headers: bundle.request.headers,
params: bundle.trigger_fields,
data: bundle.request.data
};
}
}
That did the trick for me...

"Add to cart API" of magento working?

Did anyone got the Add to cart API of magento working?
$mage_url = 'http://server_path/magento/api/?wsdl';
$mage_user = 'xxxxx';
$mage_api_key = 'xxxxx';
// Initialize the SOAP client
$soap = new SoapClient( $mage_url );
// Login to Magento
$session_id = $soap->login( $mage_user, $mage_api_key );
after this i want to do Add to cart
any suggestion..
Magento doesn't yield that functionality via the SOAP API(yet as of Dec. 2010 version 1.4.2). You would have to make your own implementation for now. Tricky thing with that would be to change it so that it creates a session object for carts created via SOAP vs. a request coming in via a user's browser with cookie and all to the checkout controller.
The only thing the API does in the current release is create a cart object. Nothing else. Well not even really. It just creates a quote object for the given store ID.
As seen in the API's implementation class here:
class Mage_Checkout_Model_Cart_Api extends Mage_Api_Model_Resource_Abstract
{
public function create($store = null){...}
}

Resources