public function process($paymentInfo, $function) { // initilize paypal class $paypal = new Paypal(); if ($function == "DoDirectPayment") { return $paypal->DoDirectPayment($paymentInfo); } if ($function == "SetExpressCheckout") { return $paypal->SetExpressCheckout($paymentInfo); } if ($function == "GetExpressCheckoutDetails") { return $paypal->GetExpressCheckoutDetails($paymentInfo); } if ($function == "DoExpressCheckoutPayment") { return $paypal->DoExpressCheckoutPayment($paymentInfo); } if ($function == "DoVoid") { return $paypal->DoVoid($paymentInfo); } if ($function == "DoReauthorization") { return $paypal->DoReauthorization($paymentInfo); } if ($function == "DoCapture") { return $paypal->DoCapture($paymentInfo); } if ($function == "DoRefund") { return $paypal->DoRefund($paymentInfo); } return "Function Does Not Exist!"; }
function processPayment($paymentInfo, $function) { $paypal = new Paypal(); if ($function == "DoDirectPayment") { return $paypal->DoDirectPayment($paymentInfo); } elseif ($function == "SetExpressCheckout") { return $paypal->SetExpressCheckout($paymentInfo); } elseif ($function == "GetExpressCheckoutDetails") { return $paypal->GetExpressCheckoutDetails($paymentInfo); } elseif ($function == "DoExpressCheckoutPayment") { return $paypal->DoExpressCheckoutPayment($paymentInfo); } else { return "Function Does Not Exist!"; } }
function processPayment($paymentInfo, $function) { $paypal = new Paypal(); if ($function == "DoDirectPayment") { return $paypal->DoDirectPayment($paymentInfo); } elseif ($function == "SetExpressCheckout") { return $paypal->SetExpressCheckout($paymentInfo); } elseif ($function == "GetExpressCheckoutDetails") { return $paypal->GetExpressCheckoutDetails($paymentInfo); } elseif ($function == "DoExpressCheckoutPayment") { return $paypal->DoExpressCheckoutPayment($paymentInfo); } elseif ($function == "CreateRecurringPayments") { return $paypal->CreateRecurringPayments($paymentInfo); } elseif ($function == "UpdateRecurringPaymentsProfile") { return $paypal->UpdateRecurringPaymentsProfile($paymentInfo); } elseif ($function == "ManageRecurringPaymentsProfileStatus") { return $paypal->ManageRecurringPaymentsProfileStatus($paymentInfo); } else { return "Function Does Not Exist!"; } }