Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Add support for payment methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Nov 12, 2015
1 parent 4178646 commit 130addd
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,42 @@ public function get_issuers() {
* @since 1.2.0
*/
public function get_issuer_field() {
if ( Pronamic_WP_Pay_PaymentMethods::IDEAL === $this->get_payment_method() ) {
return array (
'id' => 'pronamic_ideal_issuer_id',
'name' => 'pronamic_ideal_issuer_id',
'label' => __( 'Choose your bank', 'pronamic_ideal' ),
'required' => true,
'type' => 'select',
'choices' => $this->get_transient_issuers(),
);
}
}

/////////////////////////////////////////////////

/**
* Get payment methods
*
* @return mixed an array or null
*/
public function get_payment_methods() {
$payment_methods = new ReflectionClass( 'Pronamic_WP_Pay_Gateways_MultiSafepay_Gateways' );

return array( array( 'options' => $payment_methods->getConstants() ) );
}

/////////////////////////////////////////////////

/**
* Get supported payment methods
*
* @see Pronamic_WP_Pay_Gateway::get_supported_payment_methods()
*/
public function get_supported_payment_methods() {
return array(
'id' => 'pronamic_ideal_issuer_id',
'name' => 'pronamic_ideal_issuer_id',
'label' => __( 'Choose your bank', 'pronamic_ideal' ),
'required' => true,
'type' => 'select',
'choices' => $this->get_transient_issuers(),
Pronamic_WP_Pay_PaymentMethods::IDEAL => Pronamic_WP_Pay_Gateways_MultiSafepay_Gateways::IDEAL,
Pronamic_WP_Pay_PaymentMethods::BANK_TRANSFER => Pronamic_WP_Pay_Gateways_MultiSafepay_Gateways::BANK_TRANSFER,
);
}

Expand Down

0 comments on commit 130addd

Please sign in to comment.