I am getting error while hitting payUmoney api https://secure.payu.in/_payment' - json-api

Iam getting error invalid amount . my request parameters are as follows
var data={
key: 'mHnY4ZVe',
salt: ' OseOWqkht7',
service_provider: 'payu_paisa',
hash: hash,
amount:1,
firstName:'ayushi',
lastName:'gupta',
phone:"989601451",
email:"ayushigupta0294#gmail.com",
productInfo:'car',
surl: 'www.google.com',
furl: 'www.facebook.com',
txnid:txnid
};

check whether they accept amount as '1' or '100' for one rupee or they may have a minimum amount limit, try with Rs 10 or above

In PayU documentation the clearly mentioned below line :
Note: specify prices using the lowest currency unit e.g. in lowest currency unit for PLN, so 1000 is equal to 10 PLN. HUF is the exception – multiply this by 100.
Read this
Below is sample request :
{
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "145227",
"description": "RTV market",
"currencyCode": "PLN",
"totalAmount": "21000",
"products": [
{
"name": "Wireless mouse",
"unitPrice": "15000",
"quantity": "1"
},
{
"name": "HDMI cable",
"unitPrice": "6000",
"quantity": "1"
}
]
}
you have not passed any currency code etc. They have complete documentation. Just read once. Change your request accordingly

Related

Azure CosmosDB - Partial Document Update (Patch) on Complex Structures

I'm trying to use the Partial Document Update (Patch API) to update a child object in my document, but I'm running into trouble. I found this Stack Overflow question which is the same question that I have. However, the accepted answer resolves the problem by referring to an object in an array by index. I don't believe that I have the luxury of being able to do that. So, to use the same example document as the other question...
{
"id": "SalesOrder2",
"ponumber": "PO15428132599",
"OrderDate": "2005-07-01T00:00:00",
"DueDate": "2005-07-13T00:00:00",
"ShippedDate": "2005-07-08T00:00:00",
"AccountNumber": "Account2",
"SubTotal": 6107.082,
"TaxAmt": 586.1203,
"Freight": 183.1626,
"TotalDue": 4893.3929,
"DiscountAmt": 1982.872,
"Items": [
{
"Id": 1,
"OrderQty": 3,
"ProductCode": "A-123",
"ProductName": "Product 1",
"CurrencySymbol": "$",
"CurrencyCode": "USD",
"UnitPrice": 17.1,
"LineTotal": 5.7
},
{
"Id": 2,
"OrderQty": 2,
"ProductCode": "A-456",
"ProductName": "Product 2",
"CurrencySymbol": "$",
"CurrencyCode": "USD",
"UnitPrice": 10,
"LineTotal": 20
}
],
"_rid": "BsMkAMc43s4CAAAAAAAAAA==",
"_self": "dbs/BsMkAA==/colls/BsMkAMc43s4=/docs/BsMkAMc43s4CAAAAAAAAAA==/",
"_etag": "\"00000000-0000-0000-e136-0dbec04601d7\"",
"_attachments": "attachments/",
"_ts": 1637760030
}
I have no guarantee that the item in the Items array with an Id of 1 would be in position 0 of the array. Similarly, the item with an Id of 2 is not guaranteed to be in position 1. Therefore I believe that I need to use the FilterPredicate parameter of the Patch API to filter my results. But when I attempt to do that, I keep getting the following exception:
Microsoft.Azure.Cosmos.CosmosException : Response status code does not
indicate success: PreconditionFailed (412); Substatus: 1110;
ActivityId: dbd258ae-0a0a-4a9b-8c25-1d36e137b7c5; Reason: ();
Any assistance you could provide on how to accomplish this would be appreciated.
As i answered in the attached link, Patch requires the user to pass the specific index of the object needs to be updated. We are working on enabling this particular feature in the coming months, However as an alternative, you should look at Conditional Patch
Code will be something like this,
response = patch(operation, Condition(check if item exists))
if(response == fail/precondition failed)
{
PatchOperation operation = PatchOperation.Add("/Items", [{"Id" : "P-1", "Description" : "My Product"}]);
}

Logic App to CosmosDB - PartitionKey extracted from document doesn't match the one specified in the header

I am using a CosmosDB connector in my logic app to insert a record into the database. My container name is ordersContainer. Here is my document:
{
"id": "98327158-59d3-4b5b-8c36-0b7c6270c18e",
"item": {
"headers": {
"salesNumber": "LXG995",
"dateTime": "12/23/2020 6:24:40 PM",
"locationId": "DDD444",
"locationName": "Wide World Importers",
"locationAddress": "645 Roosevelt Avenue",
"locationPostcode": "98121",
"totalCost": "424.55",
"totalTax": "42.455"
},
"details": [
{
"productId": "0f5a0fe8-4506-4332-969e-699a693334a8",
"quantity": "20",
"unitCost": "15.99",
"totalCost": "319.8",
"totalTax": "31.98",
"productName": "Beer",
"productDescription": "Hey this isn't ice cream!"
},
{
"productId": "76065ecd-8a14-426d-a4cd-abbde2acbb10",
"quantity": "10",
"unitCost": "4.49",
"totalCost": "44.9",
"totalTax": "4.49",
"productName": "Gone Bananas",
"productDescription": "I'm not sure how appealing banana ice cream really is."
},
{
"productId": "551a9be9-7f1c-447d-83ee-b18f5a6fb018",
"quantity": "15",
"unitCost": "3.99",
"totalCost": "59.85",
"totalTax": "5.985",
"productName": "Matcha Green Tea",
"productDescription": "Green tea ice cream is good for you because it is green."
}
]
}
}
In my container, my partition key is /salesNumber and in my connector, I have the 'salesNumber' (with double-quotes around it. However, I get this error:
"code": "BadRequest",
"message": "Message: {\"Errors\":[\"PartitionKey extracted from document doesn't match the one specified in the header\"]}\r\nActivityId: ba051769-46cc-4890-b199-c65841f3c0da, Request URI: /apps/a13f0c17-4c1e-488f-a4f7-e0fb0c98bb56/services/4b64d4a5-e7e4-4141-a4a1-5a53ab79bc4b/partitions/1108ee0f-f7e4-4572-b6f8-7c63bea5c122/replicas/132551652008533238p/, RequestStats: \r\nRequestStartTime: 2021-01-17T14:21:22.5778297Z, RequestEndTime: 2021-01-17T14:21:22.5778297Z, Number of regions attempted:1\r\nResponseTime: 2021-01-17T14:21:22.5778297Z, StoreResult: StorePhysicalAddress: rntbd://cdb-ms-prod-eastus1-fd59.documents.azure.com:14308/apps/a13f0c17-4c1e-488f-a4f7-e0fb0c98bb56/services/4b64d4a5-e7e4-4141-a4a1-5a53ab79bc4b/partitions/1108ee0f-f7e4-4572-b6f8-7c63bea5c122/replicas/132551652008533238p/, LSN: 5, GlobalCommittedLsn: 5, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 400, SubStatusCode: 1001, RequestCharge: 1.24, ItemLSN: -1, SessionToken: 5, UsingLocalLSN: False, TransportException: null, ResourceType: Document, OperationType: Upsert\r\n, SDK: Microsoft.Azure.Documents.Common/2.11.0"
I'm not sure why it is saying that the PartitionKey extracted from the document (which should be the above document) doesn't match the one in the header. Well, isn't the header listed in the document?
Any help appreciated!
Thanks!
PartitionKey extracted from document doesn't match the one specified
in the header
This error causes by your partition key value in your connector isn't the same as the value in your document. In your case, your partition key is /salesNumber, so your partition key value in your connector should be "LXG995", not 'salesNumber'(with double-quotes around it).
What the problem was, was that the document I was putting into the container had salesNumber in the item/headers/salesnumber hierarchy. Not being up to speed on how Cosmos does thing, I just thought that it would insert that piece of data into the record as the partition key.
I discovered however that I had to make my partition key 'item/headers/salesNumber' instead of just '/salesNumber'.
I did need to use salesNumber as the partition key to account for the fact that their could be multiple orders from this customer, identified by their salesNumber.
Thanks!

HERE Routing API - How to use publicTransportTimeTable mode with multiple waypoints using calculate route resource?

I'm using calculateroute resource to calculate a route between multiple waypoints.
https://route.api.here.com/routing/7.2/calculateroute.json?app_id={APP_ID}&app_code={APP_CODE}&waypoint0=-25.4327193,-49.2806026;;0&waypoint1=-25.4392733,-49.2722581;;1&waypoint2=-25.4367652,-49.2833011;;2&waypoint3=-25.4327193,-49.2806026;;3&waypoint4=-25.4327193,-49.2806026;;4&waypoint5=-25.4392733,-49.2722581;;5&departure=2019-09-09T07:10:00-03:00&mode=fastest;car;traffic:disabled;motorway:0&improveFor=distance&language=pt-br&representation=navigation&metricSystem=metric&vehicletype=diesel,5.5
I was using departure parameter to set the initial date of the route, but now, instead of departure, I need to use arrival time in some cases. I was using car mode, but as arrival parameter requires publicTransportTimeTable, I set it this way.
https://route.api.here.com/routing/7.2/calculateroute.json?...&mode=fastest;publicTransportTimeTable;motorway:0..
Then the return was this error message: "Time Table Transit Routing is only supported for two StopOver waypoints", then I set the waypoint0 and waypoint5 as stopOver and the rest as passThrough, and yet, I receive the same error.
GET REQUEST
https://route.api.here.com/routing/7.2/calculateroute.json?app_id={APP_ID}&app_code={APP_CODE}&waypoint0=stopOver!-25.4327193,-49.2806026;;0&waypoint1=passThrough!-25.4392733,-49.2722581;;1&waypoint2=passThrough!-25.4367652,-49.2833011;;2&waypoint3=passThrough!-25.4327193,-49.2806026;;3&waypoint4=passThrough!-25.4327193,-49.2806026;;4&waypoint5=stopOver!-25.4392733,-49.2722581;;5&arrival=2019-09-09T07:10:00-03:00&mode=fastest;publicTransportTimeTable;motorway:0&improveFor=distance&language=pt-br&representation=navigation&metricSystem=metric&vehicletype=diesel,5.5
RETURN
{
"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "InvalidInputData",
"details": "Time Table Transit Routing is only supported for two StopOver waypoints",
"additionalData": [
{
"key": "waypoint",
"value": ""
}
],
"metaInfo": {
"timestamp": "2019-09-10T13:40:27Z",
"mapVersion": "8.30.99.156",
"moduleVersion": "7.2.201935-5091",
"interfaceVersion": "2.6.68",
"availableMapVersion": [
"8.30.99.156"
]
}
}
as stated in the documentation, you can only use the arrival parameter when mode is set to publicTransportTimeTable. And this type of routing currently supports only two stopover waypoints (waypoint0 and waypoint1) and no passthrough waypoints.

Adobe Analytics API - Real Time Classification

I need to get from Omniture real time API a classify eVar, exclude some value, and then breackdown its with sitesection.
I try with this query:
{
"reportDescription": {
"source": "realtime",
"reportSuiteID": "**RSID**", //MY REPORT SUITE
"metrics": [{
"id": "instances"
}],
"elements": [{
"id": "evar", //MY EVAR
"top": 100,
"classification": "Real Time", //CLASSIFICATION NAME
"search": {
"type": "NOT",
"keywords": ["somevalue"] //THE VALUE TO EXCLUDE
}
},{
"id" : "sitesection",
"top" : 1
}],
"dateGranularity": "minute:1",
"dateFrom": "-1 minute"
}
}
But in the JSON response I see "somevalue" how if it not excluded.
The strange thing is that if I remove the "breakdown" (with sitesection) the classification filter seems to works fine.
I can't use classification filter if a breackdown is used in real time report? I can't find any documentation about that.
An other thing is that if I request a report with the classification, without any search, I receve the response but there is a lot of "::Unspecified::". The problem is that the "::Unspecified::" seems to be the last datas that Omniture receves form my webpages. I think this means that classifications are not in real time, also if you can to use it in real time report.

Returned values of the same Core Reporting API metrics are varied with combinations of specifed metrics

I want to fetch some metrics values like goalXXCompletions and goalXXConversionRate via Core Reporting API, along with region and regionId dimensions.
However, when I also specify either users or uniquePageviews metrics, the queries' returned values are unexpectedly changed even if they have the same dimensions.
After some investigation, I have found:
Returned values are changed when specifing users and uniquePageviews
Returned values are NOT changed when specifing sessions and pageviews
from the results which specify only goalXXCompletions and goalXXConversionRate.
Can anyone please let me know why returned values happen to vary with target metrics combinations?
I had tried both Query Explorer and HTTP API requests, but results were same.
UPDATE
Added an example of a raw response. These values of each region/regionId are varied with or without specifying users/uniquePageviews.
{
"totalResults": 28,
"containsSampledData": true,
"columnHeaders": [
{
"name": "ga:regionId"
},
{
"name": "ga:region"
},
{
"name": "ga:users"
},
{
"name": "ga:goal1ConversionRate"
}
],
"totalsForAllResults": {
"ga:users": "1125",
"ga:goal1ConversionRate": "7.155222158107328"
},
"rows": [
[
"(not set)",
"(not set)",
"2",
"0.0"
],
[
"21152",
"Massachusetts",
"358",
"20.930232558139537"
],
[
"21176",
"Texas",
"463",
"2.9797377830750893"
]
]
}
The above is not exactly the actual response, but almost the same except the count of the rows.
As Matt mensioned in the comment, I found that this is because of the usage of sampled data.

Resources