Ejemplo n.º 1
0
 /// <summary>
 /// Creates a transaction start request.
 /// </summary>
 /// <param name="ipAddress">The IP address of the customer</param>
 /// <param name="returnUrl">The URL where the customer has to be send to after the payment.</param>
 /// <param name="paymentOptionId">	The ID of the payment option (for iDEAL use 10).</param>
 /// <param name="paymentSubOptionId">	In case of an iDEAL payment this is the ID of the bank (see the paymentOptionSubList in the getService function).</param>
 /// <param name="testMode">	Whether or not we perform this call in test mode.</param>
 /// <returns>Transaction Start Request</returns>
 static public PAYNLSDK.API.Transaction.Start.Request CreateTransactionRequest(string ipAddress, string returnUrl, int?paymentOptionId, int?paymentSubOptionId, bool?testMode)
 {
     API.Transaction.Start.Request request = new API.Transaction.Start.Request();
     request.Amount             = 0;
     request.IPAddress          = ipAddress;
     request.ReturnUrl          = returnUrl;
     request.PaymentOptionId    = paymentOptionId;
     request.PaymentOptionSubId = paymentSubOptionId.ToString();
     request.TestMode           = testMode;
     return(request);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a transaction start request.
 /// </summary>
 /// <param name="ipAddress">The IP address of the customer</param>
 /// <param name="returnUrl">The URL where the customer has to be send to after the payment.</param>
 /// <param name="paymentOptionId">	The ID of the payment option (for iDEAL use 10).</param>
 /// <param name="paymentSubOptionId">	In case of an iDEAL payment this is the ID of the bank (see the paymentOptionSubList in the getService function).</param>
 /// <param name="testMode">	Whether or not we perform this call in test mode.</param>
 /// <returns>Transaction Start Request</returns>
 public static PAYNLSDK.API.Transaction.Start.Request CreateTransactionRequest(string ipAddress, string returnUrl, int? paymentOptionId, int? paymentSubOptionId, bool? testMode)
 {
     API.Transaction.Start.Request request = new API.Transaction.Start.Request();
     request.Amount = 0;
     request.IPAddress = ipAddress;
     request.ReturnUrl = returnUrl;
     request.PaymentOptionId = paymentOptionId;
     request.PaymentOptionSubId = paymentSubOptionId;
     request.TestMode = testMode;
     return request;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a transaction start request model
        /// </summary>
        /// <param name="amount">The amount.  Will be rounded at 2 digits after comma.</param>
        /// <param name="ipAddress">The IP address of the customer</param>
        /// <param name="returnUrl">The URL where the customer has to be send to after the payment.</param>
        /// <param name="paymentOptionId">	The ID of the payment option (for iDEAL use 10).</param>
        /// <param name="paymentSubOptionId">	In case of an iDEAL payment this is the ID of the bank (see the paymentOptionSubList in the getService function).</param>
        /// <param name="testMode">	Whether or not we perform this call in test mode.</param>
        /// <param name="transferType">TransferType for this transaction (merchant/transaction)</param>
        /// <param name="transferValue">TransferValue eg MerchantId (M-xxxx-xxxx) or orderId</param>
        /// <returns>Transaction Start Request</returns>
        public static PAYNLSDK.API.Transaction.Start.Request CreateTransactionRequest(decimal amount, string ipAddress, string returnUrl, int?paymentOptionId = null, int?paymentSubOptionId = null, bool testMode = false, string transferType = null, string transferValue = null)
        {
            var request = new API.Transaction.Start.Request
            {
                Amount             = (int)Math.Round(amount * 100),
                IPAddress          = ipAddress,
                ReturnUrl          = returnUrl,
                PaymentOptionId    = paymentOptionId,
                PaymentOptionSubId = paymentSubOptionId,
                TestMode           = testMode,
                TransferType       = transferType,
                TransferValue      = transferValue
            };

            return(request);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Performs a request to start a transaction.
        /// </summary>
        /// <returns>Full response object including Transaction ID</returns>
        static public async Task <API.Transaction.Start.Response> StartAsync(IClient client, API.Transaction.Start.Request request)
        {
            await client.PerformRequestAsync(request).ConfigureAwait(false);

            return(request.Response);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Performs a request to start a transaction.
        /// </summary>
        /// <returns>Full response object including Transaction ID</returns>
        static public API.Transaction.Start.Response Start(IClient client, API.Transaction.Start.Request request)
        {
            client.PerformRequest(request);

            return(request.Response);
        }