-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: verify payment #892
fix: verify payment #892
Conversation
volodymyr-basiuk
commented
Jan 13, 2025
•
edited
Loading
edited
- The IsPaymentDone contract call should pass the signer address (the one recovered from the signature) as the first parameter, not the Recipient address.
- Refactor the payment verification process to simplify it.
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.
LGTM.
I jut left a small suggestion about a name but feel free to ignore it
internal/core/services/payment.go
Outdated
// paymentOptionConfigItem finds the payment option config item used to pay using the payment id stored in PaymentRequest database | ||
func (p *payment) paymentOptionConfigItem(ctx context.Context, issuerDID w3c.DID, item *domain.PaymentRequestItem) (*domain.PaymentOptionConfigItem, error) { | ||
paymentReq, err := p.paymentsStore.GetPaymentRequestByID(ctx, issuerDID, item.PaymentRequestID) | ||
func handleTransaction( |
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.
I would rename this function to something like handlePaymentTransaction or handleSomethingTransaction to avoid future collisions with other similar functions in package.
But we could postpone this renaming while we don't have this problem,
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.
Sure, renamed