pronamic / wp-pronamic-pay-buckaroo

Buckaroo driver for the WordPress payment processing library.
http://www.wp-pay.org/gateways/buckaroo/
3 stars 2 forks source link

Error "No valid subscription found for service `amex`" #5

Closed rvdsteege closed 2 years ago

rvdsteege commented 2 years ago

I just came across the following errors with a Buckaroo account for which the American Express card brand is not active, when using the credit card payment method:

Message
    Multiple primary actions specified. Please specify 1 primary action.
Message
    No valid subscription found for service 'amex'.

This is caused by the fact that we're always including amex as a service for the credit card payment method on payment start:

https://github.com/pronamic/wp-pronamic-pay-buckaroo/blob/4967b4c271ef97f0cd4feb4d58eb99782b668399/src/Gateway.php#L313-L339

To check if a brand is available for a Buckaroo account, we could use the following endpoints:

In case a brand is not available, the response will be something like:

{
    "SupportedCurrencies": null,
    "Actions": null,
    "Name": "Service Not Found!",
    "Version": 0,
    "Description": null
}

Internal Help Scout ticket: https://secure.helpscout.net/conversation/2006986721/24458

rvdsteege commented 2 years ago

ℹ️ POST to transaction/specifications with body {} results in all available services.