Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

apezio
Copy link
Contributor

@apezio apezio commented Mar 8, 2018

No description provided.

Copy link
Contributor

@enricodias enricodias left a 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"] ?

@apezio
Copy link
Contributor Author

apezio commented Apr 15, 2022

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);
Copy link
Member

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);
Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

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.

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