Use redsys_environment to choose the correct URL to send the payment to
This commit is contained in:
parent
0cbf973cbb
commit
ac09fd77da
|
@ -17,6 +17,7 @@ import (
|
|||
|
||||
type paymentPage struct {
|
||||
*template.PublicPage
|
||||
Environment string
|
||||
Request *redsys.SignedRequest
|
||||
}
|
||||
|
||||
|
@ -29,6 +30,9 @@ func newPaymentPage(request *redsys.SignedRequest) *paymentPage {
|
|||
|
||||
func (p *paymentPage) MustRender(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn) {
|
||||
p.Setup(r, user, company, conn)
|
||||
if err := conn.QueryRow(r.Context(), "select environment from redsys where company_id = $1", company.ID).Scan(&p.Environment); err != nil && !database.ErrorIsNotFound(err) {
|
||||
panic(err)
|
||||
}
|
||||
template.MustRenderPublic(w, r, user, company, "payment/request.gohtml", p)
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,13 @@
|
|||
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.paymentPage*/ -}}
|
||||
<h2>{{( pgettext "Payment" "title" )}}</h2>
|
||||
{{ with .Request -}}
|
||||
<form action="https://sis-t.redsys.es:25443/sis/realizarPago" method="post">
|
||||
<form
|
||||
{{ if eq $.Environment "live" -}}
|
||||
action="https://sis.redsys.es/sis/realizarPago"
|
||||
{{- else -}}
|
||||
action="https://sis-t.redsys.es:25443/sis/realizarPago"
|
||||
{{- end }}
|
||||
method="post">
|
||||
<input type="hidden" name="Ds_MerchantParameters" value="{{ .MerchantParameters }}"/>
|
||||
<input type="hidden" name="Ds_Signature" value="{{ .Signature }}"/>
|
||||
<input type="hidden" name="Ds_SignatureVersion" value="{{ .SignatureVersion }}"/>
|
||||
|
|
Loading…
Reference in New Issue