Giter Site home page Giter Site logo

dotnet-sdk's People

Contributors

securesubmit-buildmaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnet-sdk's Issues

GetAuthenticationData - Error occurred while communicating with gateway.

I have been testing the Challenge Flow route through 3D Secure V2 using the JS library and .Net SDK.

Yesterday when I debugged through the following code, it worked perfectly fine:

            try
            {
                threeDSecureData = Secure3dService.GetAuthenticationData()
                    .WithServerTransactionId(requestJson.ServerTransId)
                    .Execute();
            }
            catch (ApiException exce)
            {
                // TODO: add your error handling here
            }

However, today I've ran through the same process with the same payment details etc, and I'm now experiencing the following error:
Error occurred while communicating with gateway.

With the following inner exception:
{"Cannot send a content-body with this verb-type."}

Has something changed on the test gateway, or has something I changed on my side caused this?

Payment details I've submitted:
image

GatewayConfig throws unexpected exception

GatewayConfig throws exception when user set SiteId, LicenseId, DeviceId for Heartland without SecretApiKey.
ServicesContainer.ConfigureService(new GatewayConfig { SiteId = 1xxxx9, LicenseId = 12xxxx, DeviceId = 6xxxxxx, Username = "7777xxxxxxxxx", Password = "$pass", DeveloperId = "00xxxx", VersionNumber = "3082", ServiceUrl = "https://cert.api2.heartlandportico.com", });
Exception occurs in getPayPlanEndpoint method, because SecretApiKey is null.

Public member 'Reset' on type 'XmlNodeList' not found

Hello All,

we are using RealEx payment gateway from more than 4 years.

we have a vb.net based web service , there we are using class called "clsPayandshop" with license notes
"Pay and Shop Limited (payandshop.com) - Licence Agreement.
'© Copyright and zero Warranty Notice.............."
so, this we received from RealEx team

this class was working fine; recently we have created new web server and moved our vb.net based web services to the new server(Windows 2012).

below is exception code, in clsPayandshop file it is referred Interop.MSXML2 dll(Microsoft XML, v6.0) when i publish the project in server then and start passing input, while the control reach at objNodeList.Reset() this line then im getting exception as "Public member 'Reset' on type 'XmlNodeList' not found" . Using Log only i found the line of exception

it was working perfectly in old server(Windows 2003), in new server i have installed asp.net 4.0, iis, also msxml6.msi from link then also its not working so, installed MS office 2007 also but no luck.

experts please advise,

Public Sub ParseResponse()

        Dim objNodeList
        Dim i
        Dim tmp1, tmp2, tmp3
        Dim sha1hash
        Dim XMLRoot
        Dim XMLItem
        Log.WriteLog("1: ",
                         MethodInfo.GetCurrentMethod().ToString() & "-" & Me.GetType().BaseType.FullName)
        objNodeList = XMLDoc.getElementsByTagName("response")
        Log.WriteLog("objNodeList: " & objNodeList.ToString(),
                         MethodInfo.GetCurrentMethod().ToString() & "-" & Me.GetType().BaseType.FullName)

        responseFields.Add("timestamp", objNodeList.Item(0).getAttribute("timestamp"))

        'Log.WriteLog("XMLDoc.getElementsByTagName('response'): " & XobjNodeList.Item(0).getAttribute("timestamp"),
        '                 MethodInfo.GetCurrentMethod().ToString() & "-" & Me.GetType().BaseType.FullName)

        Log.WriteLog("before first reset: ",
                         MethodInfo.GetCurrentMethod().ToString() & "-" & Me.GetType().BaseType.FullName)
        **objNodeList.Reset()**

         Log.WriteLog("after first reset: ",
                         MethodInfo.GetCurrentMethod().ToString() & "-" & Me.GetType().BaseType.FullName)

}

InitiateAuthentication returning 502 Bad Gateway for MasterCard requests

As part of the InitiateAuthentication step, the SDK posts the following to https://api.globalpay-ecommerce.com/3ds2/authentications

{
    "request_timestamp": "2021-06-08T10:10:10.296390",
    "authentication_source": "BROWSER",
    "authentication_request_type": "PAYMENT_TRANSACTION",
    "message_category": "PAYMENT_AUTHENTICATION",
    "message_version": "2.2.0",
    "server_trans_id": "10a06654-4a02-40bd-801b-b85f25749b1d",
    "merchant_id": "***",
    "account_id": "internet",
    "challenge_request_indicator": "NO_PREFERENCE",
    "challenge_notification_url": "https://www.example.com/3ds2Challenge.ashx",
    "method_url_completion": "YES",
    "merchant_contact_url": "https://www.example.com/support",
    "card_detail": {
        "number": "5434298060861502",
        "scheme": "MC",
        "expiry_month": "01",
        "expiry_year": "24",
        "full_name": "TEST TESTER"
    },
    "order": {
        "amount": "9900",
        "currency": "GBP",
        "id": "4f398f54-ac7b-404a-811a-e11d35a5f4e7",
        "address_match_indicator": "false",
        "date_time_created": "2021-06-08T10:10Z"
    },
    "payer": {
        "email": "[email protected]",
        "billing_address": {
            "line1": "1 Ann Street",
            "line2": "",
            "city": "Belfast",
            "postal_code": "BT1 1AA",
            "country": "826"
        },
        "mobile_phone": {
            "country_code": "44",
            "subscriber_number": "7712322343"
        }
    },
    "browser_data": {
        "accept_header": "*/*",
        "color_depth": "TWENTY_FOUR_BITS",
        "ip": "XX.XX.XX.XX",
        "java_enabled": false,
        "javascript_enabled": false,
        "language": "en-gb",
        "screen_height": 1440,
        "screen_width": 2560,
        "challenge_window_size": "FULL_SCREEN",
        "timezone": "-1",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15"
    }
}

And gets the following back:

502 Bad Gateway
{
    "error_description": "The Authentication Response is invalid, indicates an error occurred or no response was returned.",
    "error_detail": "The request should be considered as not authenticated."
}

This is happening for ALL MasterCard attempts according to my logs.

It works fine when changing the line "scheme": "MC" to "scheme": "VISA". Although the card number is not a Visa, it at least gets an intelligible response:

{
    "server_trans_id": "10a06654-4a02-40bd-801b-b85f25749b1d",
    "acs_trans_id": "1f8f5814-d31e-4d0c-b46a-a05328ce396c",
    "ds_trans_id": "1f8f5814-d31e-4d0c-b46a-a05328ce396c",
    "acs_rendering_type": {},
    "status": "AUTHENTICATION_FAILED",
    "status_reason": "NO_CARD_RECORD",
    "authentication_source": "BROWSER",
    "message_category": "PAYMENT_AUTHENTICATION",
    "message_version": "2.2.0",
    "acs_reference_number": "VISA.V 17 0003",
    "whitelist_status": "WHITELIST_STATUS_UNKNOWN"
}

Is there something about the request/SDK that needs changed for MasterCard attempts? I've tried many tweaks but always receive the same 502 response.

Failure on charging recurring payment with stored credit card.

The function that is failing in the API is "MapResponse()". The transaction has been approved and a successful response has been issued. But the XML response document does not contain a paymentmethoddetails section. But following code snippet from the MapResponse() fails is there is not a "paymentmethoddetails" section in the XML response. root.Get() does not return null for paymentMethodDetails, therefore we get an exception because paymentMethodDetails.Element is null

      var paymentMethodDetails = root.Get("paymentmethoddetails");
        if (paymentMethodDetails != null) {

            AlternativePaymentResponse alternativePaymentResponse = new AlternativePaymentResponse
            {
                BankAccount = paymentMethodDetails?.GetValue<string>("bankaccount"),
                AccountHolderName = paymentMethodDetails?.GetValue<string>("accountholdername"),
                Country = paymentMethodDetails?.GetValue<string>("country"),
                RedirectUrl = paymentMethodDetails?.GetValue<string>("redirecturl"),
                PaymentPurpose = paymentMethodDetails?.GetValue<string>("paymentpurpose"),
                PaymentMethod = paymentMethodDetails?.GetValue<string>("paymentmethod"),
            };

Grabbing transaction list example

Good morning,

I can see there are some fucntions/interfaces for the transaction list but cant for the life of me figure out how to grab a list of transactions using the SDK,

Are there any examples that show how todo this?

Thanks!

new GateawayConfig errors for testing environment

After updating the NuGet packages all our methods that we were using for testing purposes now error out with "Cannot create an instance of the abstract class or interface 'GatewayConfig'.

This bit of code is copy-pasted from the API reference:
ServicesContainer.ConfigureService(new GatewayConfig { MerchantId = "MerchantId", AccountId = "internet", SharedSecret = "secret", ServiceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi" });

It was working fine previously and the API reference hasn't been updated to reflect any changes so I'm guessing this is not intended.

Duplicate form submissions using "iframesSubmit"

How can I prevent double form submissions if the user is double clicking the Submit button? I'm using the

in the MVC example. I've tried disabling the button after the user clicks but I've not had any luck.

Error Xamarin IOS Reference CoreCompat.System.Drawing

Good afternoon,

We have a development with xamarin forms, and we have included GlobalPayments.Api to process payments with Heartland.

Everything works correctly, however when we are generating the Final Compiles to upload to the Google and Apple stores, we are receiving an error because GlobalPayments.Api includes a reference to "CoreCompat.System.Drawing" and this is not allowed for compilation of IOS. There is some compilation of the API that does not include references to CoreCompat.System.Drawing, which is also rare because there is no UI.

Thank you very much, in advance for the help you can give us.

The name of the country is longer that 50 characters

the country name "United Kingdom of Great Britain and Northern Ireland" is longer that 50 chars.
The API declines the payment request when the CountryCode is specified as "GB" with the error
" [country] United Kingdom of Great Britain and Northern Ireland [/country] ' does not conform to the schema"

_countryCodeAlpha2MapByCountry.Add("United Kingdom of Great Britain and Northern Ireland", "GB");

Find customer

How do check if the customer exists ?

this is giving me a error: GlobalPayments.Api.Entities.UnsupportedTransactionException: 'Transaction type not supported for this payment method.'

GlobalPayments.Api.Entities.Customer customer = GlobalPayments.Api.Entities.Customer.Find(customer.Id.ToString());

also please update this document:
https://developer.globalpay.com/api/card-storage#api-card-new
You need to add customer.Create();

Issue in NAK flow

As per the api document, if LRC is incorrect the register will have to send a NAK to the terminal
The terminal in turn will resend the response,if this time the LRC is validated, the register has to send an ACK and wait for EOT.
This flow is missing in the PAXTCPINterface call,
further if i modify the code and send NAK, get a response and then send an ACK, i dont get EOT from the terminal, Either the message LISTEN TIMEOUT or INCORRECT MESSAGE FORMAT is displayed on the terminal..

Reccuring work

Good day, I have some question.
Have I truly implementation for configuration for my recurring payment:

  ServicesContainer.ConfigureService(new GatewayConfig
            { 
                SecretApiKey = "<- secret key ->",
                DeveloperId = "000000",
                VersionNumber = "0000"
            }, "MyGlobalPaymentsDemo");

and insert it into

var customer = new Customer
               {
                   Id = Guid.NewGuid().ToString(),
                   Status = "Active",
                   FirstName = "Bill",
                   LastName = "Johnson",
                   Company = "Heartland Payment Systems",
                   Address = new Address
                   {
                       StreetAddress1 = "987 Elm St",
                       City = "Princeton",
                       Province = "NJ",
                       PostalCode = "12345",
                       Country = "USA"
                   },
                   HomePhone = "9876543210",
                   WorkPhone = "9876543210",
                   Fax = "9876543210",
                   MobilePhone = "9876543210",
                   Email = "[email protected]"
               }.Create("MyGlobalPaymentsDemo");

but for an answer, I get an exception with the next message:

"  "The specified configuration has not been configured for recurring processing." | string

"

Version library: 1.6.9.
Version Dotnet core sdk: 2.2.

Schedule only using "default" config

Reviewing the Create method of RecurringEntity:

public TResult Create(string configName = "default") {
            return RecurringService.Create(this as TResult);
        }

It seams to ignore the configName, and this is also not an option on the RecurringService.Create:

public static T Create<T>(T entity) where T : class, IRecurringEntity
    {
      return new RecurringBuilder<T>(TransactionType.Create, (IRecurringEntity) entity).Execute("default");
    }

Suggests you can only use this feature on the default config, could support be added to allow schedule creation on a multiple config setup?

Could not load file or assembly 'CoreCompat.System.Drawing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0a7ed9c2333b592'. The system cannot find the file specified.

I am working on a project with Umbraco CMS, and my application will not start when i add GlobalPayments.Api to the project.
I am getting this error:

Could not load file or assembly 'CoreCompat.System.Drawing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0a7ed9c2333b592'. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Umbraco.Cms.Core.Composing.ReferenceResolver.d__8.MoveNext()
at Umbraco.Cms.Core.Composing.ReferenceResolver.Resolve(Assembly assembly)
at Umbraco.Cms.Core.Composing.ReferenceResolver.ResolveAssemblies()
at Umbraco.Cms.Core.Composing.FindAssembliesWithReferencesTo.Find()
at Umbraco.Cms.Core.Composing.DefaultUmbracoAssemblyProvider.get_Assemblies()
at Umbraco.Cms.Core.Composing.TypeFinder.GetAllAssemblies()
at Umbraco.Cms.Core.Composing.TypeFinder.GetFilteredAssemblies(IEnumerable1 excludeFromResults, String[] exclusionFilter) at Umbraco.Cms.Core.Composing.TypeFinder.get_AssembliesToScan() at Umbraco.Cms.Core.Composing.TypeLoader.get_AssembliesToScan() at Umbraco.Cms.Core.Composing.TypeLoader.<>c__DisplayClass21_01.b__0()
at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternalLocked(Type baseType, Type attributeType, Func1 finder, String action, Boolean cache) at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternal(Type baseType, Type attributeType, Func1 finder, String action, Boolean cache)
at Umbraco.Cms.Core.Composing.TypeLoader.GetTypes[T](Boolean cache, IEnumerable`1 specificAssemblies)
at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilderExtensions.AddAllCoreCollectionBuilders(IUmbracoBuilder builder)
at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder.AddCoreServices()
at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder..ctor(IServiceCollection services, IConfiguration config, TypeLoader typeLoader, ILoggerFactory loggerFactory, IProfiler profiler, AppCaches appCaches, IHostingEnvironment hostingEnvironment)
at Umbraco.Extensions.UmbracoBuilderExtensions.AddUmbraco(IServiceCollection services, IWebHostEnvironment webHostEnvironment, IConfiguration config)
at CamiraFabrics.Umbraco.Startup.ConfigureServices(IServiceCollection services) in C:\Users\AdrianGhibaor\source\repos\camira-fabrics-umbraco\CamiraFabricsUmbraco\CamiraFabrics.Umbraco\Startup.cs:line 21
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass14_0.b__0(HostBuilderContext context, IServiceCollection services)
at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build()
at CamiraFabrics.Umbraco.Program.Main(String[] args) in C:\Users\AdrianGhibaor\source\repos\camira-fabrics-umbraco\CamiraFabricsUmbraco\CamiraFabrics.Umbraco\Program.cs:line 6

xamarin form

Is it possible to use this sdk in xamarin form for Realex payment. GlobalPaymets.api package is present in xamarin.
if possible, can you please help me how to implement.

Postcode Validation

Stumbled across an issue yesterday,

System.Exception: Provided ZipCode is not a valid.
at GlobalPayments.Api.Utils.StringUtils.ToValidateAndFormatZipCode(String value, String regexForZipCode)
at GlobalPayments.Api.Gateways.Gp3DSProvider.ProcessSecure3d(Secure3dBuilder builder)
at GlobalPayments.Api.Builders.Secure3dBuilder.Execute

public static string ToValidateAndFormatZipCode(string value, string regexForZipCode = @"^\d{5}$") {

The regex appears to be fixed at checking the beginning of the string to be 5 digits. If life as a developer were so easy... How about a UK Postcode such as E16 3KH or similar? Or in my case for someone in Hong Kong, where they don't have Postcodes? This doesn't make sense. (Also it's called PostCode or Postalcode in most other places, weird to change the naming conventions in Utils.)

public static string ToValidateAndFormatZipCode(string value, string regexForZipCode = @"^\d{5}$") {

I can't just avoid the validation which occurs automatically when the billing address is added, so we're now sending 00000 for everyone.

Error on handling decimal values in different cultures.

When using PorticoConfig, SDK doesn't handle correctly decimals with different culture than 'us-EN'-like.

Request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <PosRequest xmlns="http://Hps.Exchange.PosGateway"> <Ver1.0> <Header> <SecretAPIKey>XXX</SecretAPIKey> <PosReqDT>2023-06-13T10:00:53.742Z</PosReqDT> <SDKNameVersion>net;version=5.1.8.0</SDKNameVersion> </Header> <Transaction> <CreditIncrementalAuth> <Block1> <Amt>2,50</Amt> <GatewayTxnId>XXX</GatewayTxnId> </Block1> </CreditIncrementalAuth> </Transaction> </Ver1.0> </PosRequest> </soap:Body> </soap:Envelope>

Response:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <soap:Code> <soap:Value>soap:Sender</soap:Value> </soap:Code> <soap:Reason> <soap:Text xml:lang="en">Unable to process request. Message failed validation. The 'http://Hps.Exchange.PosGateway:Amt' element is invalid - The value '2,50' is invalid according to its datatype 'http://Hps.Exchange.PosGateway:amtTypeGlobal' - The string '2,50' is not a valid Decimal value. (line#1,pos#392)</soap:Text> </soap:Reason> <soap:Node>http://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway/PosGatewayService.asmx</soap:Node> <soap:Detail /> </soap:Fault> </soap:Body> </soap:Envelope>

Problem is with calling .ToString() on object without specifying invariant culture. I can see in code that you also have .ToCurrencyString() method that should resolve that issue.

Decimal value converts wrong to string and vice versa.

A decimal value converts wrong to string or vice versa when user Current Culture is not EN. Heartland understand only dot delimiter in decimal values, thus all converts should be performed with CultureInfo.InvariantCulture.

NAK Send issue

As per the api document, if LRC is incorrect the register will have to send a NAK to the terminal
The terminal in turn will resend the response,if this time the LRC is validated, the register has to send an ACK and wait for EOT.
This flow is missing in the PAXTCPINterface call,
further if i modify the code and send NAK, get a response and then send an ACK, i dont get EOT from the terminal, Either the message LISTEN TIMEOUT or INCORRECT MESSAGE FORMAT is displayed on the terminal..

GatewayException constructor is marked as internal

I am attempting to unit test some code when handling a GatewayException. I wish to mock the AuthorisationBuilder class and Setup Execute to throw a GatewayException. It is not possible as the ResponseCode and ResponseMessage setters are marked as private and the constructor to the class is marked as internal.

The code below will not compile as the constructor is internal.

var mockedAuthBuilder = new Mock<AuthorizationBuilder>();
mockedAuthBuilder.Setup(x => x.Execute(It.IsAny<string>())).Throws(new GatewayException("message", "code", "responseMessage"));

Why would the constructor be marked as internal? Is there something I'm missing here?

Add ISO3166 three digit codes to Country List

Please could you add the ISO3166 three digit codes to the list of countries that you have in the Country Utils class. As you require the three digit code to be used when creating an address this then means I have to look up the ISO3166 and requires another dependency

Thanks.

InitiateAuthentication throws exception related to ChallengeNotificationURL

Hi I'm testing some 3DS2 code on .Net Framework 4.72. using example code from your website. When I get to the InitiateAuthentication step it throws an exception related to the format of the ChallengeNotificationUrl. I have specified this url in the GatewayConfig object as https://localhost:44300/sites/website1/r3ds2_notifychallenge.ashx.

the exception I get (provided below) says that this is in an invalid format, but the URL I specified conforms to the spec (fully qualified, valid and less than 256 chars). Is there somewhere else I need to specify this URL value?

Any help you can provide would be appreciated. Thanks.

HTTP Post Payload posted to InitiateAuthentication Asp.Net handler (.ashx) code:

{
    "serverTransactionId": "6a33203a-18ed-4dd4-9a65-dd970a63c7f8",
    "methodUrlComplete": true,
    "card": {
        "number": "4012001038488884",
        "expiryMonth": "10",
        "expiryYear": "2025",
        "securityCode": "123",
        "cardHolderName": "John Smith"
    },
    "challengeWindow": {
        "windowSize": "FULL_SCREEN",
        "displayMode": "lightbox"
    },
    "authenticationSource": "BROWSER",
    "authenticationRequestType": "PAYMENT_TRANSACTION",
    "messageCategory": "PAYMENT_AUTHENTICATION",
    "challengeRequestIndicator": "NO_PREFERENCE",
    "browserData": {
        "colorDepth": "TWENTY_FOUR_BITS",
        "javaEnabled": false,
        "javascriptEnabled": true,
        "language": "en-US",
        "screenHeight": 1080,
        "screenWidth": 1920,
        "time": "2020-10-02T11:02:33.371Z",
        "timezoneOffset": -1,
        "userAgent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0"
    }
}

InitialiseAuthentication Handler (.ashx) code:

public void ProcessRequest(HttpContext context)
{
	context.Response.ContentType = "application/json";

	GatewayConfig config = new GpEcomConfig
	{
		MerchantId = "myMerchantId",
		AccountId = "ecom3ds",
		SharedSecret = "secret",
		MethodNotificationUrl = "https://localhost:44300/sites/website1/r3ds2_notifymethod.ashx",
		ChallengeNotificationUrl = "https://localhost:44300/sites/website1/r3ds2_notifychallenge.ashx",
		Secure3dVersion = Secure3dVersion.Two
	};
	ServicesContainer.ConfigureService(config);



	var rte = new System.IO.StreamReader(context.Request.InputStream).ReadToEnd();
	var requestJson = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(rte);


	// TODO: consume data sent from the JS Library (requestJson)

	// add to existing card object or create a new one
	CreditCardData card = new CreditCardData();
	card.Number = requestJson.card.number;
	card.ExpMonth = requestJson.card.expiryMonth;
	card.ExpYear = requestJson.card.expiryYear;
	card.Cvn = requestJson.card.securityCode;
	card.CardHolderName = requestJson.card.cardHolderName;

	// Add the customer's billing address
	Address billingAddress = new Address
	{
		StreetAddress1 = "Apartment 852",
		StreetAddress2 = "Complex 741",
		StreetAddress3 = "Unit 4",
		City = "Chicago",
		PostalCode = "50001",
		State = "IL",
		CountryCode = "840"
	};

	// Add the customer's shipping address
	Address shippingAddress = new Address
	{
		StreetAddress1 = "Flat 456",
		StreetAddress2 = "House 789",
		StreetAddress3 = "Basement Flat",
		City = "Halifax",
		PostalCode = "W5 9HR",
		CountryCode = "826"
	};

	// Add captured browser data from the client-side and server-side
	BrowserData browserData = new BrowserData
	{
		AcceptHeader = context.Request.ServerVariables["HTTP_ACCEPT"],
		ColorDepth = requestJson.browserData.colorDepth,
		IpAddress = context.Request.ServerVariables["REMOTE_ADDR"],
		JavaEnabled = requestJson.browserData.javaEnabled,
		Language = requestJson.browserData.language,
		ScreenHeight = requestJson.browserData.screenHeight,
		Timezone = requestJson.browserData.timezoneOffset,
		UserAgent = requestJson.browserData.userAgent,
		ScreenWidth = requestJson.browserData.screenWidth,
		ChallengeWindowSize = requestJson.challengeWindow.windowSize
	};

	ThreeDSecure threeDSecureData = new ThreeDSecure
	{
		ServerTransactionId = requestJson.serverTransactionId
	};

	try
	{
		threeDSecureData = Secure3dService.InitiateAuthentication(card, threeDSecureData)
		   .WithAmount(10.01m)
		   .WithCurrency("USD")
		   .WithOrderCreateDate(new DateTime(2020, 10, 1, 21, 20, 20))
		   .WithCustomerEmail("[email protected]")
		   .WithAddress(billingAddress, AddressType.Billing)
		   .WithAddress(shippingAddress, AddressType.Shipping)
		   .WithBrowserData(browserData)
		   .WithMethodUrlCompletion(((bool)requestJson.methodUrlComplete) ? MethodUrlCompletion.YES : MethodUrlCompletion.NO)
		   .WithMobileNumber("44", "7123456789")
		   .Execute();
	}

	catch (ApiException exce)
	{
		//EXCEPTION THROWN HERE - Exception Message JSON Below
		string s = exce.Message;
		
	}

	//The remaining C# handler code not included here

}

the exception is thrown above in the catch (ApiException exce) section. The exce.Message text is:

Status Code: BadRequest - {
  "three_dsserver_trans_id" : "6a33203a-18ed-4dd4-9a65-dd970a63c7f8",
  "error_code" : "203",
  "error_component" : "S",
  "error_description" : "Format of one or more Data Elements is Invalid according to the Specification",
  "error_detail" : "challenge_notification_url",
  "error_message_type" : "AReq",
  "message_type" : "Erro",
  "message_version" : "2.1.0"
}

The challenge notification URL I have specified in the GatewayConfig is a fully qualified URL less than 256 characters in length as required by the 3D Secure spec. Is there somewhere else I need to specify this? Is it complaining about the URL being null in some other object?

3DS2 - Check Version returned an error 403 Forbidden

Hi,
We did integration on both HPP and API for 3ds2. The HPP works fluently, however, the 3ds2 API does not.

We use SDK to send check version and get 403 forbidden, hence, we send POST by HttpClient manually and still get the same error. The request has content-type json and with securehash header just like what document required. Below are the details of request and response. Why do we keep getting 403 forbidden?

Note that the same account credentials works for HPP without issues.

https://api.globalpay-ecommerce.com/3ds2/protocol-versions
{
    "request_timestamp": "2020-12-07T06:17:59.00187",
    "merchant_id": "MY-MERCHATN-ID",
    "payer_reference": "MY-PAYER-REF",
    "payment_method_reference": "MY-PAYMENT-METHOD-REF",
    "method_notification_url": "MY-METHOD-NOTIFY-URL",
    "account_id": "MY-ACCOUNT-ID"
}
Exception:System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---

And obviously, there is a mistake in the document, the account_name should be account_id instead.
image

Card storage properties are not showing when it's apple pay or google pay

Hi guys, I have an issue getting some data when I process google or apple payment .

usually I get SAVED_PAYER_REF and SAVED_PMT_REF from ResponseValues

but with google pay ResponseValues is always null, not sure if this is just because I'm not on live environment or what

image

anyone know what is the issue on this here please ? couldn't find anything related in the documentation plus couldn't get those two field from anywhere

thanks

Index out of range exception in ProcessAuthorization(AuthorizationBuilder builder)

GlobalPayments.Api.Gateways.ProcessAuthorization(AuthorizationBuilder builder) assumes card holder name is two words.

We've seen Apple Pay and Google Pay names come back as single name ie "James" w/o a last name which causes an Index of of range error here:

var names = card.CardHolderName.Split(new char[] {' '}, 2);

if (!string.IsNullOrEmpty(check.CheckHolderName)) {
                        var names = check.CheckHolderName.Split(new char[] {' '}, 2);
                        et.SubElement(holder, "FirstName", names[0]);
                        et.SubElement(holder, "LastName", names[1]);
                    }

Signature Image Cut Off on Pax devices

When using PromptForSignature on some Pax devices, the signature is cut off.

The problem is because the device type is not passed to SignatureResponse constructor on line #57 of PaxInterface.cs.

Although, a more general solution might be in order, such as calculating needed image size from the point data. For now, the easy fix is to change line 57 to:

        var signatureResponse = new SignatureResponse(response, _controller.DeviceType.Value);

InitiateAuthentication Error

When I am initiating authentication, I am getting below error. Enrollment check is working fine. I don't know where I am making mistake. But there should be brief error description, so that we can at least have some idea. Please help me with this.

Status Code: InternalServerError -

Error received while trying to initialize the connection

We are a certified integrator, and we are currently using the dotnet-SDK to integrate with the PAX S300 device.
The certification process went fine, but during the first deployment in production at one of our clients, the API is returning the following error when it is being initialized (GlobalPayments.Api.Terminals.PAX.PaxInterface.Initialize()):

===> 2019-02-26 19:36:45.665 -05:00 [Debug] [STX]A00[FS]1.35[FS][ETX][
===> 2019-02-26 19:36:45.867 -05:00 [Error] Error while trying to initialize the device.
GlobalPayments.Api.Entities.MessageException: Failed to send message. Check inner exception for more details. ---> System.AggregateException: One or more errors occurred. (An error occurred while sending the request. The server returned an invalid or unrecognized response.) ---> System.Net.WebException: An error occurred while sending the request. The server returned an invalid or unrecognized response. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.IO.IOException: The server returned an invalid or unrecognized response.
at System.Net.Http.HttpConnection.FillAsync()
at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at System.Net.HttpWebRequest.SendRequest() at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at GlobalPayments.Api.Terminals.PAX.PaxHttpInterface.<>c__DisplayClass8_0.<<Send>b__0>d.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at GlobalPayments.Api.Terminals.PAX.PaxHttpInterface.Send(IDeviceMessage message)
--- End of inner exception stack trace ---
at GlobalPayments.Api.Terminals.PAX.PaxHttpInterface.Send(IDeviceMessage message)
at GlobalPayments.Api.Terminals.DeviceController.Send(IDeviceMessage message)
at GlobalPayments.Api.Terminals.PAX.PaxInterface.Initialize()

According to the stack, this error is happening at the GlobalPayments.Api.Terminals.PAX.PaxHttpInterface.Send(IDeviceMessage message) method. I have already checked the communication with the device and it seems OK (was able to telnet to the device IP/port).

Is there anything that can be done? Does anyone else faced this issue before?

Thanks

  • Fabricio

Authentication amount is corrupted in call to InitiateAuthentication

The .Net SDK seems to be sending the incorrect amount to the InitiateAuthentication method. If I send a decimal defined with 1 decimal place, it sends an authentication amount that is 10 times too small.

e.g.

decimal amountToAuthenticatefor = 100.0M;

var threeDSecureData = Secure3dService.InitiateAuthentication(card, threeDSecureData)
				.WithAmount(amountToAuthenticatefor)
				.WithOrderId("Order123")
				.WithCurrency("EUR")
				.WithOrderCreateDate(DateTime.Now)
				.WithCustomerEmail("[email protected]")
				.WithAddress(billingAddress, AddressType.Billing)
				.WithBrowserData(browserData)
				.WithMethodUrlCompletion(MethodUrlCompletion.YES)
				.WithMobileNumber("353", "861234567")
				.Execute();

When I see the 3D Secure 2 challenge popup it will show that it is authenticating for the amount of 10.00 Euro!

However if in the above code I declare amountToAuthenticatefor as 100.00M (notice 2nd decimal place) it will correctly authenticate for 100.00 Euro.

What is the reason for this bahaviour? Is this a bug? Or the SDK shifting the decimal to ensure 2 characters after the decimal?

HostedService is not Thread Safe

When instantiating a HostedService, you are unable to provide a configName property, meaning that in a multi-thread environment each new HostedService will replace the config named "default" in the ServicesContainer._configurations dictionary. This creates a race condition, potentially resulting in using credentials different from those used when instantiating the HostedService.

DigitalWallet payment is not working when I use configName

Hi, I can see a bug when I use configName as parameter in the configurationService

For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.

image

The code above will work if I delete configName parameter , and will fail when I use that

Is there a way to not use ServicesContainer.ConfigureService() statically ?

Hi , today we are forced to use ServicesContainer.ConfigureService as static which a bit dangerous ( not a bit , it's too dangerous )

what would happen if two process started at the same time and the last one will win and the first will fail ? we are supporting multiple bank accounts and ServicesContainer.ConfigureService will never help here .

I know that I can use HostedPaymentConfig one some cases which we are but still that option is not supported via refund and recurring .

this is our current code which I'm pretty sure we should never use static call here .

var config = new GpEcomConfig
            {
                MerchantId = gatewaySettings.MerchantId,
                AccountId = gatewaySettings.AccountId,
                SharedSecret = gatewaySettings.SharedSecret,
                RebatePassword = gatewaySettings.RebatePassword ,
                RefundPassword = gatewaySettings.RefundPassword,
                ServiceUrl = gatewaySettings.LiveMode
                    ? RealexConstants.LiveUrl
                    : RealexConstants.TestUrl
            };
            ServicesContainer.ConfigureService(config); // the buggy part :) 

//then do refund or whatever . 

any help or though here please ?

For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.

Following versions:

<package id="GlobalPayments.Api" version="1.6.1-BETA" targetFramework="net472" />
<package id="GlobalPayments.Api" version="1.5.18" targetFramework="net472" />

Throws:

For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at GlobalPayments.Api.Utils.ElementTree..ctor(String xml)
   at GlobalPayments.Api.Gateways.RealexConnector.MapResponse(String rawResponse, List`1 acceptedCodes)
   at GlobalPayments.Api.Gateways.RealexConnector.ProcessAuthorization(AuthorizationBuilder builder)
   at GlobalPayments.Api.Builders.AuthorizationBuilder.Execute(String configName)
   at CardPayments.Controllers.HomeController.ProcessPayment(OrderDetails details) in D:\tests\GlobalPayments\CardPayments\Controllers\HomeController.cs:line 86
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()

This error is thrown on 3ds1 and normal card payments:

var authResponse = creditCard.Charge(15.15m)
    .WithCurrency("USD")
    .WithAddress(address)
    .WithAllowDuplicates(true)
    .Execute("MyGlobalPaymentsDemo");

Configuration:

ServicesContainer.ConfigureService(new GatewayConfig
{
    MerchantId = "MY_M_ID",
    AccountId = "MY_A_ID",
    SharedSecret = "MY_SECRET",
    ServiceUrl = "https://pay.sandbox.realexpayments.com/pay",
    HostedPaymentConfig = new HostedPaymentConfig
    {
        Version = "2"
    }
}, "MyGlobalPaymentsDemo");

this needs to be fixed inside lib. as Master is not building I can't do PR.

Master branch has build errors to merge markers

Entities\Enums.cs(1022,1,1022,8): error CS8300: Merge conflict marker encountered
Entities\Enums.cs(1027,1,1027,8): error CS8300: Merge conflict marker encountered
Entities\Enums.cs(1028,1,1028,8): error CS8300: Merge conflict marker encountered
Gateways\Gp3DSProvider.cs(125,1,125,8): error CS8300: Merge conflict marker encountered
Gateways\Gp3DSProvider.cs(127,1,127,8): error CS8300: Merge conflict marker encountered
Gateways\Gp3DSProvider.cs(129,1,129,8): error CS8300: Merge conflict marker encountered
Done building project "GlobalPayments.Api.csproj" -- FAILED.

why no sample web application project to demonstrate about 3d security v2?

I have seen all your examples project. all are build using your very old api.

coming to the point.

  1. i read your developer portal about 3d security v2 implementation using .net but, there lot of continuity is missing
  2. most of the terms are not explained
  3. on your sample code section, you just posted portion of code only. 100% no one can understand this type.

i recommend to you is, please post step by step practical guide project in github because, your developer portal is not at all enough to understand the flow.

kindly reply me since, i called you many time but, no response; email also no proper response.

thank you
jey

ChallengeRequestIndicator is serialized incorrectly

ChallengeRequestIndicator is serialized as a number e.g. "HPP_CHALLENGE_REQUEST_INDICATOR":3
The Hosted Payment Page expects this to be provided as a string i.e. "HPP_CHALLENGE_REQUEST_INDICATOR":"CHALLENGE_MANDATED"

This results in a "508 Invalid data in the HPP_CHALLENGE_REQUEST_INDICATOR field. Please contact the merchant." error from the hosted payment page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.