Commercejs PayPal checkout internal error - reactjs

I am running into an internal error when trying to capture the checkout order with PayPal. When I run commerce.checkout.capture with paypal gateway and relevant details (payerId and paymentid) it throws a 500 internal error with this error message:
{
"message": "Unsuccessful response (500: ) received",
"statusCode": 500,
"statusText": "",
"data": {
"status_code": 500,
"error": {
"message": "There was an internal error. We have been notified.",
"type": "internal_error"
},
"id": "e231f6adc6e3469b95468b770ee2c5b1"
},
"originalError": {
"message": "Request failed with status code 500",
"name": "Error",
"stack": "Error: Request failed with status code 500\n at e.exports (https://www.alchemyremember.me/app-33ce862eff9a0d293497.js:2:27209)\n at e.exports (https://www.alchemyremember.me/app-33ce862eff9a0d293497.js:2:29644)\n at XMLHttpRequest.y (https://www.alchemyremember.me/app-33ce862eff9a0d293497.js:2:22514)",
"config": {
"url": "checkouts/chkt_gvRjwOGzeew4mN",
"method": "post",
"data": "{\"customer\":{\"firstname\":\"Matthew\",\"lastname\":\"Bloemetje\",\"email\":\"mattb007#gmail.com\"},\"payment\":{\"id\":\"gway_9l6LJmxJE8Oyo1\",\"gateway\":\"paypal\",\"paypal\":{\"action\":\"capture\",\"payment_id\":\"0YE34089FH8264019\",\"payer_id\":\"Q29FF5HGE63PG\"}}}",
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"X-Authorization": "pk_47885dbdd0e55e008c1c4982d9e35fb2c99247830bdc9",
"X-Chec-Agent": "commerce.js/v2",
"Chec-Version": "2021-09-29"
},
"params": null,
"baseURL": "https://api.chec.io/v1/",
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 60000,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
}
}
}
}
I tried to capture the paypal checkout data with commerce.checkout.capture. Expected to return order data with success message and redirect to confirmation page of the order

Related

I'm receiving a validation error when testing the POST request

I'm trying to learn CRUD in MERN but I've come across an error.
I'm trying to test connection to database but it's giving me a validation error. Here's the POST code:
`
POST http://localhost:3001/app/profile
Content-Type: application/json
{
"title":"This is Jay",
"description":"Self learnt full Stack Dev"
}
`
And here's the error I'm getting:
`
{
"errors": {
"description": {
"name": "ValidatorError",
"message": "Path `description` is required.",
"properties": {
"message": "Path `description` is required.",
"type": "required",
"path": "description"
},
"kind": "required",
"path": "description"
},
"title": {
"name": "ValidatorError",
"message": "Path `title` is required.",
"properties": {
"message": "Path `title` is required.",
"type": "required",
"path": "title"
},
"kind": "required",
"path": "title"
}
},
"_message": "crud validation failed",
"name": "ValidationError",
"message": "crud validation failed: description: Path `description` is required., title: Path `title` is required."
}
`
When I check the database the table is their and even on the response it tell me that **HTTP/1.1 200 OK
** so the connection is there but the data is not being sent.
In prior projects I've done the same testing and everything went ok but not sure why it's giving me this error this time.

Getting CORS Error while Integrating FedEx with React Js

While working on FedEx integration with React, we are able to get authorization key using Google extension but unable to work on other APIs. All the APIs are perfectly working in postman but not while integration. Tried checking rates and transit times but getting CORS error. I have included the code and error screenshot.Could you please help?
let body = JSON.stringify({
"accountNumber": {
"value": "XXXXXXXXX"
},
"requestedShipment": {
"shipper": {
"address": {
"postalCode": 75063,
"countryCode": "US"
}
},
"recipient": {
"address": {
"postalCode": "L0J 0A0",
"countryCode": "CA"
}
},
"pickupType": "DROPOFF_AT_FEDEX_LOCATION",
"serviceType": "FEDEX_GROUND",
"rateRequestType": [
"LIST",
"ACCOUNT"
],
"customsClearanceDetail": {
"dutiesPayment": {
"paymentType": "SENDER",
"payor": {
"responsibleParty": null
}
},
"commodities": [{
"description": "Camera",
"quantity": 1,
"quantityUnits": "PCS",
"weight": {
"units": "KG",
"value": 20
},
"customsValue": {
"amount": 100,
"currency": "USD"
}
}]
},
"requestedPackageLineItems": [{
"weight": {
"units": "KG",
"value": 20
}
}]
}
});
axios.post("https://apis-sandbox.fedex.com/rate/v1/rates/quotes", body, {
headers : {
"Accept": "*/*",
"Content-Type": "application/json",
"authorization": `Bearer XXX`,
"Access-Control-Allow-Origin": "*",
}
}).then(res => console.log(res.data));
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
Cors error cannot be solved from front end , cause its a browser error. so You have to create proxy server to solve this
create an API in backend and send request from server to fedex.

Delete Entity on Azure Table Storage from Logic App

I have a requirement to delete old records after X days from Azure Table Storage, so I have created a Logic App for that and run on daily bases to remove old data.
I have use the Get All Entities based on the condition in filter query and then run for each with delete entity in it.
Everything is running fine except the Delete Entity, it is giving 404 Resource Not Found error. I have used the same Partition and Row Key from For Each and also used Etag = * but still it is giving me 404.
Input
{
"method": "delete",
"headers": {
"If-Match": "*"
},
"path": "/Tables/deleteordertest/entities/etag(PartitionKey='2021-09-27T19:16:07.778815Z',RowKey='1')",
"host": {
"connection": {
"referenceName": "azuretables"
}
}
}
Output:
{
"statusCode": 404,
"headers": {
"Cache-Control": "no-cache",
"x-ms-request-id": "11d3c7fe-3002-004a-5ed3-0d0096000000",
"x-ms-version": "2016-05-31",
"X-Content-Type-Options": "nosniff",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"Date": "Thu, 20 Jan 2022 08:01:02 GMT",
"Content-Length": "251",
"Content-Type": "application/json"
},
"body": {
"odata.error": {
"code": "ResourceNotFound",
"message": {
"lang": "en-US",
"value": "The specified resource does not exist.\nRequestId:11d3c7fe-3002-004a-5ed3-0d0096000000\nTime:2022-01-20T08:01:02.6479920Z"
}
}
}
}
Working on Postman
If I try same thing in postman then it is working fine, so I don't know what can be the issue here. I have already tried to add and remove encodeURIComponent but no luck.
I doubt about the : in the PartitionKey but it is working while using Replace Entity (Merge), so it cannot be possible that it will work for one item and not for another..
If any one can help me here or guide me for any alternative.
After reproducing from our end found that the reason that you are receiving a 404 status code because of removing encodeURIComponent which will be refering to the entity that we are retrieving. After adding the encodeURIComponent in Get entities action solved the error.
Here is my logic app
Here is the codeview of my logic app
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"actions": {
"Delete_Entity_2": {
"inputs": {
"headers": {
"If-Match": "*"
},
"host": {
"connection": {
"referenceName": "azuretables"
}
},
"method": "delete",
"path": "/Tables/#{encodeURIComponent('Table2408')}/entities/etag(PartitionKey='#{encodeURIComponent(items('For_each')?['PartitionKey'])}',RowKey='#{encodeURIComponent(items('For_each')?['RowKey'])}')"
},
"runAfter": {},
"type": "ApiConnection"
}
},
"foreach": "#body('Get_entities')?['value']",
"runAfter": {
"Get_entities": [
"Succeeded"
]
},
"type": "Foreach"
},
"Get_entities": {
"inputs": {
"host": {
"connection": {
"referenceName": "azuretables"
}
},
"method": "get",
"path": "/Tables/#{encodeURIComponent('Table2408')}/entities",
"queries": {
"$filter": "PartitionKey le '5'"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "Second",
"interval": 15
},
"type": "Recurrence"
}
}
},
"kind": "Stateful"
}
Here is the output :-

Refresh token endpoint not working correctly - AADSTS90033

Since the recent outage, getting refresh tokens seems to be broken, even though the status account says everything is back to normal. Any idea what could be causing this?
"response": {
"statusCode": 503,
"body": {
"error": "temporarily_unavailable",
"error_description": "AADSTS90033: A transient error has occurred. Please try again.\r\nTrace ID: 988f6bab-9fde-44c7-b480-a2dd07fd4900\r\nCorrelation ID: 031c9c04-389f-4b45-9b45-a1f4ee1b5d75\r\nTimestamp: 2020-09-28 22:41:10Z",
"error_codes": [90033],
"timestamp": "2020-09-28 22:41:10Z",
"trace_id": "988f6bab-9fde-44c7-b480-a2dd07fd4900",
"correlation_id": "031c9c04-389f-4b45-9b45-a1f4ee1b5d75"
},
"headers": {
"cache-control": "no-store, no-cache",
"pragma": "no-cache",
"content-type": "application/json; charset=utf-8",
"expires": "-1",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"x-ms-request-id": "988f6bab-9fde-44c7-b480-a2dd07fd4900",
"x-ms-ests-server": "2.1.11063.14 - WEULR2 ProdSlices",
"set-cookie": ["fpc=...; expires=Wed, 28-Oct-2020 22:41:10 GMT; path=/; secure; HttpOnly; SameSite=None", "x-ms-gateway-slice=estsfd; path=/; secure; httponly", "stsservicecookie=estsfd; path=/; secure; httponly"],
"date": "Mon, 28 Sep 2020 22:41:10 GMT",
"connection": "close",
"content-length": "424"
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "login.microsoftonline.com",
"port": 443,
"hostname": "login.microsoftonline.com",
"hash": null,
"search": null,
"query": null,
"pathname": "/common/oauth2/v2.0/token",
"path": "/common/oauth2/v2.0/token",
"href": "https://login.microsoftonline.com/common/oauth2/v2.0/token"
},
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"accept": "application/json",
"content-length": 1607
}
}
Getting access tokens seems to work..
This was part of the recent outage, please try again now. It has been resolved.

Users added via graph not receiving welcome email

First I tried adding a group owner as both owner and member in the same http call as I created the group:
{
"description": "test group",
"displayName": "test_group",
"groupTypes": [
"Unified"
],
"mailEnabled": true,
"mailNickname": "project.1-TestPreview",
"members#odata.bind": [
"https://graph.microsoft.com/v1.0/users/{id}"
],
"owners#odata.bind": [
"https://graph.microsoft.com/v1.0/users/{id}"
],
"securityEnabled": false,
"visibility": "private"
}
The user is added as a member and owner successfully, but not receiving a welcome email.
I then tried to split the http calls, thinking that there was an issue with the emails as the group was created at the same time as the user was added.
I created the group with one user being added in the creation http call same as above and three other users being added as owner and member ~30 seconds after the group was created. For this I used
queries:
{
"type": "POST",
"url": "https://graph.microsoft.com/v1.0/$batch"
}
body
{
"requests": [
{
"body": {
"#odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
},
"headers": {
"Content-Type": "application/json"
},
"id": "1",
"method": "POST",
"url": "groups/{id}/members/$ref"
},
{
"body": {
"#odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
},
"headers": {
"Content-Type": "application/json"
},
"id": "2",
"method": "POST",
"url": "groups/{id}/members/$ref"
},
{
"body": {
"#odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
},
"headers": {
"Content-Type": "application/json"
},
"id": "3",
"method": "POST",
"url": "groups/{id}/members/$ref"
}
]
}
I added the users as owners with the same method. None of them received a welcome email. How can I make sure that the email fires?
I am doing this in Logic Apps:
You need a proper Microsoft 365, Office 365 or Exchange license. Do you have one?

Resources