-
Notifications
You must be signed in to change notification settings - Fork 18
Update createinvoice.php #32
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,15 +16,17 @@ | |
| $link = $GATEWAY['daemon_host'].":".$GATEWAY['daemon_port']."/json_rpc"; | ||
|
|
||
|
|
||
| function monero_payment_id(){ | ||
| if(!isset($_COOKIE['payment_id'])) { | ||
|
|
||
| function monero_payment_id($invoice_id){ | ||
| $invoice_id = checkCbInvoiceID($invoice_id, "monero"); | ||
| if(!isset($_COOKIE["payment_id$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); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems fair for me. |
||
| } else { | ||
| $payment_id = $_COOKIE['payment_id']; | ||
| } | ||
| return $payment_id; | ||
|
|
||
| $payment_id = $_COOKIE["payment_id$invoice_id"]; | ||
| } | ||
| return $payment_id; | ||
| } | ||
|
|
||
| $monero_daemon = new Monero_rpc($link); | ||
|
|
||
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?