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

Remove Riverty (formerly AfterPay) because Rabobank no longer support… #30

Merged
merged 2 commits into from
Nov 28, 2023
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
53 changes: 0 additions & 53 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
use Pronamic\WordPress\Pay\Core\PaymentMethods;
use Pronamic\WordPress\Pay\Core\PaymentMethodsCollection;
use Pronamic\WordPress\Pay\Fields\CachedCallbackOptions;
use Pronamic\WordPress\Pay\Fields\DateField;
use Pronamic\WordPress\Pay\Fields\IDealIssuerSelectField;
use Pronamic\WordPress\Pay\Fields\SelectField;
use Pronamic\WordPress\Pay\Fields\SelectFieldOption;
use Pronamic\WordPress\Pay\Payments\Payment;
use Pronamic\WordPress\Pay\Refunds\Refund;
Expand Down Expand Up @@ -87,47 +85,6 @@ function () {

$ideal_payment_method->add_field( $ideal_issuer_field );

/*
* Payment method AfterPay.nl.
*/
$afterpay_payment_method = new PaymentMethod( PaymentMethods::AFTERPAY_NL );

// Gender field.
$field_gender = new SelectField( 'pronamic_pay_gender' );

$field_gender->meta_key = 'gender';

$field_gender->set_label( \__( 'Gender', 'pronamic_ideal' ) );

$field_gender->set_options(
[
new SelectFieldOption( Gender::FEMALE, \__( 'Female', 'pronamic_ideal' ) ),
new SelectFieldOption( Gender::MALE, \__( 'Male', 'pronamic_ideal' ) ),
new SelectFieldOption( '', \__( 'Other', 'pronamic_ideal' ) ),
]
);

$afterpay_payment_method->add_field( $field_gender );

// Date of birth field.
$field_birth_date = new DateField( 'pronamic_pay_birth_date' );

$field_birth_date->meta_key = 'birth_date';

$field_birth_date->set_label( \__( 'Date of birth', 'pronamic_ideal' ) );

$afterpay_payment_method->add_field( $field_birth_date );

$this->register_payment_method( $afterpay_payment_method );

// Riverty.
$riverty_payment_method = new PaymentMethod( PaymentMethods::RIVERTY );

$riverty_payment_method->add_field( $field_gender );
$riverty_payment_method->add_field( $field_birth_date );

$this->register_payment_method( $riverty_payment_method );

// Payment methods.
$this->register_payment_method( new PaymentMethod( PaymentMethods::BANCONTACT ) );
$this->register_payment_method( new PaymentMethod( PaymentMethods::CREDIT_CARD ) );
Expand Down Expand Up @@ -393,16 +350,6 @@ public function start( Payment $payment ) {
// Description.
$description = $line->get_description();

if ( empty( $description ) && PaymentBrands::AFTERPAY === $payment_brand ) {
/*
* The `OrderItem.description` field is documented as `0..1` (optional),
* but for AfterPay payments it is required.
*
* @link https://github.com/wp-pay-gateways/omnikassa-2/tree/feature/post-pay/documentation#error-5024
*/
$description = $name;
}

if ( null !== $description ) {
$description = DataHelper::sanitize_an( $description, 100 );
}
Expand Down
11 changes: 0 additions & 11 deletions src/PaymentBrands.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ class PaymentBrands {
*/
const IDEAL = 'IDEAL';

/**
* Payment brand 'AFTERPAY'.
*
* Note: this is for AfterPay (afterpay.nl) and not for Afterpay (afterpay.com).
*
* @var string
*/
const AFTERPAY = 'AFTERPAY';

/**
* Payment brand 'PAYPAL'.
*
Expand Down Expand Up @@ -104,14 +95,12 @@ class PaymentBrands {
* @var array<string, string>
*/
private static $map = [
PaymentMethods::AFTERPAY_NL => self::AFTERPAY,
PaymentMethods::BANCONTACT => self::BANCONTACT,
PaymentMethods::CREDIT_CARD => self::CARDS,
PaymentMethods::IDEAL => self::IDEAL,
PaymentMethods::MAESTRO => self::MAESTRO,
PaymentMethods::MASTERCARD => self::MASTERCARD,
PaymentMethods::PAYPAL => self::PAYPAL,
PaymentMethods::RIVERTY => self::AFTERPAY,
PaymentMethods::SOFORT => self::SOFORT,
PaymentMethods::VISA => self::VISA,
PaymentMethods::V_PAY => self::V_PAY,
Expand Down
Loading