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 support for in3 payment method #12

Closed
rvdsteege opened this issue Jun 19, 2023 · 2 comments · Fixed by #14
Closed

Add support for in3 payment method #12

rvdsteege opened this issue Jun 19, 2023 · 2 comments · Fixed by #14

Comments

@rvdsteege
Copy link
Member

From customer:

De in3 betaalmethode is geselecteerd in Mollie, deze is ook voor een aantal formulieren in GravityForms te selecteren maar in Memberpress krijgen we helaas de payment gateway niet te zien.

Klopt het dat dit nog niet mogelijk is? Zo ja wanneer zou dit wel mogelijk zijn?
Zo nee, kunnen jullie een oplossing geven hoe dit wel te integreren is in Memberpress?

Simply adding the in3 payment method to MemberPress currently results in the following gateway error message:

ERROR: Unprocessable Entity - The payment method does not support recurring type

If we don't set support for the subscription capabilities in MemberPress (like create-subscriptions) for a payment method, should we then still continue to try to add a subscription to the payment?

// Capabilities.
$gateway = Plugin::get_gateway( (int) $this->get_config_id() );
if ( null !== $gateway ) {
$capabilities = [ 'process-payments' ];
$payment_method = $gateway->get_payment_method( (string) $this->payment_method );
if ( null !== $payment_method && $payment_method->supports( 'recurring' ) ) {
$capabilities = \array_merge(
$capabilities,
[
'create-subscriptions',
'cancel-subscriptions',
'update-subscriptions',
'subscription-trial-payment',
]
);
}
if ( $gateway->supports( 'refunds' ) ) {
$capabilities[] = 'process-refunds';
}
}

/**
* Subscription.
*/
$subscription = self::get_subscription( $memberpress_transaction );
if ( $subscription ) {
$period = $subscription->new_period();
if ( null === $period ) {
throw new \Exception( 'Could not create new period for subscription.' );
}
$payment->add_period( $period );
}

Internal Help Scout ticket: https://secure.helpscout.net/conversation/2275733463/25784

CC: @remcotolsma

@remcotolsma
Copy link
Member

I think this is MemberPress territory and we have the next MemberPress issue open for that (not yet reported to MemberPress itself as far as I know):

If we don't set support for the subscription capabilities in MemberPress (like create-subscriptions) for a payment method, should we then still continue to try to add a subscription to the payment?

I think so, for recurring memberships we also want users/administrators to see the error message:

ERROR: Unprocessable Entity - The payment method does not support recurring type

@rvdsteege
Copy link
Member Author

Ah, I think I missed the one-time membership option. in3 works fine in that case and the error message is indeed correct then for recurring memberships. I created PR #14 to add the in3 payment method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants