Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
using GlobalPayments.Api.PaymentMethods;
using GlobalPayments.Api.Utils;
using System.Linq;
using System.Net;

namespace GlobalPayments.Api.Gateways.BillPay {
/// <summary>
/// Factory method to create and return the request object based on the transaction type
/// </summary>
internal class AuthorizationRequest : GatewayRequestBase {
public AuthorizationRequest(Credentials credentials, string serviceUrl, int timeout) {
public AuthorizationRequest(Credentials credentials, string serviceUrl, int timeout, IWebProxy webProxy) {
this.Credentials = credentials;
this.ServiceUrl = serviceUrl;
this.Timeout = timeout;
this.WebProxy = webProxy;
}

internal Transaction Execute(AuthorizationBuilder builder, bool isBillDataHosted) {
Expand Down
4 changes: 3 additions & 1 deletion src/GlobalPayments.Api/Gateways/BillPay/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
using GlobalPayments.Api.Entities.Billing;
using GlobalPayments.Api.Entities.Enums;
using GlobalPayments.Api.Utils;
using System.Net;

namespace GlobalPayments.Api.Gateways.BillPay {
/// <summary>
/// Factory method to create and return the request object based on the transaction type
/// </summary>
internal class BillingRequest : GatewayRequestBase {
public BillingRequest(Credentials credentials, string serviceUrl, int timeout)
public BillingRequest(Credentials credentials, string serviceUrl, int timeout, IWebProxy webPRoxy)
{
this.Credentials = credentials;
this.ServiceUrl = serviceUrl;
this.Timeout = timeout;
this.WebProxy = webPRoxy;
}

internal BillingResponse Execute(BillingBuilder builder) {
Expand Down
4 changes: 3 additions & 1 deletion src/GlobalPayments.Api/Gateways/BillPay/ManagementRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
using GlobalPayments.Api.Entities.Billing;
using GlobalPayments.Api.PaymentMethods;
using GlobalPayments.Api.Utils;
using System.Net;

namespace GlobalPayments.Api.Gateways.BillPay {
/// <summary>
/// Factory method to create and return the request object based on the transaction type
/// </summary>
internal class ManagementRequest : GatewayRequestBase {
public ManagementRequest(Credentials credentials, string serviceUrl, int timeout) {
public ManagementRequest(Credentials credentials, string serviceUrl, int timeout, IWebProxy webProxy) {
this.Credentials = credentials;
this.ServiceUrl = serviceUrl;
this.Timeout = timeout;
this.WebProxy = webProxy;
}

internal Transaction Execute(ManagementBuilder builder, bool isBillDataHosted) {
Expand Down
4 changes: 3 additions & 1 deletion src/GlobalPayments.Api/Gateways/BillPay/RecurringRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
using GlobalPayments.Api.Entities.Billing;
using GlobalPayments.Api.PaymentMethods;
using GlobalPayments.Api.Utils;
using System.Net;

namespace GlobalPayments.Api.Gateways.BillPay {
internal sealed class RecurringRequest<T> : GatewayRequestBase where T: class {
public RecurringRequest(Credentials credentials, string serviceUrl, int timeout) {
public RecurringRequest(Credentials credentials, string serviceUrl, int timeout, IWebProxy webProxy) {
this.Credentials = credentials;
this.ServiceUrl = serviceUrl;
this.Timeout = timeout;
this.WebProxy = webProxy;
}

internal T Execute(RecurringBuilder<T> builder) {
Expand Down
11 changes: 7 additions & 4 deletions src/GlobalPayments.Api/Gateways/BillPayProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using GlobalPayments.Api.Entities;
using GlobalPayments.Api.Entities.Billing;
using GlobalPayments.Api.Gateways.BillPay;
using System.Net;

namespace GlobalPayments.Api.Gateways {
internal class BillPayProvider: IBillingProvider, IPaymentGateway, IRecurringService {
Expand All @@ -19,13 +20,15 @@ internal class BillPayProvider: IBillingProvider, IPaymentGateway, IRecurringSer

public string ServiceUrl { get; set; }

public IWebProxy WebProxy { get; set; }

/// <summary>
/// Invokes a request against the BillPay gateway using the AuthorizationBuilder
/// </summary>
/// <param name="builder">The <see cref="AuthorizationBuilder">AuthroizationBuilder</see> containing the required information to build the request</param>
/// <returns>A Transaction response</returns>
public Transaction ProcessAuthorization(AuthorizationBuilder builder) {
return new AuthorizationRequest(Credentials, ServiceUrl, Timeout)
return new AuthorizationRequest(Credentials, ServiceUrl, Timeout, WebProxy)
.Execute(builder, IsBillDataHosted);
}

Expand All @@ -35,18 +38,18 @@ public Transaction ProcessAuthorization(AuthorizationBuilder builder) {
/// <param name="builder">The <see cref="ManagementBuilder">ManagementBuilder</see> containing the required information to build the request</param>
/// <returns>A Transaction response</returns>
public Transaction ManageTransaction(ManagementBuilder builder) {
return new ManagementRequest(Credentials, ServiceUrl, Timeout)
return new ManagementRequest(Credentials, ServiceUrl, Timeout, WebProxy)
.Execute(builder, IsBillDataHosted);
}

public BillingResponse ProcessBillingRequest(BillingBuilder builder) {
return new BillingRequest(Credentials, ServiceUrl, Timeout)
return new BillingRequest(Credentials, ServiceUrl, Timeout, WebProxy)
.Execute(builder);
}

public T ProcessRecurring<T>(RecurringBuilder<T> builder) where T : class
{
return new RecurringRequest<T>(Credentials, ServiceUrl, Timeout)
return new RecurringRequest<T>(Credentials, ServiceUrl, Timeout, WebProxy)
.Execute(builder);
}

Expand Down
3 changes: 2 additions & 1 deletion src/GlobalPayments.Api/ServiceConfigs/BillPayConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
},
ServiceUrl = ServiceUrl ?? ServiceEndpoints.BILLPAY_PRODUCTION,
Timeout = Timeout,
IsBillDataHosted = UseBillRecordlookup
IsBillDataHosted = UseBillRecordlookup,
WebProxy = WebProxy
};

services.GatewayConnector = gateway;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
RegisterNumber = RegisterNumber,
TerminalId = TerminalId,
Timeout = Timeout,
ServiceUrl = ServiceUrl
ServiceUrl = ServiceUrl,
WebProxy = WebProxy
};

services.GatewayConnector = gateway;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
SharedSecret = SharedSecret,
Timeout = Timeout,
ServiceUrl = ServiceUrl,
HostedPaymentConfig = HostedPaymentConfig
HostedPaymentConfig = HostedPaymentConfig,
WebProxy = WebProxy
};
services.GatewayConnector = gateway;
services.RecurringConnector = gateway;
Expand All @@ -98,7 +99,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
MerchantContactUrl = MerchantContactUrl,
MethodNotificationUrl = MethodNotificationUrl,
ChallengeNotificationUrl = ChallengeNotificationUrl,
Timeout = Timeout
Timeout = Timeout,
WebProxy = WebProxy
//secure3d2.EnableLogging = EnableLogging
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
Timeout = Timeout,
ServiceUrl = ServiceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx",
UniqueDeviceId = UniqueDeviceId,
RequestLogger = RequestLogger
RequestLogger = RequestLogger,
WebProxy = WebProxy
};
services.GatewayConnector = gateway;

Expand All @@ -123,7 +124,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
SecretApiKey = SecretApiKey,
Timeout = Timeout,
ServiceUrl = ServiceUrl + PayPlanEndpoint,
RequestLogger = RequestLogger
RequestLogger = RequestLogger,
WebProxy = WebProxy
};
services.RecurringConnector = payplan;

Expand All @@ -142,7 +144,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
TermID = TerminalID,
Timeout = Timeout,
ServiceUrl = ServiceUrl,
X509CertPath = X509CertificatePath
X509CertPath = X509CertificatePath,
WebProxy = WebProxy
};

services.PayFacProvider = payFac;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ internal override void ConfigureContainer(ConfiguredServices services) {
TransactionKey = TransactionKey,
ServiceUrl = ServiceUrl,
Timeout = Timeout,
RequestLogger = RequestLogger
RequestLogger = RequestLogger,
WebProxy = WebProxy
};

services.GatewayConnector = gateway;
Expand Down