Skip to content

feat: add third party to the declarative payment network#528

Closed
vrolland wants to merge 5 commits intomasterfrom
adv-logic-src-third-part-declarative
Closed

feat: add third party to the declarative payment network#528
vrolland wants to merge 5 commits intomasterfrom
adv-logic-src-third-part-declarative

Conversation

@vrolland
Copy link
Contributor

@vrolland vrolland commented Jun 24, 2021

I have added from in the event to make the difference between declaration from the thirdpary and the payee/payer.

@vrolland vrolland changed the title feature: advanced logic add third party for the declarative payment network feature: add third party to the declarative payment network Jun 24, 2021
@coveralls
Copy link

coveralls commented Jun 24, 2021

Coverage Status

Coverage increased (+0.05%) to 89.261% when pulling a2d32eb on adv-logic-src-third-part-declarative into 439e345 on master.

@vrolland vrolland changed the title feature: add third party to the declarative payment network feat: add third party to the declarative payment network Jun 24, 2021
vrolland added 2 commits June 24, 2021 16:07
…uestNetwork/requestNetwork into adv-logic-src-third-part-declarative
@vrolland vrolland requested review from Dadogg80, benjlevesque, bertux, siibars and yomarion and removed request for benjlevesque June 24, 2021 14:09
Copy link
Contributor

@yomarion yomarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice ! I wonder if I miss something about payer impersonation or if just disagree, but we may have to talk a bit :)

Comment on lines +208 to +209
if (!requestState.payer && !extensionState.values.thirdparty) {
throw Error(`The request must have a payer or a thirdparty`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised by this condition, a declarative request allows the third party to detect that the payment has been made, which is an action done by the issuer, not the payer. Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yomarion this action is a "payment sent" action

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know. I think there are flows, it's not because the issuer trusts the 3rd party that the payer has to trust it.

Comment on lines +367 to +371
if (
!Utils.identity.areEqual(actionSigner, requestState.payer) &&
!Utils.identity.areEqual(actionSigner, extensionState.values.thirdparty)
) {
throw Error(`The signer must be the payer or the thirdparty`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the third-party should have payer privileges. Maybe there should be a payee third party and a payer third party (in a later version ?) but one actor can only delegate his own action to a third-party, in my opinion.

Let's take bank accounts, if a third-party appointed by the issuer can make sure the refunds has been sent, it cannot know on behalf of the payer that the money has been received.

(this comment applies for all the functions below where the third party can impersonate the payer)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in line with my earlier comment about multiple thirdparties

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, are we in line also to make the multiple third parties in another release ?

Copy link
Contributor

@benjlevesque benjlevesque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! We need to decide on @yomarion's comment about the thirdparty privileges.

Comment on lines +208 to +209
if (!requestState.payer && !extensionState.values.thirdparty) {
throw Error(`The request must have a payer or a thirdparty`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yomarion this action is a "payment sent" action

Comment on lines +367 to +371
if (
!Utils.identity.areEqual(actionSigner, requestState.payer) &&
!Utils.identity.areEqual(actionSigner, extensionState.values.thirdparty)
) {
throw Error(`The signer must be the payer or the thirdparty`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in line with my earlier comment about multiple thirdparties

name: EVENTS_NAMES;
parameters?: TEventParameters;
timestamp?: number;
from?: IIdentity;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be used only by declarative, right?

I think adding a comment is required here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for declarative for now. But could be use somewhere else if needed later.

@vrolland vrolland closed this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants