Skip to content

Instantly share code, notes, and snippets.

@darkin1
Last active December 17, 2017 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkin1/b326e9f1050bdd030f7ecc717cc7aa66 to your computer and use it in GitHub Desktop.
Save darkin1/b326e9f1050bdd030f7ecc717cc7aa66 to your computer and use it in GitHub Desktop.
<?php
class Checkout
{
public function payment($type)
{
if ($type == 'cash') {
$payment = 'cash';//new Chash();
} elseif ($type == 'credit-card') {
$payment = 'creadit card';//new CreditCard();
} elseif ($type == 'bitcoin') {
$payment = 'bitcoin';//new Bitcoin();
}
return $payment;
}
}
$checkout = new Checkout();
echo $checkout->payment('bitcoin');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment