All Downloads are FREE. Search and download functionalities are using the official Maven repository.

NpsSDK.Test Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package NpsSDK;

import javax.net.ssl.SSLContext;

public class Test {
    public static void main(String[] args) {
        RootElement data = null;
        RootElement response = null;

        ILogger consoleLogger = new ConsoleLogger();

        WsdlHandlerConfiguration wsdlHandlerConfiguration = new WsdlHandlerConfiguration(
                ILogger.LogLevel.INFO,
                WsdlHandlerConfiguration.NpsEnvironment.staging,
                "orhhsnELMdsTZiL2vfS5CDLGuUxR04X8V7NDFzHexP5mz2K1nsPj49AzGhHKeJuN",
                consoleLogger);

        try {
            NpsSDK.NpsSdk npsSdk = new NpsSDK.NpsSdk(wsdlHandlerConfiguration);
/*
            data = new NpsSDK.RootElement();
            data.add("psp_Version", "2.2" );
            data.add("psp_MerchantId", "psp_test" );
            data.add("psp_TxSource", "WEB" );
            data.add("psp_MerchTxRef", "ORDER69461-234" );
            data.add("psp_MerchOrderId", "ORDER69461" );
            data.add("psp_Amount", "15050" );
            data.add("psp_NumPayments", "1" );
            data.add("psp_Currency", "032" );
            data.add("psp_Country", "ARG" );
            data.add("psp_Product", "14" );
            data.add("psp_CardNumber", "4507990000000010" );
            data.add("psp_CardExpDate", "1612" );
            data.add("psp_PosDateTime", "2016-12-01 12:00:00");
            data.add("psp_CardSecurityCode", "325" );

            response = npsSdk.payOnLine_2p(data);
*/

            data = new NpsSDK.RootElement();
            data.add("psp_Version", "2.2" );
            data.add("psp_TransactionId", "3515929");
            data.add("psp_MerchantId", "plusgrade" );
            data.add("psp_PosDateTime", "2016-12-01 12:00:00");
//
//            data.add("psp_CardNumber", "4507990000000010");
//            data.add("psp_NumPayments", "1" );
//            data.add("psp_Currency", "032" );
//            data.add("psp_Country", "ARG" );
//            data.add("psp_TxtSource", "asd");
//            data.add("psp_Amount", "10000");
//            data.add("psp_Product", "14" );
            data.add("psp_SecureHash", "12345678901234567890123456789012");

            response = npsSdk.createPaymentMethodFromPayment(data);

        }
        catch (NpsSDK.WsdlHandlerException ex) {
            System.out.println(ex.getMessage());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy