fix(payment): set TwentyCard package amounts and send rials to gateway
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2s
Gateway 11,200,000 toman and wallet credit 12,656,000 toman; multiply by 10 when posting to TwentyCard API. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -58,7 +58,9 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
||||
{
|
||||
try
|
||||
{
|
||||
var amount = ((long)request.Amount).ToString();
|
||||
// ۲۰کارت amount را به ریال میگیرد (تومان × ۱۰)
|
||||
var amountRial = ((long)request.Amount) * 10L;
|
||||
var amount = amountRial.ToString();
|
||||
var payerName = string.IsNullOrWhiteSpace(request.Name)
|
||||
? (string.IsNullOrWhiteSpace(request.Mobile) ? "کاربر" : request.Mobile)
|
||||
: request.Name.Trim();
|
||||
@@ -85,8 +87,8 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
||||
AddFormField(content, "national_id", request.NationalId);
|
||||
|
||||
_logger.LogInformation(
|
||||
"TwentyCard payment request: Amount={Amount} Toman, User={UserId}, Invoice={Invoice}",
|
||||
amount, request.UserId, invoice);
|
||||
"TwentyCard payment request: Amount={AmountToman} Toman ({AmountRial} Rial), User={UserId}, Invoice={Invoice}",
|
||||
(long)request.Amount, amountRial, request.UserId, invoice);
|
||||
|
||||
var response = await _httpClient.PostAsync("api/pgw/merchant/request", content, cancellationToken);
|
||||
var responseBody = await response.Content.ReadAsStringAsync(cancellationToken);
|
||||
@@ -169,7 +171,7 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
||||
["terminal_username"] = _terminalUsername,
|
||||
["terminal_password"] = _terminalPassword,
|
||||
["authority"] = refId,
|
||||
["amount"] = ((long)amountInToman).ToString()
|
||||
["amount"] = (((long)amountInToman) * 10L).ToString()
|
||||
});
|
||||
|
||||
var response = await _httpClient.PostAsync("api/pgw/merchant/verify", content, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user