I'm trying to do a POST request from postman to cybersource url: https://apitest.cybersource.com/pts/v2/payments
and I'm getting the below error message
{
"submitTimeUtc": "2023-01-18T21:52:02.539Z",
"status": "DECLINED",
"errorInformation": {
"reason": "INVALID_DATA",
"message": "Invalid Json Request"
}
}
this is my body request
{
"clientReferenceInformation": {
"code": "TC50171_3"
},
"paymentInformation": {
"card": {
"number": "4111111111111111",
"expirationMonth": "12",
"expirationYear": "2031"
}
},
"orderInformation": {
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD"
},
"billTo": {
"firstName": "John",
"lastName": "Doe",
"address1": "1 Market St",
"locality": "san francisco",
"administrativeArea": "CA",
"postalCode": "94105",
"country": "US",
"email": "test#cybs.com",
"phoneNumber": "4158880000"
}
}
}
and this are my Headers
what am I doing wrong here?
can anyone help me?
Related
I'm unable to send multiproduct messages to users. Every time I send the request I receive the same error. The following attachment shows the catalog connected to the number.
The body of the request:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "###########",
"type": "interactive",
"interactive": {
"type": "product_list",
"header": {
"type": "text",
"text": "text-header-content"
},
"body": {
"text": "text-body-content"
},
"footer": {
"text": "text-footer-content"
},
"action": {
"catalog_id": "673529427462715",
"sections": [
{
"title": "the-section-title",
"product_items": [
{
"product_retailer_id": "K456653445"
}
]
}
]
}
}
}
The error received:
{
"error": {
"message": "(#131009) Parameter value is not valid",
"type": "OAuthException",
"code": 131009,
"error_data": {
"messaging_product": "whatsapp",
"details": "None of the products provided could be sent. Please check your catalog."
},
"error_subcode": 2494010,
"fbtrace_id": "A4YbEq8SQ7rMIisuc4M2HiX"
}
}
I am trying to explore Amadeus API.My use-case is to search for flight at a particular duration. I checked for Flight Offer search with below params but getting error.
Please suggest on how can i pass time along with date to get flight details along with price.
https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=BLR&destinationLocationCode=DEL&departureDate=2020-07-10T08:00:00Z&returnDate=2020-07-13T12:00:00Z&adults=1¤cyCode=INR
{
"errors": [
{
"status": 400,
"code": 477,
"title": "INVALID FORMAT",
"detail": "departureDate format is YYYY-MM-DD",
"source": {
"pointer": "departureDate",
"example": "2030-12-31"
}
},
{
"status": 400,
"code": 477,
"title": "INVALID FORMAT",
"detail": "returnDate format is YYYY-MM-DD",
"source": {
"pointer": "returnDate",
"example": "2030-12-31"
}
}
]
}
With the Flight Offers Price -> GET you cannot specify the duration, you can only search for a date (format YYYY-MM-DD). You will have to read the response to understand the duration.
You can give more details using the Flight Offers Search -> POST
for example:
{
"currencyCode": "USD",
"originDestinations": [
{
"id": "1",
"originLocationCode": "RIO",
"destinationLocationCode": "MAD",
"departureDateTimeRange": {
"date": "2020-08-01",
"time": "10:00:00"
}
},
{
"id": "2",
"originLocationCode": "MAD",
"destinationLocationCode": "RIO",
"departureDateTimeRange": {
"date": "2020-08-05",
"time": "17:00:00"
}
}
],
"travelers": [
{
"id": "1",
"travelerType": "ADULT"
},
{
"id": "2",
"travelerType": "CHILD"
}
],
"sources": [
"GDS"
],
"searchCriteria": {
"maxFlightOffers": 2,
"flightFilters": {
"cabinRestrictions": [
{
"cabin": "BUSINESS",
"coverage": "MOST_SEGMENTS",
"originDestinationIds": [
"1"
]
}
],
"carrierRestrictions": {
"excludedCarrierCodes": [
"AA",
"TP",
"AZ"
]
}
}
}
}
https://github.com/intuit/karate/issues/554
I have a multirow JSON, I would like to iterate for each row using Scenario outline
It is working if I call by the row number, i am using a dynamic JSON file
Data.json
[
{
"address": {
"addressLine1": "ttes",
"addressLine2": "Test"
},
"name": {
"firstName": "TEST",
"lastName": "TEST"
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999"
},
"email": {
"emailAddress": "TEST#TEST.com"
}
},
{
"address": {
"addressLine1": "ttes1",
"addressLine2": "Test1"
},
"name": {
"firstName": "TEST1",
"lastName": "TEST1"
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999"
},
"email": {
"emailAddress": "TEST#TEST1.com"
}
}]
Working if
Feature: Read from File
Background:
* def Testdata = read('Data.json')
Scenario Outline: [1] Test with multiple records on JSON
Given url_stg
And path 'test','test'
And request Testdata[0]
When method POST
Examples:
|Testdata |
Working for Testdata[0]. I have dynamic json, I am looking for a way to iterate through the json autoamtically.
My request body should be one row from JSON like :
{
"address": {
"addressLine1": "ttes1",
"addressLine2": "Test1",
},
"name": {
"firstName": "TEST1",
"lastName": "TEST1",
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999",
},
"email": {
"emailAddress": "TEST#TEST1.com"
}
This will be easier in the next version, see this ticket: https://github.com/intuit/karate/issues/717#issuecomment-489339287
So if you can build from source and test that would help.
For now you have to do this:
And request { address: <address>, name: <name>, phone: <phone>, email: <email> }
I need make payments with square, I used square_in_app_payments plugin but it only give me a nonce string that seems I have to send it to checkout api with items information inside JSON in http request, but I don't understand how to make it.
I only tried from postman make some samples fo square.
POST /v2/locations/{{location_id}}/checkouts HTTP/1.1
Host: connect.squareup.com
Authorization: Bearer {{access_token}}
Content-Type: application/json
cache-control: no-cache
Postman-Token: 5d2c05ae-11d6-42bd-bd1e-47fa44621a98
{
"idempotency_key": "60f919ba-2042-4402-bc66-e6455ec32349",
"order": {
"reference_id": "reference_id",
"line_items": [
{
"name": "Printed T Shirt",
"quantity": "2",
"base_price_money": {
"amount": 1500,
"currency": "USD"
},
"discounts": [
{
"name": "7% off previous season item",
"percentage": "7"
},
{
"name": "$3 off Customer Discount",
"amount_money": {
"amount": 300,
"currency": "USD"
}
}
]
},
{
"name": "Slim Jeans",
"quantity": "1",
"base_price_money": {
"amount": 2500,
"currency": "USD"
}
},
{
"name": "Woven Sweater",
"quantity": "3",
"base_price_money": {
"amount": 3500,
"currency": "USD"
},
"discounts": [
{
"name": "$11 off Customer Discount",
"amount_money": {
"amount": 1100,
"currency": "USD"
}
}
],
"taxes": [
{
"name": "Fair Trade Tax",
"percentage": "5"
}
]
}
],
"discounts": [
{
"name": "Father's day 12% OFF",
"percentage": "12"
},
{
"name": "Global Sales $55 OFF",
"amount_money": {
"amount": 5500,
"currency": "USD"
}
}
],
"taxes": [
{
"name": "Sales Tax",
"percentage": "8.5"
}
]
},
"ask_for_shipping_address": true,
"merchant_support_email": "merchant+support#website.com",
"pre_populate_buyer_email": "example#email.com",
"pre_populate_shipping_address": {
"address_line_1": "1455 Market St.",
"address_line_2": "Suite 600",
"locality": "San Francisco",
"administrative_district_level_1": "CA",
"postal_code": "94103",
"country": "US",
"first_name": "Jane",
"last_name": "Doe"
}
}
I need to know how to take the nonce string from card form of square_in_app_payments plugin and send it in http request for complete the payment.
I try to create projects.locations.transferConfig.create on the page
https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/create
set parent projects/1069829667403/locations/eu
and Request body
{
"dataRefreshWindowDays": 10,
"destinationDatasetId": "stat",
"displayName": "test",
"dataSourceId": "adwords",
"params": {
"customer_id": "5030341011"
}
}
and have error
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
What am I doing wrong?
Request body should look like this:
{
"dataRefreshWindowDays": 10,
"destinationDatasetId": "stat",
"displayName": "test",
"dataSourceId": "adwords",
"params": {
"fields": {
"key": "customer_id",
"value": {
"string_value": "5030341011"
}
}
}
}