Skip to content

amount in the parameters as per documentation #17

Description

@Mutahhar12

ValueError Traceback (most recent call last)
/home/nebulova/Staytick_Backend/staytick__backend/lll.ipynb Cell 22 line 1
1 parameters = {
2 "merchant_code": "999008881",
3 "terminal": "1",
(...)
12 "merchant_url": "https://example.com/redsys/response",
13 }
---> 14 redd_client.prepare_request(parameters=payment_request)

File ~/.cache/pypoetry/virtualenvs/staytick-backend-TgLB6OAg-py3.11/lib/python3.11/site-packages/redsys/client.py:75, in RedirectClient.prepare_request(self, parameters)
72 def prepare_request(self, parameters: Dict[str, Any]) -> Dict[str, Any]:
73 """Takes the merchant parameters and returns the necessary parameters
74 to make the POST request to Redsys"""
---> 75 request = Request(parameters)
76 merchant_parameters = self.encode_parameters(request.prepare_parameters())
77 signature = self.generate_signature(request.order, merchant_parameters)

File ~/.cache/pypoetry/virtualenvs/staytick-backend-TgLB6OAg-py3.11/lib/python3.11/site-packages/redsys/request.py:89, in Request.init(self, parameters)
87 self._parameters[key] = value
88 else:
---> 89 raise ValueError(f"Unknown parameter {key}")

ValueError: Unknown parameter DS_MERCHANT_AMOUNT

here are the parameters as per your documentation

parameters = {
"merchant_code": "999008881",
"terminal": "1",
"transaction_type": STANDARD_PAYMENT,
"currency": EUR,
"order": "267688ZMy7iT",
"amount": D("10.56489").quantize(D(".01"), ROUND_HALF_UP),
"merchant_data": "test merchant data",
"merchant_name": "Example Commerce",
"titular": "Example Ltd.",
"product_description": "Products of Example Commerce",
"merchant_url": "https://example.com/redsys/response",
}

here is my code
redd_client.prepare_request(parameters=payment_request) and getting the error mentioned above

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions