Ejemplo n.º 1
0
    // # Main method
    private static void Main()
    {
        SetPaymentOptionsSample sampleSetPaymentOptions = new SetPaymentOptionsSample();

        sampleSetPaymentOptions.SetPaymentOptionsAPIOperation();

        RefundSample sampleRefund = new RefundSample();

        sampleRefund.RefundAPIOperation();


        PreapprovalSample samplePreapproval = new PreapprovalSample();

        samplePreapproval.PreapprovalAPIOperation();

        PreapprovalDetailsSample samplePreapprovalDetails = new PreapprovalDetailsSample();

        samplePreapprovalDetails.PreapprovalDetailsAPIOperation();

        PaySample samplePay = new PaySample();

        PayRequest requestPay = samplePay.SimplePayment();

        samplePay.PayAPIOperations(requestPay);
        requestPay = samplePay.ParallelPayment();
        samplePay.PayAPIOperations(requestPay);
        requestPay = samplePay.ChainPayment();
        samplePay.PayAPIOperations(requestPay);



        PaymentDetailsSample samplePaymentDetails = new PaymentDetailsSample();

        samplePaymentDetails.PaymentDetailsAPIOperation();



        GetPaymentOptionsSample sampleGetPaymentOptions = new GetPaymentOptionsSample();

        sampleGetPaymentOptions.GetPaymentOptionsAPIOperation();


        ExecutePaymentSample sampleExecutePayment = new ExecutePaymentSample();

        sampleExecutePayment.ExecutePaymentAPIOperation();

        ConvertCurrencySample sampleConvertCurrency = new ConvertCurrencySample();

        sampleConvertCurrency.ConvertCurrencyAPIOperation();
        Console.WriteLine("Press any key to exit.");
        Console.ReadKey();
    }
    public void Pay()
    {
        PaySample sample = new PaySample();
        PayRequest requestPay = sample.SimplePayment();
        PayResponse responsePaymentDetails = sample.PayAPIOperations(requestPay);
        Assert.IsNotNull(responsePaymentDetails);
        Assert.AreEqual(responsePaymentDetails.responseEnvelope.ack.ToString().ToUpper(), "SUCCESS");

        requestPay = sample.ParallelPayment();
        responsePaymentDetails = sample.PayAPIOperations(requestPay);
        Assert.IsNotNull(responsePaymentDetails);
        Assert.AreEqual(responsePaymentDetails.responseEnvelope.ack.ToString().ToUpper(), "SUCCESS");

        requestPay = sample.ChainPayment();
        responsePaymentDetails = sample.PayAPIOperations(requestPay);
        Assert.IsNotNull(responsePaymentDetails);
        Assert.AreEqual(responsePaymentDetails.responseEnvelope.ack.ToString().ToUpper(), "SUCCESS");
    }
Ejemplo n.º 3
0
    // # Main method
    private static void Main()
    {
        SetPaymentOptionsSample sampleSetPaymentOptions = new SetPaymentOptionsSample();
        sampleSetPaymentOptions.SetPaymentOptionsAPIOperation();
        
        RefundSample sampleRefund = new RefundSample();
        sampleRefund.RefundAPIOperation();
        

        PreapprovalSample samplePreapproval = new PreapprovalSample();
        samplePreapproval.PreapprovalAPIOperation();
        
        PreapprovalDetailsSample samplePreapprovalDetails = new PreapprovalDetailsSample();
        samplePreapprovalDetails.PreapprovalDetailsAPIOperation();
       
        PaySample samplePay = new PaySample();

        PayRequest requestPay = samplePay.SimplePayment();
        samplePay.PayAPIOperations(requestPay);
        requestPay = samplePay.ParallelPayment();
        samplePay.PayAPIOperations(requestPay);
        requestPay = samplePay.ChainPayment();
        samplePay.PayAPIOperations(requestPay);
        


        PaymentDetailsSample samplePaymentDetails = new PaymentDetailsSample();
        samplePaymentDetails.PaymentDetailsAPIOperation();
        


        GetPaymentOptionsSample sampleGetPaymentOptions = new GetPaymentOptionsSample();
        sampleGetPaymentOptions.GetPaymentOptionsAPIOperation();
       

        ExecutePaymentSample sampleExecutePayment = new ExecutePaymentSample();
        sampleExecutePayment.ExecutePaymentAPIOperation();
       
        ConvertCurrencySample sampleConvertCurrency = new ConvertCurrencySample();
        sampleConvertCurrency.ConvertCurrencyAPIOperation();
        Console.WriteLine("Press any key to exit.");
        Console.ReadKey();
    }
    public void Pay()
    {
        PaySample   sample                 = new PaySample();
        PayRequest  requestPay             = sample.SimplePayment();
        PayResponse responsePaymentDetails = sample.PayAPIOperations(requestPay);

        Assert.IsNotNull(responsePaymentDetails);
        Assert.AreEqual(responsePaymentDetails.responseEnvelope.ack.ToString().ToUpper(), "SUCCESS");

        requestPay             = sample.ParallelPayment();
        responsePaymentDetails = sample.PayAPIOperations(requestPay);
        Assert.IsNotNull(responsePaymentDetails);
        Assert.AreEqual(responsePaymentDetails.responseEnvelope.ack.ToString().ToUpper(), "SUCCESS");

        requestPay             = sample.ChainPayment();
        responsePaymentDetails = sample.PayAPIOperations(requestPay);
        Assert.IsNotNull(responsePaymentDetails);
        Assert.AreEqual(responsePaymentDetails.responseEnvelope.ack.ToString().ToUpper(), "SUCCESS");
    }