commit 48ac0d36ef46496bcd8570dd0f79cb7dcf24f9dd
parent 12988da431cf056831309b903c14c5fff8ce6fa4
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Wed, 4 Sep 2024 16:42:47 +0200
update with new taler-go
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/go.mod b/go.mod
@@ -5,7 +5,7 @@ go 1.18
require (
github.com/google/uuid v1.4.0
github.com/gorilla/mux v1.8.1
- github.com/schanzen/taler-go v1.0.3
+ github.com/schanzen/taler-go v1.0.5
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
gopkg.in/ini.v1 v1.67.0
)
diff --git a/pkg/rest/gnsregistrar.go b/pkg/rest/gnsregistrar.go
@@ -616,7 +616,7 @@ func (t *Registrar) paymentPage(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/name/" + sanitizedLabel + "?error=Payment already paid.", http.StatusSeeOther)
return
}
- _, payto, paytoErr := t.Merchant.IsOrderPaid(regMetadata.OrderID)
+ _, _, payto, paytoErr := t.Merchant.IsOrderPaid(regMetadata.OrderID)
if paytoErr != nil {
http.Redirect(w, r, "/name/" + sanitizedLabel + "?error=Payment failed: Error getting payment data", http.StatusSeeOther)
return
@@ -715,7 +715,8 @@ func (t *Registrar) buyPage(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/name/" + sanitizedLabel + "?error=Registration failed: Unable to create order", http.StatusSeeOther)
return
}
- _, _, paytoErr := t.Merchant.IsOrderPaid(orderID)
+ // FIXME: based on order status, we probably want to display something else
+ _, _, _, paytoErr := t.Merchant.IsOrderPaid(orderID)
if paytoErr != nil {
http.Redirect(w, r, "/name/" + sanitizedLabel + "?error=Registration failed: Error getting payment data", http.StatusSeeOther)
return
@@ -781,7 +782,7 @@ func (t *Registrar) getCurrentRegistrationMetadata(label string, nsRecord *Names
}
// Does this registration have an unpaid order? if yes, check payment status and update if necessary.
if !regMetadata.Paid {
- rc, payto, paytoErr := t.Merchant.IsOrderPaid(regMetadata.OrderID)
+ rc, orderStatus, _, paytoErr := t.Merchant.IsOrderPaid(regMetadata.OrderID)
if nil != paytoErr {
if rc == http.StatusNotFound {
if time.Now().After(time.UnixMicro(int64(regMetadata.Expiration))) {
@@ -797,7 +798,7 @@ func (t *Registrar) getCurrentRegistrationMetadata(label string, nsRecord *Names
}
return nil, errors.New("Error determining payment status: " + paytoErr.Error())
}
- if "" == payto {
+ if merchant.OrderPaid == orderStatus {
// Order was paid!
regMetadata.Paid = true
var newZkeyRecord RecordData