Skip to content

Commit

Permalink
Merge pull request #5 from QuickPay/main
Browse files Browse the repository at this point in the history
modified getMethods function
  • Loading branch information
portasandrei authored Feb 14, 2024
2 parents 2031295 + bda892d commit 548ebae
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 220 deletions.
75 changes: 42 additions & 33 deletions catalog/model/payment/quickpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,49 @@
* Class ModelExtensionPaymentQuickPay
*/
class QuickPay extends \Opencart\System\Engine\Model implements \QuickPay\Statuses {
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;

/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay';
}
/**
* Return the data of the payment method
*
* @return string
*/
public function getMethods( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, 'quickpay' );
}

/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => $this->instanceConfig( 'payment_methods' ),
'auto_fee' => $this->instanceConfig( 'autofee' ),
'auto_capture' => $this->instanceConfig( 'autocapture' ),
'branding_id' => $this->instanceConfig( 'branding_id' ),
];
}
/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay';
}

/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
'text_on_statement' => $this->instanceConfig( 'text_on_statement' ),
];
}
/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => $this->instanceConfig( 'payment_methods' ),
'auto_fee' => $this->instanceConfig( 'autofee' ),
'auto_capture' => $this->instanceConfig( 'autocapture' ),
'branding_id' => $this->instanceConfig( 'branding_id' ),
];
}

/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
'text_on_statement' => $this->instanceConfig( 'text_on_statement' ),
];
}
}
69 changes: 37 additions & 32 deletions catalog/model/payment/quickpay_anydaysplit.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,45 @@
* Class ModelExtensionPaymentQuickPay
*/
class QuickPayAnydaySplit extends \Opencart\System\Engine\Model implements \QuickPay\Statuses {
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;

public function getMethod( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, '_anydaysplit' );
}
/**
* Return the data of the payment method
*
* @return string
*/
public function getMethods( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, 'quickpay_anydaysplit' );
}

/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_anydaysplit';
}
/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_anydaysplit';
}

/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'anyday-split',
];
}
/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'anyday-split',
];
}

/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
];
}
/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
];
}
}
69 changes: 37 additions & 32 deletions catalog/model/payment/quickpay_klarna.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,45 @@
* Class ModelExtensionPaymentQuickPay
*/
class QuickPayKlarna extends \Opencart\System\Engine\Model implements \QuickPay\Statuses {
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;

public function getMethod( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, '_klarna' );
}
/**
* Return the data of the payment method
*
* @return string
*/
public function getMethods( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, 'quickpay_klarna' );
}

/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_klarna';
}
/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_klarna';
}

/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'klarna-payments',
];
}
/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'klarna-payments',
];
}

/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
];
}
/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
];
}
}
69 changes: 37 additions & 32 deletions catalog/model/payment/quickpay_mobilepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,47 @@
* Class ModelExtensionPaymentQuickPay
*/
class QuickPayMobilePay extends \Opencart\System\Engine\Model implements \QuickPay\Statuses {
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;

public function getMethod( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, '_mobilepay' );
}
/**
* Return the data of the payment method
*
* @return string
*/
public function getMethods( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, 'quickpay_mobilepay' );
}

/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_mobilepay';
}
/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_mobilepay';
}

/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'mobilepay',
];
}
/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'mobilepay',
];
}

/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
'payment_methods' => 'mobilepay',
'telephone' => '+38057294432',
];
}
];
}
}
69 changes: 37 additions & 32 deletions catalog/model/payment/quickpay_sofort.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,45 @@
* Class ModelExtensionPaymentQuickPay
*/
class QuickPaySofort extends \Opencart\System\Engine\Model implements \QuickPay\Statuses {
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;
use \Quickpay\Catalog\Model;
use \Quickpay\Catalog\Recurring\Model;

public function getMethod( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, '_sofort' );
}
/**
* Return the data of the payment method
*
* @return string
*/
public function getMethods( $address, $total = 0 ) {
return $this->getMethodData( $address, $total, 'quickpay_sofort' );
}

/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_sofort';
}
/**
* Return the name of the payment instance
*
* @return string
*/
public function getInstanceName() {
return 'quickpay_sofort';
}

/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'sofort',
];
}
/**
* Return gateway specific payment link data
*
* @return array
*/
public function getPaymentLinkData() {
return [
'payment_methods' => 'sofort',
];
}

/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
];
}
/**
* Returns gateway specific payment data
*
* @return array
*/
public function getPaymentData() {
return [
];
}
}
Loading

0 comments on commit 548ebae

Please sign in to comment.