public static string CreateVerifyData(SamanCallbackResult callbackResult, SamanGatewayAccount account) { return ("<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:Foo\">" + "<soapenv:Header/>" + "<soapenv:Body>" + "<urn:verifyTransaction soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + $"<String_1 xsi:type=\"xsd:string\">{callbackResult.TransactionId}</String_1>" + $"<String_2 xsi:type=\"xsd:string\">{account.MerchantId}</String_2>" + "</urn:verifyTransaction>" + "</soapenv:Body>" + "</soapenv:Envelope>"); }
public static string CreateRefundData(VerifyContext context, Money amount, SamanGatewayAccount account) { return ("<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:Foo\">" + "<soapenv:Header/>" + "<soapenv:Body>" + "<urn:reverseTransaction soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + $"<String_1 xsi:type=\"xsd:string\">{context.Payment.TransactionCode}</String_1>" + $"<String_2 xsi:type=\"xsd:string\">{(long)amount}</String_2>" + $"<Username xsi:type=\"xsd:string\">{account.MerchantId}</Username>" + $"<Password xsi:type=\"xsd:string\">{account.Password}</Password>" + "</urn:reverseTransaction>" + "</soapenv:Body>" + "</soapenv:Envelope>"); }
public static PaymentRequestResult CreateRequestResult(Invoice invoice, IHttpContextAccessor httpContextAccessor, SamanGatewayAccount account) { var transporter = new GatewayPost( httpContextAccessor, PaymentPageUrl, new Dictionary <string, string> { { "Amount", invoice.Amount.ToLongString() }, { "MID", account.MerchantId }, { "ResNum", invoice.TrackingNumber.ToString() }, { "RedirectURL", invoice.CallbackUrl } }); return(PaymentRequestResult.Succeed(transporter, account.Name)); }