Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MobilePay payment method (#16). #17

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function() {
$this->register_payment_method( new PaymentMethod( PaymentMethods::KLARNA_PAY_NOW ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::KLARNA_PAY_OVER_TIME ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::MB_WAY ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::MOBILEPAY ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::SOFORT ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::SWISH ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::TWINT ) );
Expand Down Expand Up @@ -496,6 +497,7 @@ private function can_auto_submit( $payment_method_type ) {
return \in_array(
$payment_method_type,
[
PaymentMethodType::MOBILEPAY,
PaymentMethodType::SWISH,
PaymentMethodType::UNIONPAY,
],
Expand Down
8 changes: 8 additions & 0 deletions src/PaymentMethodType.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ class PaymentMethodType {
*/
const MB_WAY = 'mbway';

/**
* Constant for the 'mobilepay' payment method type.
*
* @var string
*/
const MOBILEPAY = 'mobilepay';

/**
* Constant for the 'Multibanco' payment method type.
*
Expand Down Expand Up @@ -236,6 +243,7 @@ class PaymentMethodType {
PaymentMethods::KLARNA_PAY_OVER_TIME => self::KLARNA_ACCOUNT,
PaymentMethods::MAESTRO => self::MAESTRO,
PaymentMethods::MB_WAY => self::MB_WAY,
PaymentMethods::MOBILEPAY => self::MOBILEPAY,
PaymentMethods::PAYPAL => self::PAYPAL,
PaymentMethods::SOFORT => self::DIRECT_EBANKING,
PaymentMethods::SWISH => self::SWISH,
Expand Down