This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Pass Gateway response if Issuer response is empty #15
Open
fpolowood
wants to merge
17
commits into
hps:master
Choose a base branch
from
fpolowood:pass-gtw-response
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
91af24c
Pass Gateway response if Issuer response is empty
d8d438b
Pass Gateway response if Issuer response is empty
10b05a7
Pass Gateway response if Issuer response is empty
37f4722
Fix typo on helpers
26b3797
Merge pull request #1 from fpolowood/typo-on-helpers
fpolowood b472f51
Added more Transaction types and Services
4015d08
Merge pull request #2 from fpolowood/typo-on-helpers
fpolowood 1cdf94b
Fixed typo
855a883
Fixed Logic error and tests
eb9c51b
Fixed Logic error and tests
f95fcae
pass status downstream
a7ce279
Merge branch 'pass-gtw-response'
fpolowood 91125e5
Fix SettlementAmnt to come from Data
fpolowood f958ecc
Merge branch 'pass-gtw-response'
fpolowood 28c94bf
Enable TrackData
fpolowood 417b941
Merge branch 'master' into pass-gtw-response
fpolowood 58755c6
hydrated additional Txn Fields
fpolowood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| 'use strict'; | ||
|
|
||
| var assert = require('assert'), | ||
| schema = require('../../lib/infrastructure/validation/portico-schema'), | ||
| helpers = require('../../lib/infrastructure/helpers'); | ||
|
|
||
| exports.isEmptyObject = { | ||
| onNull: function () { | ||
| var rc = helpers.isEmptyObject(null); | ||
| assert.equal(rc,true,'null should return true'); | ||
| }, | ||
|
|
||
| onEmpty: function(){ | ||
| var rc = helpers.isEmptyObject({}); | ||
| assert.equal(rc,true,'{} should return true'); | ||
| }, | ||
|
|
||
| onNotObject: function() { | ||
| var rc = helpers.isEmptyObject(''); | ||
| assert.equal(rc,false,'\'\' should return false'); | ||
| }, | ||
|
|
||
| onString: function(){ | ||
| var rc = helpers.isEmptyObject(' '); | ||
| assert.equal(rc,false,'\' \' should return false'); | ||
| }, | ||
|
|
||
| onNotEmpty: function(){ | ||
| var rc = helpers.isEmptyObject({x:0}); | ||
| assert.equal(rc,false,'{x:0} should return false'); | ||
| } | ||
| }; | ||
|
|
||
| exports.validateRequestTypes = { | ||
| validObjects: function(){ | ||
| requestTypes.map(rt=>{ | ||
| var rc = schema.requestType(rt); | ||
| assert.equal(helpers.isEmptyObject(rc),false, rt + ' should be a valid type'); | ||
| assert.equal(isRequestObject(rc),true, rt + ' should be a valid request object'); | ||
| }); | ||
| }, | ||
| validTransactions: function(){ | ||
| requestTypes.map(rt=>{ | ||
| var rc = helpers.serviceNameToTransactionType(rt); | ||
| assert.notEqual(rc,null, rt + ' should have a Transaction Type'); | ||
| }); | ||
| }, | ||
|
|
||
| validServiceNames: function(){ | ||
| requestTypes.map(rt=>{ | ||
| var rc = helpers.serviceNameToTransactionType(rt); | ||
| var rc2 = helpers.transactionTypeToServiceName(rc); | ||
| assert.notEqual(rc2,null,rt + ' should be a valid Service Name'); | ||
| assert.equal(rt,rc2, rt + ' should be the same as ' + rc2); | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| function isRequestObject(o){ | ||
| var rc = false; | ||
| if (!helpers.isEmptyObject(o)){ | ||
| if (o.type==='object'&&!helpers.isEmptyObject(o.properties)){ | ||
| rc = true; | ||
| } | ||
| } | ||
| return rc; | ||
| } | ||
|
|
||
| var requestTypes = [ | ||
| 'CreditSale', | ||
| 'CreditAuth', | ||
| 'CreditAccountVerify', | ||
| 'CreditAddToBatch', | ||
| 'CreditReturn', | ||
| 'CreditReversal', | ||
| 'ReportActivity', | ||
| 'ReportBatchDetail', | ||
| 'ReportBatchHistory', | ||
| 'ReportBatchSummary', | ||
| //'ReportOpenAuths', | ||
| 'ReportTxnDetail', | ||
| 'ManageTokens' | ||
| ] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For track data, we'll need to have the ability to set the
methodattribute of theTrackDatadata field as eitherswipeorproximityto allow for contactless as well, so it may be better to pass the track data as an object similar to our other SDKs. You can reference our .NET SDK: Data Class, Hydration.Also, our gateway supports encrypted track data (a large portion of the readers are encrypted with Heartland's End-To-End Encryption [E3]), so it would be nice to have this capability as well. You can reference our .NET SDK: Data Class, Hydration.