using Nop.Core; namespace Nop.Plugin.Payments.PayPalCommerce; /// /// Represents the plugin constants /// public class PayPalCommerceDefaults { /// /// Gets the plugin system name /// public static string SystemName => "Payments.PayPalCommerce"; /// /// Gets the user agent used to request third-party services /// public static string UserAgent => $"nopCommerce-{NopVersion.FULL_VERSION}"; /// /// Gets the session key to get process payment request /// public static string PaymentRequestSessionKey => "OrderPaymentInfo"; /// /// Gets the name of a generic attribute to store the refund identifier /// public static string RefundIdAttributeName => "PayPalCommerceRefundId"; /// /// Gets the name of the generic attribute that is used to store shipment carrier /// public static string ShipmentCarrierAttribute => "PayPalCommerceShipmentCarrier"; /// /// Gets the service URL /// public static (string Sandbox, string Live) ServiceUrl => ("https://api-m.sandbox.paypal.com/", "https://api-m.paypal.com/"); /// /// Gets the service JS script URL /// public static string ServiceScriptUrl => "https://www.paypal.com/sdk/js"; /// /// Gets the Apple Pay JS script URL /// public static string ApplePayScriptUrl => "https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js"; /// /// Gets the Google Pay JS script URL /// public static string GooglePayScriptUrl => "https://pay.google.com/gp/p/js/pay.js"; /// /// Gets the merchant configurator JS script URL /// public static string MerchantConfiguratorScriptUrl => "https://www.paypalobjects.com/merchant-library/merchant-configurator.js"; /// /// Gets the partner attribution header used for each request to APIs /// public static (string Name, string Value) PartnerHeader => ("PayPal-Partner-Attribution-Id", "MazSoft_Cart_PPCP"); /// /// Gets a default period (in seconds) before the request times out /// public static int RequestTimeout => 10; /// /// Gets the tab id of the payment tokens menu item /// public static int PaymentTokensMenuTab => 485; /// /// Gets webhook event names to subscribe /// public static List WebhookEventNames => [ "PAYMENT.CAPTURE.COMPLETED", //a capture has been successfully completed "PAYMENT.CAPTURE.DENIED", //a capture has been denied "PAYMENT.CAPTURE.DECLINED", //a capture has been declined "PAYMENT.CAPTURE.REFUNDED", //the seller has voluntarily refunded a payment back to the buyer "PAYMENT.CAPTURE.REVERSED", //a payment has been involuntarily refunded back to the buyer "PAYMENT.CAPTURE.PENDING", //the state of a payment capture changes to pending "CHECKOUT.ORDER.COMPLETED", //a buyer's order has been completed "CHECKOUT.ORDER.APPROVED", //a buyer's order has been approved by the seller "CHECKOUT.ORDER.PROCESSED", //a buyer's order is being processed "CHECKOUT.PAYMENT-APPROVAL.REVERSED", //a problem occurred after the buyer approved the order but before you captured the payment "PAYMENT.AUTHORIZATION.CREATED", //a payment authorization is created, approved or executed "PAYMENT.AUTHORIZATION.VOIDED", //a payment authorization is voided "VAULT.PAYMENT-TOKEN.CREATED", //the payment source is saved (for cards and PayPal vaulting) "VAULT.PAYMENT-TOKEN.DELETION-INITIATED", //the payment source is deleted (for PayPal vaulting only) "VAULT.PAYMENT-TOKEN.DELETED", //the payment source is deleted (for cards and PayPal vaulting) ]; /// /// Gets a list of currencies that do not support decimals. /// Refer to https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ for more information /// public static List CurrenciesWithoutDecimals => ["HUF", "JPY", "TWD"]; /// /// Gets a list of countries that supported Pay Later feature /// Refer to https://developer.paypal.com/docs/checkout/pay-later/us/#eligibility for more information /// public static List PayLaterSupportedCountries => ["US", "AU", "DE", "ES", "FR", "GB", "IT"]; #region Route names /// /// Represents the route names /// public class Route { /// /// Gets the configuration route name /// public static string Configuration => "Plugin.Payments.PayPalCommerce.Configure"; /// /// Gets the onboarding callback route name /// public static string OnboardingCallback => "Plugin.Payments.PayPalCommerce.OnboardingCallback"; /// /// Gets the webhook route name /// public static string Webhook => "Plugin.Payments.PayPalCommerce.Webhook"; /// /// Gets the payment info route name /// public static string PaymentInfo => "Plugin.Payments.PayPalCommerce.PaymentInfo"; /// /// Gets the confirm order route name /// public static string ConfirmOrder => "Plugin.Payments.PayPalCommerce.ConfirmOrder"; /// /// Gets the one page checkout route name /// public static string OnePageCheckout => "CheckoutOnePage"; /// /// Gets the shopping cart route name /// public static string ShoppingCart => "ShoppingCart"; /// /// Gets the checkout completed route name /// public static string CheckoutCompleted => "CheckoutCompleted"; /// /// Gets the customer info route name /// public static string CustomerInfo => "CustomerInfo"; /// /// Gets the payment tokens route name /// public static string PaymentTokens => "Plugin.Payments.PayPalCommerce.PaymentTokens"; } #endregion #region Onboarding /// /// Represents the onboarding constants /// public class Onboarding { /// /// Gets the onboarding JS script URL /// public static string ScriptUrl => "https://www.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js"; /// /// Gets the onboarding URL /// public static (string Sandbox, string Live) Url => ("https://www.sandbox.paypal.com/bizsignup/partner/entry", "https://www.paypal.com/bizsignup/partner/entry"); /// /// Gets the id /// public static (string Sandbox, string Live) Id => ("4UK3WDQYUYNR6", "8A4FPTZ95K6MN"); /// /// Gets the client id /// public static (string Sandbox, string Live) ClientId => ("AUh4KQIcvc4uOWNlDxTHz0vXbCHASdCYyIenUXDDaiSFlHdD351YPrC0Dwv_rHxrPHFANmCwCoL-2w8j", "ATiO0tnu-7qEuOqUSp-WcA5YfzBmXq0kxdfasuKabSULa19wuQf2660qGVXySGyZPZnvtFUuukZ2Os-M"); /// /// Gets the base URL of onboarding services /// public static string ServiceUrl => "https://www.nopcommerce.com/"; /// /// Gets the logo URL to display in the merchant's onboarding flow /// public static string LogoUrl => "https://www.nopcommerce.com/themes/officialsite/content/images/logo.png"; } #endregion }