-
Notifications
You must be signed in to change notification settings - Fork 112
TypeError: Cannot read property 'entries' of undefined #61
Comments
I was able to fix that but am now getting
from:
I see path is already declared as
|
Hi @jjaw, I have just published a new version with some modification in the path logic, could you please test with that version? If you still have problem could you please provide the postman collection that is failing for test? Best Regards. |
Hi @joolfe thank you for getting back to me. This is the new error that I'm seeing, attached my postman collection. TypeError: Cannot read property 'slice' of undefined {
"info": {
"_postman_id": "{{postman-id}}",
"name": "{{project name}}",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Token",
"event": [
{
"listen": "test",
"script": {
"id": "{{project id}}",
"exec": [
"var data = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"access_token\", data.access_token);",
"postman.setEnvironmentVariable(\"refresh_token\", data.refresh_token);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "username",
"value": "{{mc-username}}",
"type": "text"
},
{
"key": "password",
"value": "{{mc-password}}",
"type": "text"
},
{
"key": "grant_type",
"value": "password",
"type": "text"
},
{
"key": "client_id",
"value": "merchapi",
"type": "text"
},
{
"key": "client_secret",
"value": "{{client-secret}}",
"type": "text"
}
]
},
"url": {
"raw": "{{KEYCLOAK-TOKEN-URL}}",
"host": [
"{{KEYCLOAK-TOKEN-URL}}"
]
}
},
"response": []
},
{
"name": "Merchant FLAT Create (Acquiring)",
"event": [
{
"listen": "test",
"script": {
"id": "{{project-id}}",
"exec": [
"var data = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"merchant-id\", data.merchantId);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"templateId\": \"{{template-id}}\",\n \"merchant\": {\n \"salesCode\": \"{{sales-code}}\",\n \"akaBusinessName\": \"Ryans Test AKA name\",\n \"custPrimaryAcctFlg\": false,\n \"dbaName\": \"Ryans Test DBA name\",\n \"legalBusinessName\": \"Ryans Test legal name\",\n \"taxFilingName\": \"Ryans Test tax filing name\",\n\n \"demographic\": {\n \"businessIncorporatedStateCd\": \"CO\",\n \"merchantTimeZone\": \"MT\",\n \"websiteAddress\": \"www.test.com\",\n \"businessPhone\": \"444-444-1234\",\n \"businessFax\": \"444-444-1234\",\n \"businessAddress\": {\n \"address1\": \"123 Fake St\",\n \"address2\": \"Apt. 23\",\n \"city\": \"Fakeville\",\n \"countryCd\": \"US\",\n \"stateCd\": \"IL\",\n \"zip\": \"11111\"\n },\n \"mailingAddress\": {\n \"address1\": \"123 Main St.\",\n \"address2\": \"Suite 3001\",\n \"city\": \"Boulder\",\n \"countryCd\": \"US\",\n \"stateCd\": \"CO\",\n \"zip\": \"11223\"\n }\n }, \n \"businessIdTypeCd\": \"ARTICLE\",\n \"businessStartDate\": \"04/26/2002\",\n \"bankDetail\": {\n \"depositBank\": {\n \"bankAcctNum\": \"12345678\",\n \"bankRoutingNum\": \"031000503\",\n \"bankAcctTypeCd\": \"SAVINGS\",\n \"bankName\": \"Dep Bank\"\n },\n \"withdrawalBank\": {\n \"bankAcctNum\": \"87654321\",\n \"bankRoutingNum\": \"031000503\",\n \"bankAcctTypeCd\": \"BIZ\",\n \"bankName\": \"With Bank\"\n }\n }, \n \"ownership\": {\n \"owner\": {\n \"ownerAddress\": {\n \"address1\": \"123 Fake St\",\n \"address2\": \"Apt 121\",\n \"city\": \"Boulder\",\n \"countryCd\": \"US\",\n \"stateCd\": \"CO\",\n \"zip\": \"19335\"\n }, \n \"ownerEmail\": \"ryantest@test.com\", \n \"ownerName\": \"Ryan Test\",\n \"ownerDob\": \"09/22/1997\",\n \"ownerPhone\": \"555-555-4321\",\n \"ownerSSN\": \"111-22-3333\",\n \"ownerTitle\": \"PRESIDENT\"\n },\n \"ownershipTypeCd\": \"PRIVCORP\",\n \"driversLicenseNumber\": \"2342343243\",\n \"driversLicenseStateCd\": \"CO\",\n \"ownerOwnershipPct\": 100\n },\n \"merchantContactInfo\": {\n \"contactName\": \"Ryan Test\", \n \"contactEmail\": \"ryantest@test.com\", \n \"contactPhone\": \"333-333-4321\"\n },\n \"processing\": {\n \"platformDetails\": {\n \"amexProgramAssetCd\": \"ESA\",\n \"amexProgramMid\": \"2341251235434\",\n \"discoverMid\": \"2134123423555\",\n \"discoverProgramCd\": \"MAP\", \n \"acquiringFlg\": true, \n \"taxId\": \"485968574\",\n \"tid\": \"968596859\",\n \"busnsId\": \"234444234234\", \n \"busnsIdPlaceOfIssue\": \"CO\", \n \"currencyCode\": \"USD\", \n \"mccId\": \"3073\", \n \"businessDescription\": \"Business Description\"\n },\n \"businessDetails\": {\n \"customerBillPriorToShipFlg\": false,\n \"depositReqForFulfillFlg\": true,\n \"whenCustomerChargedCd\": \"INADVANCE\", \n \"refundPolicyCd\": \"EXCHONLY\", \n \"serviceProvidedInCd\": \"30LESS\" \n \n },\n \"volumeDetails\": {\n \"averageMonthlyVolume\": 9999.00,\n \"highTicketAmount\": 99.99,\n \"averageTicketAmount\": 9.99\n },\n \"deliveryPercentages\": {\n \"dlvry0To7DaysPct\": 97,\n \"dlvry15To30DaysPct\": 1,\n \"dlvry8To14DaysPct\": 1,\n \"dlvryOver30DaysPct\": 1 \n },\n \"modeOfTransaction\": {\n \"eCommercePct\": 0,\n \"keyedPct\": 20,\n \"mailOrderPct\": 30,\n \"swipedPct\": 50 \n }\n },\n \"webLeadFlg\": true,\n \"pricing\": {\n \"pricingType\": \"FLAT\",\n \"flatPricing\":{\n \"amex\": {\n \"esaQualDiscountPct\": 22.00, \n \"optBlueQualDiscountPct\": 11.00 \n },\n \"discover\": {\n \"qualCreditDiscountPct\": 1.00\n },\n \"mastercard\": {\n \"qualCreditDiscountPct\": 5.00\n },\n \"visa\": {\n \"qualCreditDiscountPct\": 4.00\n }\n }\n },\n \"fees\": {\n \"achBatchFee\": 1.11,\n \"addressVerifFee\": 2.22,\n \"annualMembershipFee\": 3.33,\n \"appFee\": 4.44,\n \"authFee\": 5.55, \n \"chargebackFee\": 6.66, \n \"dataBreachFee\": 7.77, \n \"ddaRejectFee\": 8.88, \n \"earlyCancelFee\": 9.99, \n \"minProcessFee\": 20.00, \n \"pciAnnualFee\": 21.00, \n \"pciNonComplianceFee\": 100.00, \n \"regProdMonthlyFee\": 200.00, \n \"retrievalFee\": 10.00, \n \"statementFee\": 27.99,\n \"transactionFee\": 0.05,\n \"voiceAuthFee\": 0.10,\n \"wirelessActivationFee\": 0.10,\n \"wirelessFee\": 50.00,\n \"duesAndAssessmentsFlg\": true,\n \"passthruInterchgCostsFlg\": true\n }\n },\n \"ownerSiteUser\": {\n \"firstName\": \"Ryan\",\n \"lastName\": \"Test\",\n \"email\": \"ryantest@test.com\"\n }\n }\n"
},
"url": {
"raw": "{{API-URL}}/merchant",
"host": [
"{{API-URL}}"
],
"path": [
"merchant"
]
}
},
"response": []
},
{
"name": "Merchant Find",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}"
]
}
},
"response": []
},
{
"name": "Merchant Status Find",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}/status",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}",
"status"
]
}
},
"response": []
},
{
"name": "Lookup Ownership Types",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/ownershipTypes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"ownershipTypes"
]
}
},
"response": []
},
{
"name": "Lookup Bank Acct Types",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/bankAcctTypes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"bankAcctTypes"
]
}
},
"response": []
},
{
"name": "Lookup Country Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/countryCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"countryCodes"
]
}
},
"response": []
},
{
"name": "Lookup State Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/stateCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"stateCodes"
]
}
},
"response": []
},
{
"name": "Lookup When Customer Charged Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/whenCustomerChargedCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"whenCustomerChargedCodes"
]
}
},
"response": []
},
{
"name": "Lookup Refund Policy Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/refundPolicyCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"refundPolicyCodes"
]
}
},
"response": []
},
{
"name": "Lookup Service Provided In Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/serviceProvidedInCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"serviceProvidedInCodes"
]
}
},
"response": []
},
{
"name": "Lookup Front End Platform Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/frontEndPlatformCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"frontEndPlatformCodes"
]
}
},
"response": []
},
{
"name": "Lookup Back End Platform Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/backEndPlatformCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"backEndPlatformCodes"
]
}
},
"response": []
},
{
"name": "Lookup Discover Program Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/discoverProgramCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"discoverProgramCodes"
]
}
},
"response": []
},
{
"name": "Lookup Amex Program Codes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/amexProgramAssetCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"amexProgramAssetCodes"
]
}
},
"response": []
},
{
"name": "Merchant Signature Status",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}/signature",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}",
"signature"
]
}
},
"response": []
},
{
"name": "Merchant Signature Create",
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}/signature",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}",
"signature"
]
}
},
"response": []
},
{
"name": "Merchant Retract Signature",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}/signature",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}",
"signature"
]
}
},
"response": []
},
{
"name": "Merchant Signature URL",
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}/signature",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}",
"signature"
]
}
},
"response": []
},
{
"name": "Merchant attachment create",
"event": [
{
"listen": "test",
"script": {
"id": "{{project-id}},
"exec": [
"var data = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"merchant-id\", data.merchantId);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"attachment\" : {\r\n \"fileName\" : \"VoidedCheck.pdf\",\r\n \"mimeType\" : \"application/pdf\",\r\n \"description\" : \"This is the voided check\",\r\n \"attachmentTypeCd\" : \"VOIDBNKCHK1\",\r\n \"document\" : \"JVBERi0xLjEKJcKlwrHDqwoKMSAwIG9iagogIDw8IC9UeXBlIC9DYXRhbG9nCiAgICAgL1BhZ2Vz\r\nIDIgMCBSCiAgPj4KZW5kb2JqCgoyIDAgb2JqCiAgPDwgL1R5cGUgL1BhZ2VzCiAgICAgL0tpZHMg\r\nWzMgMCBSXQogICAgIC9Db3VudCAxCiAgICAgL01lZGlhQm94IFswIDAgMzAwIDE0NF0KICA+Pgpl\r\nbmRvYmoKCjMgMCBvYmoKICA8PCAgL1R5cGUgL1BhZ2UKICAgICAgL1BhcmVudCAyIDAgUgogICAg\r\nICAvUmVzb3VyY2VzCiAgICAgICA8PCAvRm9udAogICAgICAgICAgIDw8IC9GMQogICAgICAgICAg\r\nICAgICA8PCAvVHlwZSAvRm9udAogICAgICAgICAgICAgICAgICAvU3VidHlwZSAvVHlwZTEKICAg\r\nICAgICAgICAgICAgICAgL0Jhc2VGb250IC9UaW1lcy1Sb21hbgogICAgICAgICAgICAgICA+Pgog\r\nICAgICAgICAgID4+CiAgICAgICA+PgogICAgICAvQ29udGVudHMgNCAwIFIKICA+PgplbmRvYmoK\r\nCjQgMCBvYmoKICA8PCAvTGVuZ3RoIDU1ID4+CnN0cmVhbQogIEJUCiAgICAvRjEgMTggVGYKICAg\r\nIDAgMCBUZAogICAgKEhlbGxvIFdvcmxkKSBUagogIEVUCmVuZHN0cmVhbQplbmRvYmoKCnhyZWYK\r\nMCA1CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxOCAwMDAwMCBuIAowMDAwMDAwMDc3IDAw\r\nMDAwIG4gCjAwMDAwMDAxNzggMDAwMDAgbiAKMDAwMDAwMDQ1NyAwMDAwMCBuIAp0cmFpbGVyCiAg\r\nPDwgIC9Sb290IDEgMCBSCiAgICAgIC9TaXplIDUKICA+PgpzdGFydHhyZWYKNTY1CiUlRU9GCg==\"\r\n }\r\n}"
},
"url": {
"raw": "{{API-URL}}/merchant/{{merchant-id}}/attachment",
"host": [
"{{API-URL}}"
],
"path": [
"merchant",
"{{merchant-id}}",
"attachment"
]
}
},
"response": []
},
{
"name": "attachmentTypeCodes",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "{{api-version-header}}",
"value": "{{api-version}}"
}
],
"url": {
"raw": "{{API-URL}}/lookup/attachmentTypeCodes",
"host": [
"{{API-URL}}"
],
"path": [
"lookup",
"attachmentTypeCodes"
]
}
},
"response": []
}
],
"protocolProfileBehavior": {}
} |
Thanks, I will review tomorrow ;-) |
hi @jjaw, I have released a new version 1.4.0 that contain some fixed bugs and features to make your collection works, you can see the details on #66, #65, #64, #63. But I also have found some "issues" in your collection that should be amended before make it work: Once you fix this errors your collections should work with the new version ;-) |
Do you mean like this? "body": {
"mode": "raw",
"raw": {
"type": "None",
},
}, |
Hi @jjaw, what version of postman are you using? You just need to navigate to the "Body" tab and select the "none" radio, as is showed in the images in the comment above. |
I'm using the latest version. Okay thank you. |
At first I keep on getting this error:
SyntaxError: Unexpected token i in JSON at position 0
so I did this:
const postmanJson = JSON.parse(JSON.stringify(collectionFile))
but now I'm getting TypeError: Cannot read property 'entries' of undefined from here:
for (let [i, element] of items.entries()) { const { item, name } = element if (item != null) { // is a folder const tagged = item.map(e => ({ ...e, tag: name })) items.splice(i, 1, ...tagged) element = tagged.shift() }
Can you advise ?
The text was updated successfully, but these errors were encountered: