Beispiel #1
0
 public static string CreateVerifyData(SamanCallbackResult callbackResult, SamanGatewayOptions options)
 {
     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\">{options.MerchantId}</String_2>" +
          "</urn:verifyTransaction>" +
          "</soapenv:Body>" +
          "</soapenv:Envelope>");
 }
Beispiel #2
0
 public static string CreateRefundData(Payment payment, Money amount, SamanGatewayOptions options)
 {
     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\">{payment.TransactionCode}</String_1>" +
          $"<String_2 xsi:type=\"xsd:string\">{(long)amount}</String_2>" +
          $"<Username xsi:type=\"xsd:string\">{options.MerchantId}</Username>" +
          $"<Password xsi:type=\"xsd:string\">{options.Password}</Password>" +
          "</urn:reverseTransaction>" +
          "</soapenv:Body>" +
          "</soapenv:Envelope>");
 }
Beispiel #3
0
        public static PaymentRequestResult CreateRequestResult(Invoice invoice, IHttpContextAccessor httpContextAccessor, SamanGatewayOptions options)
        {
            var transporter = new GatewayPost(
                httpContextAccessor,
                PaymentPageUrl,
                new Dictionary <string, string>
            {
                { "Amount", invoice.Amount.ToLongString() },
                { "MID", options.MerchantId },
                { "ResNum", invoice.TrackingNumber.ToString() },
                { "RedirectURL", invoice.CallbackUrl }
            });

            return(PaymentRequestResult.Succeed(transporter));
        }