diff --git a/Libraries/Hotcakes.Commerce/BusinessRules/OrderTasks/StartPaypalExpressCheckout.cs b/Libraries/Hotcakes.Commerce/BusinessRules/OrderTasks/StartPaypalExpressCheckout.cs index 077a1d1b4..6b3e2aacb 100644 --- a/Libraries/Hotcakes.Commerce/BusinessRules/OrderTasks/StartPaypalExpressCheckout.cs +++ b/Libraries/Hotcakes.Commerce/BusinessRules/OrderTasks/StartPaypalExpressCheckout.cs @@ -63,14 +63,10 @@ public override bool ProcessCheckout(OrderTaskContext context) EventLog.LogEvent("PayPal Express Checkout", "CartReturnUrl=" + cartReturnUrl, EventLogSeverity.Information); PaymentActionCodeType mode = PaymentActionCodeType.Authorization; - if (context.HccApp.CurrentStore.Settings.PayPal.ExpressAuthorizeOnly) - { - mode = PaymentActionCodeType.Order; - } - else + if (!context.HccApp.CurrentStore.Settings.PayPal.ExpressAuthorizeOnly) { mode = PaymentActionCodeType.Sale; - } + } // Accelerated boarding if (string.IsNullOrWhiteSpace(context.HccApp.CurrentStore.Settings.PayPal.UserName)) diff --git a/Libraries/Hotcakes.Commerce/Payment/Methods/PaypalExpress.cs b/Libraries/Hotcakes.Commerce/Payment/Methods/PaypalExpress.cs index 77041a74f..92ed88202 100644 --- a/Libraries/Hotcakes.Commerce/Payment/Methods/PaypalExpress.cs +++ b/Libraries/Hotcakes.Commerce/Payment/Methods/PaypalExpress.cs @@ -70,10 +70,16 @@ public bool Authorize(Transaction t, HotcakesApplication app) { var OrderNumber = t.MerchantInvoiceNumber + Guid.NewGuid(); + PaymentActionCodeType mode = PaymentActionCodeType.Authorization; + if (!app.CurrentStore.Settings.PayPal.ExpressAuthorizeOnly) + { + mode = PaymentActionCodeType.Sale; + } + var paymentResponse = ppAPI.DoExpressCheckoutPayment(t.PreviousTransactionNumber, t.PreviousTransactionAuthCode, t.Amount.ToString("N", CultureInfo.InvariantCulture), - PaymentActionCodeType.Order, + mode, PayPalAPI.GetCurrencyCodeType(app.CurrentStore.Settings.PayPal.Currency), OrderNumber);