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

Expired Adaptive Payment Method is Considered for Paypal Payouts #5988

Closed
SudharakaP opened this issue Sep 22, 2022 · 3 comments · Fixed by opencollective/opencollective-api#7976
Assignees
Labels
api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) bug complexity → simple

Comments

@SudharakaP
Copy link
Member

This is with regard to the freshdesk ticket; https://opencollective.freshdesk.com/a/tickets/119662.

It seems that the user has disabled PayPal payouts in host settings but still users are able to submit expenses with PayPal as payout method. The reason behind this seems to be that we also consider if the host has adaptive PayPal payout methods as per,

https://github.com/opencollective/opencollective-api/blob/871e29c37bd2eb274186f336b50c969fb6625c7e/server/graphql/v2/object/Host.js#L262-L270

However in the getPaymentMethod method we incorrectly use endDate instead of expiryDate to check if the payment method has expired.

@Betree
Copy link
Member

Betree commented Sep 24, 2022

It seems that the user has disabled PayPal payouts in host settings but still users are able to submit expenses with PayPal as payout method. The reason behind this seems to be that we also consider if the host has adaptive PayPal payout methods as per,

https://github.com/opencollective/opencollective-api/blob/871e29c37bd2eb274186f336b50c969fb6625c7e/server/graphql/v2/object/Host.js#L262-L270

@SudharakaP we support two APIs for paying expenses with PayPal:

It is expected that we keep showing PayPal as a payout method if Payout is disabled but adaptive is still connected.

@SudharakaP
Copy link
Member Author

It seems that the user has disabled PayPal payouts in host settings but still users are able to submit expenses with PayPal as payout method. The reason behind this seems to be that we also consider if the host has adaptive PayPal payout methods as per,
https://github.com/opencollective/opencollective-api/blob/871e29c37bd2eb274186f336b50c969fb6625c7e/server/graphql/v2/object/Host.js#L262-L270

@SudharakaP we support two APIs for paying expenses with PayPal:

* Adaptive: the legacy one, that we want to deprecate [Remove PayPal adaptive #5923](https://github.com/opencollective/opencollective/issues/5923)

* Payout: the latest integration, currently in beta but that we want as default

It is expected that we keep showing PayPal as a payout method if Payout is disabled but adaptive is still connected.

Thanks for the information. But my understanding is that the for the adaptive method the details are stored in PaymentMethods table. Now there's an expiry date. But we check for endDate instead which doesn't exist in the PaymentMethods table.

@Betree
Copy link
Member

Betree commented Sep 29, 2022

@SudharakaP Yes, this endDate check is indeed wrong and has no effect. According to opencollective/opencollective-api#1011, the field did not exist either when the check was first introduced. We can eventually fix it by using expiryDate if we feel it's the right thing to do.

If we want to solve the mentioned support ticket quickly an option can be to mark their PayPal adaptive payment method as deleted. As a long-term fix, we can also add this ability in the frontend for host admins; but I would not invest in that given that we plan to get rid of PayPal adaptive in the near future (#5923)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues that require some work on the API (https://github.com/opencollective/opencollective-api) bug complexity → simple
Projects
Status: ✅ Done
2 participants