コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();

            //TRANSACTION
            transactionID = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("transactionID"))).Text;

            //PAYMENT
            payment.amount             = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("paymentAmount"))).Text;
            payment.mode               = ((DropDownList)(Page.PreviousPage.FindControl("doRefund").FindControl("paymentMode"))).Text;
            payment.action             = ((DropDownList)(Page.PreviousPage.FindControl("doRefund").FindControl("paymentFonction"))).Text;
            payment.currency           = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("paymentCurrency"))).Text;
            payment.contractNumber     = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("paymentContractNumber"))).Text;
            payment.differedActionDate = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("paymentDifferedActionDate"))).Text; // Format : "dd/mm/yy"

            //SEQUENCE NUMBER
            sequenceNumber = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("sequenceNumber"))).Text;

            //COMMENT
            comment = ((HtmlTextArea)(Page.PreviousPage.FindControl("doRefund").FindControl("comment"))).Value;

            // PRIVATE DATA (optional)
            privateData1.key   = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("privateDataKey1"))).Text;
            privateData1.value = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("privateDataValue1"))).Text;
            privateData2.key   = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("privateDataKey2"))).Text;
            privateData2.value = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("privateDataValue2"))).Text;
            privateData3.key   = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("privateDataKey3"))).Text;
            privateData3.value = ((TextBox)(Page.PreviousPage.FindControl("doRefund").FindControl("privateDataValue3"))).Text;

            privateDataList.SetValue(privateData1, 0);
            privateDataList.SetValue(privateData2, 1);
            privateDataList.SetValue(privateData3, 2);

            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new System.Net.NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.doRefund(transactionID, payment, comment, privateDataList, sequenceNumber, out transaction);
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();

            contractNumber  = ((TextBox)(Page.PreviousPage.FindControl("disablePaymentRecord").FindControl("contractNumber"))).Text;
            paymentRecordId = ((TextBox)(Page.PreviousPage.FindControl("disablePaymentRecord").FindControl("paymentRecordId"))).Text;

            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new System.Net.NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.disablePaymentRecord(contractNumber, paymentRecordId);
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();

            // PAYMENT
            payment.amount             = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("paymentAmount"))).Text;
            payment.mode               = ((DropDownList)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("paymentMode"))).Text;
            payment.action             = ((DropDownList)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("paymentFonction"))).Text;
            payment.currency           = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("paymentCurrency"))).Text;
            payment.contractNumber     = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("paymentContractNumber"))).Text;
            payment.differedActionDate = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("paymentDifferedActionDate"))).Text; // Format : "dd/mm/yy"

            // ORDER
            order.@ref = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("orderRef"))).Text;

            // CARD INFO
            card.number            = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("cardNumber"))).Text;
            card.type              = ((DropDownList)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("cardType"))).Text;
            card.expirationDate    = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("cardExpirationDate"))).Text;
            card.cvx               = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("cardCrypto"))).Text;
            card.ownerBirthdayDate = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("cardOwnerBirthdayDate"))).Text;
            card.password          = ((TextBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("cardPassword"))).Text;

            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new System.Net.NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.verifyEnrollment(card, payment, order.@ref, out actionUrl, out actionMethod, out pareqFieldName, out pareqFieldValue,
                                           out termUrlName, out termUrlValue, out mdFieldName, out mdFieldValue);

            debug = ((CheckBox)(Page.PreviousPage.FindControl("verifyEnrollment").FindControl("debug"))).Checked;
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();
            contractNumber = ((TextBox)(Page.PreviousPage.FindControl("disableWallet").FindControl("contractNumber"))).Text;
            walletId       = ((TextBox)(Page.PreviousPage.FindControl("disableWallet").FindControl("walletIdList"))).Text;

            if (walletId.Contains(";"))
            {
                string[] split = walletId.Split(new Char[] { ';' });
                walletIdList = split;
            }
            else
            {
                walletIdList.SetValue(walletId, 0);
            }

            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new System.Net.NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.disableWallet(contractNumber, ref walletIdList);
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();

            // CONTRACT NUMBER

            contractNumber = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("contractNumber"))).Text;

            // ADDRESS (optional)
            address.name     = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressName"))).Text;
            address.street1  = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressStreet1"))).Text;
            address.street2  = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressStreet2"))).Text;
            address.cityName = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressCity"))).Text;
            address.zipCode  = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressZipCode"))).Text;
            address.country  = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressCountry"))).Text;
            address.phone    = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("addressPhone"))).Text;

            // CARD INFO
            card.number            = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("cardNumber"))).Text;
            card.type              = ((DropDownList)(Page.PreviousPage.FindControl("createWallet").FindControl("cardType"))).Text;
            card.expirationDate    = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("cardExpirationDate"))).Text;
            card.cvx               = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("cardCrypto"))).Text;
            card.ownerBirthdayDate = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("cardOwnerBirthdayDate"))).Text;
            card.password          = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("cardPassword"))).Text;

            // PRIVATE DATA (optional)
            privateData1.key   = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("privateDataKey1"))).Text;
            privateData1.value = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("privateDataValue1"))).Text;
            privateData2.key   = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("privateDataKey2"))).Text;
            privateData2.value = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("privateDataValue2"))).Text;
            privateData3.key   = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("privateDataKey3"))).Text;
            privateData3.value = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("privateDataValue3"))).Text;

            privateDataList.SetValue(privateData1, 0);
            privateDataList.SetValue(privateData2, 1);
            privateDataList.SetValue(privateData3, 2);

            // WALLET INFO
            wallet.walletId        = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("walletId"))).Text;
            wallet.lastName        = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("lastName"))).Text;
            wallet.firstName       = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("firstName"))).Text;
            wallet.email           = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("email"))).Text;
            wallet.card            = card;
            wallet.shippingAddress = address;
            wallet.comment         = ((HtmlTextArea)(Page.PreviousPage.FindControl("createWallet").FindControl("comment"))).Value;

            // AUTHENTICATION 3D SECURE (optional)
            authentication3DSecure.md    = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("md"))).Text;
            authentication3DSecure.pares = ((TextBox)(Page.PreviousPage.FindControl("createWallet").FindControl("pares"))).Text;


            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new System.Net.NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.createWallet(contractNumber, wallet, privateDataList, authentication3DSecure);
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();

            // PAYMENT
            payment.amount             = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("paymentAmount"))).Text;
            payment.mode               = ((DropDownList)(Page.PreviousPage.FindControl("doAuthorization").FindControl("paymentMode"))).Text;
            payment.action             = ((DropDownList)(Page.PreviousPage.FindControl("doAuthorization").FindControl("paymentFonction"))).Text;
            payment.currency           = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("paymentCurrency"))).Text;
            payment.contractNumber     = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("paymentContractNumber"))).Text;
            payment.differedActionDate = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("paymentDifferedActionDate"))).Text; // Format : "dd/mm/yy"

            // ORDER
            order.@ref    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderRef"))).Text;
            order.origin  = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderOrigin"))).Text;
            order.country = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderCountry"))).Text;
            order.taxes   = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderTaxes"))).Text;

            order.currency = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderCurrency"))).Text;
            if (order.currency == "")
            {
                order.currency = Resources.Resource.ORDER_CURRENCY;
            }

            order.amount = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderAmount"))).Text;
            order.date   = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDate"))).Text; // format : "dd/mm/yyyy HH24:MM"

            // ORDER DETAILS
            orderDetail1.@ref     = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailRef1"))).Text;
            orderDetail1.price    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailPrice1"))).Text;
            orderDetail1.quantity = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailQuantity1"))).Text;
            orderDetail1.comment  = ((HtmlTextArea)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailComment1"))).Value;

            orderDetail2.@ref     = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailRef2"))).Text;
            orderDetail2.price    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailPrice2"))).Text;
            orderDetail2.quantity = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailQuantity2"))).Text;
            orderDetail2.comment  = ((HtmlTextArea)(Page.PreviousPage.FindControl("doAuthorization").FindControl("orderDetailComment2"))).Value;

            order.details = new orderDetail[2];
            order.details.SetValue(orderDetail1, 0);
            order.details.SetValue(orderDetail2, 1);

            // ADDRESS (optional)
            address.name     = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressName"))).Text;
            address.street1  = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressStreet1"))).Text;
            address.street2  = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressStreet2"))).Text;
            address.cityName = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressCity"))).Text;
            address.zipCode  = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressZipCode"))).Text;
            address.country  = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressCountry"))).Text;
            address.phone    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("addressPhone"))).Text;

            // BUYER (optional)
            buyer.shippingAdress       = address;
            buyer.walletId             = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerWalletId"))).Text;
            buyer.lastName             = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerLastName"))).Text;
            buyer.firstName            = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerFirstName"))).Text;
            buyer.email                = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerEmail"))).Text;
            buyer.accountCreateDate    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerAccountCreateDate"))).Text; // format : "dd/mm/yy"
            buyer.accountAverageAmount = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerAverageAmount"))).Text;
            buyer.accountOrderCount    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("buyerOrderCount"))).Text;

            // PRIVATE DATA (optional)
            privateData1.key   = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("privateDataKey1"))).Text;
            privateData1.value = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("privateDataValue1"))).Text;
            privateData2.key   = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("privateDataKey2"))).Text;
            privateData2.value = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("privateDataValue2"))).Text;
            privateData3.key   = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("privateDataKey3"))).Text;
            privateData3.value = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("privateDataValue3"))).Text;

            privateDataList.SetValue(privateData1, 0);
            privateDataList.SetValue(privateData2, 1);
            privateDataList.SetValue(privateData3, 2);

            // CARD INFO
            card.number            = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardNumber"))).Text;
            card.type              = ((DropDownList)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardType"))).Text;
            card.expirationDate    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardExpirationDate"))).Text;
            card.cvx               = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardCrypto"))).Text;
            card.ownerBirthdayDate = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardOwnerBirthdayDate"))).Text;
            card.password          = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardPassword"))).Text;

            //CARD PRESENT
            if (((DropDownList)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardPresent"))).Text != "")
            {
                card.cardPresent = ((DropDownList)(Page.PreviousPage.FindControl("doAuthorization").FindControl("cardPresent"))).Text;
            }

            // AUTHENTICATION 3D SECURE (optional)
            authentication3DSecure.md    = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("md"))).Text;
            authentication3DSecure.pares = ((TextBox)(Page.PreviousPage.FindControl("doAuthorization").FindControl("pares"))).Text;

            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            //ws.Proxy = System.Net.WebRequest.DefaultWebProxy;

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.doAuthorization(payment, card, order, buyer, privateDataList, authentication3DSecure, out transaction, out authorization);
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DirectPaymentAPI ws = new DirectPaymentAPI();

            // WALLET ID
            walletId = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("walletId"))).Text;

            payment.amount             = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("paymentAmount"))).Text;
            payment.mode               = ((DropDownList)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("paymentMode"))).Text;
            payment.action             = ((DropDownList)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("paymentFonction"))).Text;
            payment.currency           = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("paymentCurrency"))).Text;
            payment.contractNumber     = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("paymentContractNumber"))).Text;
            payment.differedActionDate = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("paymentDifferedActionDate"))).Text; // Format : "dd/mm/yy"

            // ORDER
            order.@ref    = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderRef"))).Text;
            order.origin  = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderOrigin"))).Text;
            order.country = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderCountry"))).Text;
            order.taxes   = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderTaxes"))).Text;

            order.currency = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderCurrency"))).Text;
            if (order.currency == "")
            {
                order.currency = Resources.Resource.ORDER_CURRENCY;
            }

            order.amount = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderAmount"))).Text;
            order.date   = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDate"))).Text; // format : "dd/mm/yyyy HH24:MM"

            // ORDER DETAILS
            orderDetail1.@ref     = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailRef1"))).Text;
            orderDetail1.price    = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailPrice1"))).Text;
            orderDetail1.quantity = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailQuantity1"))).Text;
            orderDetail1.comment  = ((HtmlTextArea)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailComment1"))).Value;

            orderDetail2.@ref     = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailRef2"))).Text;
            orderDetail2.price    = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailPrice2"))).Text;
            orderDetail2.quantity = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailQuantity2"))).Text;
            orderDetail2.comment  = ((HtmlTextArea)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("orderDetailComment2"))).Value;

            order.details = new orderDetail[2];
            order.details.SetValue(orderDetail1, 0);
            order.details.SetValue(orderDetail2, 1);

            // PRIVATE DATA (optional)
            privateData1.key   = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("privateDataKey1"))).Text;
            privateData1.value = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("privateDataValue1"))).Text;
            privateData2.key   = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("privateDataKey2"))).Text;
            privateData2.value = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("privateDataValue2"))).Text;
            privateData3.key   = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("privateDataKey3"))).Text;
            privateData3.value = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("privateDataValue3"))).Text;

            privateDataList.SetValue(privateData1, 0);
            privateDataList.SetValue(privateData2, 1);
            privateDataList.SetValue(privateData3, 2);


            // SCHEDULED DATE
            scheduledDate = ((TextBox)(Page.PreviousPage.FindControl("doScheduledWalletPayment").FindControl("scheduledDate"))).Text;

            //PROXY
            if (Resources.Resource.PROXY_HOST != "" && Resources.Resource.PROXY_PORT != "")
            {
                ws.Proxy = new System.Net.WebProxy(Resources.Resource.PROXY_HOST, Convert.ToInt32(Resources.Resource.PROXY_PORT));
                if (Resources.Resource.PROXY_USER != "" && Resources.Resource.PROXY_PASSWORD != "")
                {
                    ws.Proxy.Credentials = new System.Net.NetworkCredential(Resources.Resource.PROXY_USER, Resources.Resource.PROXY_PASSWORD);
                }
            }

            if (Resources.Resource.PROD == "true")
            {
                ws.Url = Resources.Resource.ENDPOINT_DIRECT;
            }

            ws.Credentials = new System.Net.NetworkCredential(Resources.Resource.MERCHANT_ID, Resources.Resource.ACCESS_KEY);

            resultat = ws.doScheduledWalletPayment(payment, order.@ref, order.date, scheduledDate, walletId, order, privateDataList, out paymentRecordId);
        }
        catch (Exception exc)
        {
            errorMessage = exc.Message;
            errorDetails = exc.ToString();
        }
    }