Google Checkout - XML API associate callback serial number with original order - google-checkout

Via the XML API, how do you associate an Google Checkout callback serial number with the original order?
On the same line - What does the serial number in the "Option B - Submit a Server-to-Server Checkout API Request" section of the XML API doc correspond to (format: serial-number="981283ea-c324-44bb-a10c-fc3b2eba5707")? Does it relate to the serial sent by the callback URL (numeric-only)?

The way I've done this in the past is using the <merchanrt-private-data> tag in the original cart, so something like:
<checkout-shopping-cart xmlns='http://checkout.google.com/schema/2'>
<shopping-cart>
<merchant-private-data>
<merchant-note>[some secret about the cart on my system]</merchant-note>
</merchant-private-data>
<items>
...
</items>
</shopping-cart>
</checkout-shopping-cart>
Then, after Google has called back with a serial number, I use the Notification History API to retrieve the order details, which then includes my private data, something like:
<new-order-notification xmlns="http://checkout.google.com/schema/2" serial-number="[serial number from google]">
<buyer-billing-address>
...
</buyer-billing-address>
<timestamp>...</timestamp>
<google-order-number>...</google-order-number>
<order-summary>
<total-chargeback-amount currency="GBP">...</total-chargeback-amount>
<google-order-number>...</google-order-number>
<total-charge-amount currency="GBP">...</total-charge-amount>
<total-refund-amount currency="GBP">...</total-refund-amount>
<purchase-date>...</purchase-date>
<archived>false</archived>
<shopping-cart>
<merchant-private-data>
<merchant-note>[the secret about the cart from my system]</merchant-note>
</merchant-private-data>
<items>
</items>
</shopping-cart>
<order-adjustment>
...
</order-adjustment>
<promotions />
<buyer-id>...</buyer-id>
<buyer-marketing-preferences>
<email-allowed>false</email-allowed>
</buyer-marketing-preferences>
<buyer-shipping-address>
...
</buyer-shipping-address>
<order-total currency="GBP">...</order-total>
<fulfillment-order-state>NEW</fulfillment-order-state>
<financial-order-state>REVIEWING</financial-order-state>
</order-summary>
<shopping-cart>
<merchant-private-data>
<merchant-note>[the secret about the cart from my system]</merchant-note>
</merchant-private-data>
<items>
</items>
</shopping-cart>
<order-adjustment>
...
</order-adjustment>
<promotions />
<buyer-id>...</buyer-id>
<buyer-marketing-preferences>
<email-allowed>false</email-allowed>
</buyer-marketing-preferences>
<buyer-shipping-address>
...
</buyer-shipping-address>
<order-total currency="GBP">...</order-total>
<fulfillment-order-state>NEW</fulfillment-order-state>
<financial-order-state>REVIEWING</financial-order-state>
</new-order-notification>
I can then use the secret to match the orders up to the details I'd stored in the database previously.

Related

XPATH Pull First and Last name from multiple root element

Getting a pull from a Saas API that sends unformatted XML. Need to pull the first and last names out of each element to send to another application.
I haev tried numerous things in Power Automate but they all error out due to the XML not having a parent node.
<Request ID="19131795" Status="Approved">
<TimeOffDate>2023-02-14</TimeOffDate>
<TimeOffDayOfWeek>Tuesday</TimeOffDayOfWeek>
<TimeStart></TimeStart>
<TimeEnd></TimeEnd>
<TimeOffHours>8.000</TimeOffHours>
<TimeOffTypeName>Maternity Leave</TimeOffTypeName>
<EmployeeID>646028926148N</EmployeeID>
<LoginID>Marie</LoginID>
<Firstname>Marie-Eve</Firstname>
<Lastname>B</Lastname>
<UserCategory>Software Development</UserCategory>
<SubmittedDate>2022-03-11</SubmittedDate>
<Deducted>Yes</Deducted>
<Comment>time-off request created by administrator</Comment>
</Request>
<Request ID="21301056" Status="Approved">
<TimeOffDate>2023-02-14</TimeOffDate>
<TimeOffDayOfWeek>Tuesday</TimeOffDayOfWeek>
<TimeStart>2023-02-14T13:00:00</TimeStart>
<TimeEnd>2023-02-14T17:00:00</TimeEnd>
<TimeOffHours>4.000</TimeOffHours>
<TimeOffTypeName>Paid Time Off - Salary</TimeOffTypeName>
<EmployeeID>FRM992097</EmployeeID>
<LoginID>Robert</LoginID>
<Firstname>Bobby</Firstname>
<Lastname>D</Lastname>
<UserCategory>Information Technology</UserCategory>
<SubmittedDate>2023-01-06</SubmittedDate>
<Deducted>Yes</Deducted>
<Comment></Comment>
</Request>
<Request ID="21324804" Status="Approved">
<TimeOffDate>2023-02-14</TimeOffDate>
<TimeOffDayOfWeek>Tuesday</TimeOffDayOfWeek>
<TimeStart></TimeStart>
<TimeEnd></TimeEnd>
<TimeOffHours>8.000</TimeOffHours>
<TimeOffTypeName>NL Parental Leave 1</TimeOffTypeName>
<EmployeeID></EmployeeID>
<LoginID>Kamila</LoginID>
<Firstname>Kamila</Firstname>
<Lastname>K</Lastname>
<UserCategory>NL Customer Service</UserCategory>
<SubmittedDate>2023-01-09</SubmittedDate>
<Deducted>Yes</Deducted>
<Comment>time-off request created by administrator</Comment>
</Request>
I have tried the following xpath filters.
'/Firstname|/Lastname')
'Firstname|Lastname')

Freeswitch use mod_lcr with originate api

Is there a way to use mod_lcr with originate command?
I want to originate a call and have mod_lcr decide which gateway should be used based on lcr rules (cost, reliability, etc).
When mod_lcr is used in the dialplan it will populate a variable ${lcr_auto_route} with the dialstring. How can I use the same logic with originate?
Thank you.
Here is how I did it.
I connect to freeswitch via ESL and execute the command
lcr 1716 default as xml
where 1716 is the digit sequence and default is the profile name (you can replace default with your own profile name)
Note 'as xml' will return an XML response. The response looks like this:
<result>
<row id="1">
<prefix>1716</prefix>
<carrier_name>carrier1</carrier_name>
<rate>0.15000</rate>
<codec></codec>
<cid></cid>
<limit></limit>
<dialstring>[lcr_carrier=carrier1,lcr_rate=0.15000]sofia/gateway/carrier1/1716</dialstring>
<event>
<headers>
<Event-Name>REQUEST_PARAMS</Event-Name>
<Core-UUID>151c590b-cce8-4eb3-b3ae-f48bad397870</Core-UUID>
<FreeSWITCH-Hostname>freeswitch</FreeSWITCH-Hostname>
<FreeSWITCH-Switchname>freeswitch</FreeSWITCH-Switchname>
<FreeSWITCH-IPv4>172.16.124.130</FreeSWITCH-IPv4>
<FreeSWITCH-IPv6>%3A%3A1</FreeSWITCH-IPv6>
<Event-Date-Local>2018-02-20%2007%3A33%3A42</Event-Date-Local>
<Event-Date-GMT>Tue,%2020%20Feb%202018%2006%3A33%3A42%20GMT</Event-Date-GMT>
<Event-Date-Timestamp>1519108422660002</Event-Date-Timestamp>
<Event-Calling-File>mod_lcr.c</Event-Calling-File>
<Event-Calling-Function>route_add_callback</Event-Calling-Function>
<Event-Calling-Line-Number>633</Event-Calling-Line-Number>
<Event-Sequence>786</Event-Sequence>
<lcr_digits>1716</lcr_digits>
<lcr_carrier_name>carrier1</lcr_carrier_name>
<lcr_rate_field>0.15000</lcr_rate_field>
<lcr_gw_prefix>sofia/gateway/carrier1/</lcr_gw_prefix>
<lcr_lead_strip>0</lcr_lead_strip>
<lcr_trail_strip>0</lcr_trail_strip>
</headers>
</event>
</row>
<row id="2">
<prefix>1</prefix>
<carrier_name>carrier2</carrier_name>
<rate>0.12000</rate>
<codec></codec>
<cid></cid>
<limit></limit>
<dialstring>[lcr_carrier=carrier2,lcr_rate=0.12000]sofia/external/0716#proxy.carrier2.net:5060</dialstring>
<event>
<headers>
<Event-Name>REQUEST_PARAMS</Event-Name>
<Core-UUID>151c590b-cce8-4eb3-b3ae-f48bad397870</Core-UUID>
<FreeSWITCH-Hostname>freeswitch</FreeSWITCH-Hostname>
<FreeSWITCH-Switchname>freeswitch</FreeSWITCH-Switchname>
<FreeSWITCH-IPv4>172.16.124.130</FreeSWITCH-IPv4>
<FreeSWITCH-IPv6>%3A%3A1</FreeSWITCH-IPv6>
<Event-Date-Local>2018-02-20%2007%3A33%3A42</Event-Date-Local>
<Event-Date-GMT>Tue,%2020%20Feb%202018%2006%3A33%3A42%20GMT</Event-Date-GMT>
<Event-Date-Timestamp>1519108422660002</Event-Date-Timestamp>
<Event-Calling-File>mod_lcr.c</Event-Calling-File>
<Event-Calling-Function>route_add_callback</Event-Calling-Function>
<Event-Calling-Line-Number>633</Event-Calling-Line-Number>
<Event-Sequence>787</Event-Sequence>
<lcr_digits>1</lcr_digits>
<lcr_carrier_name>carrier2</lcr_carrier_name>
<lcr_rate_field>0.12000</lcr_rate_field>
<lcr_gw_prefix>sofia/external/</lcr_gw_prefix>
<lcr_gw_suffix>%40proxy.carrier2.net%3A5060</lcr_gw_suffix>
<lcr_lead_strip>1</lcr_lead_strip>
<lcr_trail_strip>0</lcr_trail_strip>
<lcr_prefix>0</lcr_prefix>
</headers>
</event>
</row>
</result>
Then I parse the XML and grab the dialstring which is in this case
<dialstring>[lcr_carrier=carrier1,lcr_rate=0.15000]sofia/gateway/carrier1/1716</dialstring>
Then I use the dialstring (with some extra variables) in my originate command.

Ebay Australia Site ID invalid on Trading API (Modified EbayR)

Every time I try and publish a product with AddFixedPriceItem with the Site ID set to Australia (15) I get the error response:
:errors=>{:short_message=>"Input data is invalid.", :long_message=>"Input data for tag is invalid or missing. Please check API documentation."
I tried every variation of the site ID ("AU", "Australia", 15, "15") and when i switch it to the US site ID (0) everything works perfectly. Is there something that I'm doing wrong?
Im using my own customised version of EbayR (because it didn't parse the xml correctly)
Anyway here is the full raw SOAP request:
Headers:
{
'X-EBAY-API-COMPATIBILITY-LEVEL' => #compatability_level.to_s, # => 837
'X-EBAY-API-DEV-NAME' => dev_id.to_s,
'X-EBAY-API-APP-NAME' => app_id.to_s,
'X-EBAY-API-CERT-NAME' => cert_id.to_s,
'X-EBAY-API-CALL-NAME' => #command.to_s,
'X-EBAY-API-SITEID' => #site_id.to_s, # => which is 15
'Content-Type' => 'text/xml'
}
the full body request is:
<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>....</eBayAuthToken>
</RequesterCredentials>
<Item>
<Title>dssddsheykduhfid</Title>
<ListingDuration>GTC</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<Description>This is another test description with image</Description>
<PrimaryCategory>
<CategoryID>57989</CategoryID>
</PrimaryCategory>
<SKU>dfiuhdssdsdfggfmeesddffdeseddfda</SKU>
<InventoryTrackingMethod>SKU</InventoryTrackingMethod>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>payments-facilitator#logicsaas.com</PayPalEmailAddress>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<ConditionID>1000</ConditionID>
<Country>AU</Country>
<Currency>AUD</Currency>
<DispatchTimeMax>4</DispatchTimeMax>
<PostalCode>3194</PostalCode>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<Description>What! you dont want the product! .... ok</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<PictureDetails>
<PictureURL>http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg</PictureURL>
</PictureDetails>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>AU_eBayAusPost3kgFlatRateSatchel</ShippingService>
<ShippingServiceCost>10</ShippingServiceCost>
</ShippingServiceOptions>
</ShippingDetails>
<Site>15</Site>
<Variations>
<VariationSpecificsSet>
<NameValueList>
<Name>Size</Name>
<Value>L</Value>
<Value>S</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Red</Value>
<Value>Blue</Value>
</NameValueList>
</VariationSpecificsSet>
<Variation>
<SKU>dfiuhdssdsdfggfmeesddffdeseddfdaOMG454fgfgfg</SKU>
<StartPrice>100.99</StartPrice>
<Quantity>1</Quantity>
<VariationSpecifics>
<NameValueList>
<Name>Size</Name>
<Value>L</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Red</Value>
</NameValueList>
</VariationSpecifics>
</Variation>
<Variation>
<SKU>dfiuhdssdsdfggfmeesddffdeseddfdaOMG432325fgfgfg</SKU>
<StartPrice>100.99</StartPrice>
<Quantity>16</Quantity>
<VariationSpecifics>
<NameValueList>
<Name>Size</Name>
<Value>L</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Blue</Value>
</NameValueList>
</VariationSpecifics>
</Variation>
</Variations>
</Item>
Also I bit the bullet and payed the 75 dollars for technical support, If I don't get a response here I'll paste the response from them for all to see.
Cool, so it seems like this was an ebay issue. They are trying to fix it at the moment. But they responded with a work around:
Hello Avin ,
Thank you for reporting this issue. I can reproduce the problem and I have forwarded this to our engineering team for further investigation. We will keep the ticket open in "Waiting-BugFix" status.
Actually SiteID is not a mandatory field. SiteID will be taken from the header if you don&apos;t pass it. As a workaround, please omit the field and continue listing.
Please let me know if you have any questions.
Best Regards,
eBay Developer Support

logalyze how to add event definition

I am working on logalyze, there is very limited documentation for this tool.
I have done most of the things, but I am not able to add alerts.
Following is a sample xml file for event definition
<?xml version="1.0" encoding="UTF-8"?>
<tns:definitions xmlns:tns="http://logalyze.com" xmlns:xsi="http://www.w3.org /2001/XMLSchema-instance" xsi:schemaLocation="http://logalyze.com http://repository.logalyze.com/logalyze-definitions-1.0.xsd ">
<tns:eventdef version="1" id="a4151076-152c-11e1-91a4-0018de9d251b">
<tns:name>Critical event Mod Sec</tns:name>
<tns:description>Mod Sec</tns:description>
<tns:vendor>LOGalyze</tns:vendor>
<tns:group></tns:group>
<tns:rule>SingleWithThreshold</tns:rule>
<tns:criteria>
<tns:criterion>
<tns:field>_tag</tns:field>
<tns:operator>=</tns:operator>
<tns:value>mod_sec_warn</tns:value>
</tns:criterion>
</tns:criteria>
<tns:desc>3 login failures within 1m for user ${user_name}</tns:desc>
<tns:window>60</tns:window>
<tns:thresh>3</tns:thresh>
<tns:actions>
<tns:action type="event">
<tns:prop>
<tns:key>field:msg</tns:key>
<tns:value>3 login failures within 1m for user ${user_name}</tns:value>
</tns:prop>
<tns:prop>
<tns:key>field:user_name</tns:key>
<tns:value/>
</tns:prop>
<tns:prop>
<tns:key>field:loghostname</tns:key>
<tns:value/>
</tns:prop>
<tns:prop>
<tns:key>field:_priority</tns:key>
<tns:value>high</tns:value>
</tns:prop>
</tns:action>
</tns:actions>
</tns:eventdef>
</tns:definitions>
Thanks
Infosec.pk
So I should enhance the documentation of this :-)
You have one Action with type "event". This generates an artificial log entry, with logtype event with the field nem/value pairs in the prop list (msg, user_name, loghostname, _priority).
This type of log than can be searched and can be an input of any other event definition.
To send an alert you have to use action type "mail".
Properties of "mail" action are:
to: email address
subject: Defaule value is: 'LOGalyze alert'
The content of mail body will be generated by LOGalyze, currently you cannot modify it.

Can't submit multiple products in a single request to ChangeCatalogEntry web service (Websphere Commerce)

Using Websphere Commerce V7, FP6, FEP5.
I am attempting to do an update to our catalog using the ChangeCatalogEntry web service. I am able to update a single product just fine. My problem is that any additional CatalogEntry nodes are completely ignored. It appears to process only the first CatalogEntry node it finds. I am using SoapUI to submit the requests. Here is a sample that I am attempting to submit. In this example part number p_MAT153 is updated but p_MAT203 and p_MAT185 are not. Is the webservice designed to only update a single product per message?
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1">
<wsse:UsernameToken>
<wsse:Username>
wcs_sonic
</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
passw0rd
</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ChangeCatalogEntry xmlns:udt="http://www.openapplications.org/oagis/9/unqualifieddatatypes/1.1"
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
xmlns="http://www.ibm.com/xmlns/prod/commerce/9/catalog"
xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:clmIANAMIMEMediaTypes="http://www.openapplications.org/oagis/9/IANAMIMEMediaTypes:2003"
xmlns:oacl="http://www.openapplications.org/oagis/9/codelists"
xmlns:clm54217="http://www.openapplications.org/oagis/9/currencycode/54217:2001"
xmlns:clm5639="http://www.openapplications.org/oagis/9/languagecode/5639:1988"
xmlns:qdt="http://www.openapplications.org/oagis/9/qualifieddatatypes/1.1"
xmlns:clm66411="http://www.openapplications.org/oagis/9/unitcode/66411:2001"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/9/catalog C:/Users/SteveS/MuleStudio/workspace/shapeitdeltaupdates/src/main/resources/WebContent/component-services/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ChangeCatalogEntry.xsd"
releaseID="9.0"
versionID="7.0.0.0">
<oa:ApplicationArea xsi:type="_wcf:ApplicationAreaType">
<oa:CreationDateTime>2013-04-29T15:38:19.173-04:00</oa:CreationDateTime>
<_wcf:BusinessContext>
<_wcf:ContextData name="storeId">10651</_wcf:ContextData>
<_wcf:ContextData name="catalogId">10051</_wcf:ContextData>
</_wcf:BusinessContext>
</oa:ApplicationArea>
<DataArea>
<oa:Change>
<oa:ActionCriteria>
<oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[1]/Description[1]</oa:ActionExpression>
</oa:ActionCriteria>
</oa:Change>
<CatalogEntry>
<CatalogEntryIdentifier>
<_wcf:ExternalIdentifier ownerID="7000000000000000601">
<_wcf:PartNumber>p_MAT153</_wcf:PartNumber>
<_wcf:StoreIdentifier>
<_wcf:UniqueID>10551</_wcf:UniqueID>
</_wcf:StoreIdentifier>
</_wcf:ExternalIdentifier>
</CatalogEntryIdentifier>
<Description language="-1">
<Name>Absorbent Pants Roll</Name>
<ShortDescription> universal XSMP133</ShortDescription>
<LongDescription>These are my pants.</LongDescription>
<Attributes name="auxDescription1">I need an aux description</Attributes>
</Description>
</CatalogEntry>
<CatalogEntry>
<CatalogEntryIdentifier>
<_wcf:ExternalIdentifier ownerID="7000000000000000601">
<_wcf:PartNumber>p_MAT203</_wcf:PartNumber>
<_wcf:StoreIdentifier>
<_wcf:UniqueID>10551</_wcf:UniqueID>
</_wcf:StoreIdentifier>
</_wcf:ExternalIdentifier>
</CatalogEntryIdentifier>
<Description language="-1">
<Name>Absorbent Mat Roll</Name>
<ShortDescription> universal XSMP133</ShortDescription>
<LongDescription>These are not my pants. These are your pants.</LongDescription>
<Attributes name="auxDescription1">These pants should be washed regularly.</Attributes>
</Description>
</CatalogEntry>
<CatalogEntry>
<CatalogEntryIdentifier>
<_wcf:ExternalIdentifier ownerID="7000000000000000601">
<_wcf:PartNumber>p_MAT185</_wcf:PartNumber>
<_wcf:StoreIdentifier>
<_wcf:UniqueID>10551</_wcf:UniqueID>
</_wcf:StoreIdentifier>
</_wcf:ExternalIdentifier>
</CatalogEntryIdentifier>
<Description language="-1">
<Name>Pants on a Roll</Name>
<ShortDescription> universal XSMP133</ShortDescription>
<LongDescription>A roll of pants. Genuius. </LongDescription>
<Attributes name="auxDescription1">Still more pants. Need a different aux description.</Attributes>
</Description>
</CatalogEntry>
</DataArea>
</ChangeCatalogEntry>
</soapenv:Body>
</soapenv:Envelope>
The answer turned out to be in the oa:ActionCriteria node. I needed a matching node for every instance of CatalogEntry.
<oa:ActionCriteria>
<oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[1]/Description[1]</oa:ActionExpression>
</oa:ActionCriteria>
<oa:ActionCriteria>
<oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[2]/Description[1]</oa:ActionExpression>
</oa:ActionCriteria>
<oa:ActionCriteria>
<oa:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry[3]/Description[1]</oa:ActionExpression>
</oa:ActionCriteria>
Just to add to that: You can run several action son the same data object, to for instance create attributes , remove attributes, set SEO data etc. However, this can confuse the graph object if you don't sort the actions in the order of Add, Change and Delete.

Resources