Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Payment method options

givanz05ec35cacfcd
diff --git a/system/payment-method.php b/system/payment-method.php
index fefb025..2b32695 100755
--- a/system/payment-method.php
+++ b/system/payment-method.php
@@ -30,4 +30,6 @@ abstract class PaymentMethod {
}
abstract public function getMethod();
+
+ abstract public function init();
}
diff --git a/system/payment.php b/system/payment.php
index dce1c61..f9cccfc 100755
--- a/system/payment.php
+++ b/system/payment.php
@@ -47,10 +47,12 @@ class Payment {
public function getMethods() {
$data = [];
- foreach ($this->methods as $name => $class) {
+ foreach ($this->methods as $name => $options) {
+ $class = $options[0];
+ $params = $options[1];
$obj = new $class(Cart::getInstance());
$this->instances[$name] = $obj;
- $paymentData = $obj->getMethod();
+ $paymentData = $obj->getMethod($params);
//if payment method returns false or no data then don't add it to the list
if ($paymentData) {
$data[$name] = $paymentData;
@@ -60,8 +62,8 @@ class Payment {
return $data;
}
- public function registerMethod($method, $class) {
- $this->methods[$method] = $class;
+ public function registerMethod($method, $class, $params = []) {
+ $this->methods[$method] = [$class, $params];
}
public function setMethod($method) {