Hi,
Has anyone successfully integration BrainTree payment processor (https://www.braintreepayments.com/developers) with NopCommerce?
Thanks
Nikhil Singhal
bool skipPaymentWorkflow = orderTotal.Value == decimal.Zero;
[NonAction]
protected override bool IsPaymentWorkflowRequired(IList<ShoppingCartItem> cart, bool ignoreRewardPoints = false)
{
bool result = true;
if (cart.Any(i => i.Product.RequirePaymentInfo == true))
return result;
else
return base.IsPaymentWorkflowRequired(cart, ignoreRewardPoints);
}
/// <summary>
/// Process recurring payment
/// </summary>
/// <param name="processPaymentRequest">Payment info required for an order processing</param>
/// <returns>Process payment result</returns>
public virtual ProcessPaymentResult ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest)
{
// D360 edit
// && processPaymentRequest.RequirePaymentInfo == false
if (processPaymentRequest.OrderTotal == decimal.Zero && processPaymentRequest.RequirePaymentInfo == false)
{
var result = new ProcessPaymentResult()
{
NewPaymentStatus = PaymentStatus.Paid
};
return result;
}
else
{
var paymentMethod = LoadPaymentMethodBySystemName(processPaymentRequest.PaymentMethodSystemName);
if (paymentMethod == null)
throw new NopException("Payment method couldn't be loaded");
return paymentMethod.ProcessRecurringPayment(processPaymentRequest);
}
}