ValidateExpiry() public method

public ValidateExpiry ( ) : bool
return bool
Ejemplo n.º 1
0
        public SecurePayMessage CreateCustomerWithCharge(string clientId, SecurePayCardInfo card, SecurePayPayment payment)
        {
            card.ValidateExpiry();

            var request = CreateReadyToTriggerPaymentXml(card, clientId, payment);

            var response = SendMessage(request, "CreateCustomerWithCharge");

            return response;
        }
Ejemplo n.º 2
0
        public SecurePayMessage SingleCharge(SecurePayCardInfo card, SecurePayPayment payment, string referenceId)
        {
            card.ValidateExpiry();

            var request = SinglePaymentXml(card, payment, referenceId);

            var response = SendMessage(request, "SingleCharge");

            return response;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// TODO: replace this with creation of a SecurePayMessage object
        /// </summary>
        public string SinglePaymentXml(SecurePayCardInfo card, SecurePayPayment payment, string purchaseOrderNo)
        {
            card.ValidateExpiry();

            return new XDocument(
                new XDeclaration("1.0", "utf-8", "no"),
                new XElement("SecurePayMessage",
                    new XElement("MessageInfo",
                        new XElement("messageID", "757a5be5b84b4d8ab84ec03ebd24af"),
                        new XElement("messageTimestamp", GetTimeStamp(DateTime.Now)),
                        new XElement("timeoutValue", _connectionTimeoutSeconds),
                        new XElement("apiVersion", "xml-4.2")),
                    new XElement("MerchantInfo",
                        new XElement("merchantID", _merchantId),
                        new XElement("password", _password)),
                    new XElement("RequestType", "Payment"),
                    new XElement("Payment",
                        new XElement("TxnList", new XAttribute("count", "1"),
                            new XElement("Txn", new XAttribute("ID", "1"),
                                new XElement("txnType", "0"),
                                new XElement("txnSource", "0"),
                                new XElement("amount", payment.Amount),
                                new XElement("currency", payment.Currency.ToUpper()),
                                new XElement("purchaseOrderNo", purchaseOrderNo),
                                    new XElement("CreditCardInfo",
                                        new XElement("cardNumber", card.Number),
                                        new XElement("expiryDate", card.GetExpiry())
                                    )))))).ToStringWithDeclaration();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// TODO: replace this with creation of a SecurePayMessage object
        /// </summary>
        public string CreateScheduledPaymentXml(SecurePayCardInfo card, string customerId, SecurePayPayment payment, DateTime startDate)
        {
            ValidatePayment(payment);
            card.ValidateExpiry();

            return new XDocument(
                new XDeclaration("1.0", "utf-8", "no"),
                new XElement("SecurePayMessage",
                    new XElement("MessageInfo",
                        new XElement("messageID", CreateMessageId()),
                        new XElement("messageTimestamp", GetTimeStamp(DateTime.Now)),
                        new XElement("timeoutValue", _connectionTimeoutSeconds),
                        new XElement("apiVersion", "spxml-3.0")), // NOTE <-- Different to Single payments
                    new XElement("MerchantInfo",
                        new XElement("merchantID", _merchantId),
                        new XElement("password", _password)),
                    new XElement("RequestType", "Periodic"), // NOTE <--DIFF
                    new XElement("Periodic",
                        new XElement("PeriodicList", new XAttribute("count", "1"),
                            new XElement("PeriodicItem", new XAttribute("ID", "1"),
                                new XElement("actionType", "add"),
                                new XElement("clientID", customerId),
                                new XElement("CreditCardInfo",
                                    new XElement("cardNumber", card.Number),
                                    new XElement("expiryDate", card.GetExpiry())),
                                new XElement("amount", payment.Amount),
                                new XElement("currency", payment.Currency.ToUpper()),
                                new XElement("startDate", "20120901"),
                                new XElement("paymentInterval", "3"),
                                new XElement("numberOfPayments", 12),
                                new XElement("periodicType", "3") // << Triggered Payment
                            ))))).ToStringWithDeclaration();
        }