-
Notifications
You must be signed in to change notification settings - Fork 19
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
Update createinvoice.php #32
base: master
Are you sure you want to change the base?
Conversation
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.
Why change $_COOKIE["payment_id"] to $_COOKIE["payment_id$invoice_id"] ?
IIRC there was no other way to get the invoice ID which is required so that payments can be applied correctly. |
$payment_id = bin2hex(openssl_random_pseudo_bytes(8)); | ||
setcookie('payment_id', $payment_id, time()+2700); | ||
// create cookie per invoice_id. | ||
setcookie("payment_id$invoice_id", $payment_id, time()+2700); |
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 can't understand the purpose of this change. Why should you call a cookie with the invoice id?
$payment_id = bin2hex(openssl_random_pseudo_bytes(8)); | ||
setcookie('payment_id', $payment_id, time()+2700); | ||
// create cookie per invoice_id. | ||
setcookie("payment_id$invoice_id", $payment_id, time()+2700); |
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 can't understand the purpose of this change. Why should you call a cookie with the invoice id?
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 think the idea is if you pay more than one invoice in a short time it keeps using the first one set. I ran into that once when testing but didn't see it again so didn't try to implement this change yet
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.
It seems fair for me.
No description provided.