GetPaymentInfoAsync(IFormCollection form)
{
return Task.FromResult(new ProcessPaymentRequest());
}
///
/// Gets a configuration page URL
///
public override string GetConfigurationPageUrl()
{
return $"{_webHelper.GetStoreLocation()}Admin/PaymentCheckMoneyOrder/Configure";
}
///
/// Gets a type of a view component for displaying plugin in public store ("payment info" checkout step)
///
/// View component type
public Type GetPublicViewComponent()
{
return typeof(CheckMoneyOrderViewComponent);
}
///
/// Install the plugin
///
/// A task that represents the asynchronous operation
public override async Task InstallAsync()
{
//settings
var settings = new CheckMoneyOrderPaymentSettings
{
DescriptionText = "Mail Personal or Business Check, Cashier's Check or money order to:
COMPANY NAME
your address here,
New York, NY 10001
USA
Notice that if you pay by Personal or Business Check, your order may be held for up to 10 days after we receive your check to allow enough time for the check to clear. If you want us to ship faster upon receipt of your payment, then we recommend your send a money order or Cashier's check.
P.S. You can edit this text from admin panel.
"
};
await _settingService.SaveSettingAsync(settings);
//locales
await _localizationService.AddOrUpdateLocaleResourceAsync(new Dictionary
{
["Plugins.Payment.CheckMoneyOrder.AdditionalFee"] = "Additional fee",
["Plugins.Payment.CheckMoneyOrder.AdditionalFee.Hint"] = "The additional fee.",
["Plugins.Payment.CheckMoneyOrder.AdditionalFeePercentage"] = "Additional fee. Use percentage",
["Plugins.Payment.CheckMoneyOrder.AdditionalFeePercentage.Hint"] = "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used.",
["Plugins.Payment.CheckMoneyOrder.DescriptionText"] = "Description",
["Plugins.Payment.CheckMoneyOrder.DescriptionText.Hint"] = "Enter info that will be shown to customers during checkout",
["Plugins.Payment.CheckMoneyOrder.PaymentMethodDescription"] = "Pay by cheque or money order",
["Plugins.Payment.CheckMoneyOrder.ShippableProductRequired"] = "Shippable product required",
["Plugins.Payment.CheckMoneyOrder.ShippableProductRequired.Hint"] = "An option indicating whether shippable products are required in order to display this payment method during checkout."
});
await base.InstallAsync();
}
///
/// Uninstall the plugin
///
/// A task that represents the asynchronous operation
public override async Task UninstallAsync()
{
//settings
await _settingService.DeleteSettingAsync();
//locales
await _localizationService.DeleteLocaleResourcesAsync("Plugins.Payment.CheckMoneyOrder");
await base.UninstallAsync();
}
///
/// Gets a payment method description that will be displayed on checkout pages in the public store
///
///
/// return description of this payment method to be display on "payment method" checkout step. good practice is to make it localizable
/// for example, for a redirection payment method, description may be like this: "You will be redirected to PayPal site to complete the payment"
///
/// A task that represents the asynchronous operation
public async Task GetPaymentMethodDescriptionAsync()
{
return await _localizationService.GetResourceAsync("Plugins.Payment.CheckMoneyOrder.PaymentMethodDescription");
}
#endregion
#region Properties
///
/// Gets a value indicating whether capture is supported
///
public bool SupportCapture => false;
///
/// Gets a value indicating whether partial refund is supported
///
public bool SupportPartiallyRefund => false;
///
/// Gets a value indicating whether refund is supported
///
public bool SupportRefund => false;
///
/// Gets a value indicating whether void is supported
///
public bool SupportVoid => false;
///
/// Gets a recurring payment type of payment method
///
public RecurringPaymentType RecurringPaymentType => RecurringPaymentType.NotSupported;
///
/// Gets a payment method type
///
public PaymentMethodType PaymentMethodType => PaymentMethodType.Standard;
///
/// Gets a value indicating whether we should display a payment information page for this plugin
///
public bool SkipPaymentInfo => false;
#endregion
}