Recently I'm working on a payment plugin for zarinpal.com gate way.
I have to add a service reference by this URL :
https://sandbox.zarinpal.com/pg/services/WebGate/wsdl
Every thing is ok but in PostProcessPayment I face with the error :
Could not find default endpoint element that references contract 'ServiceReference.PaymentGatewayImplementationServicePortType' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
and this is my PostProcessPayment method
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
string urlToRedirect = "";
var zarinpal = new ServiceReference.PaymentGatewayImplementationServicePortTypeClient();
string outResult = "";
int code = zarinpal.PaymentRequest("5607e960-d64c-4a8b-b03b-0e645bef37d4", 2500, "Our Test Store Name", "[email protected]", "0999999999", "http://" + _webHelper.GetStoreLocation(false) + "/Plugins/ZarinPal/PDTHandler", out outResult);// test
if (code == 100)
{
urlToRedirect = string.Concat("https://sandbox.zarinpal.com/pg/StartPay/", outResult);
}
_httpContext.Response.Redirect(urlToRedirect);
}
I would better to mention that if i add the Service Reference to Nop.Web Project too, it works well, but I want to build this as a module and adding the Service Reference Manually to Nop.Web is Unpleasant.
could you please help me ?