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

Error: 308 (BAD_PAYMENTMETHOD) #90

Open
timint opened this issue Jul 12, 2021 · 5 comments
Open

Error: 308 (BAD_PAYMENTMETHOD) #90

timint opened this issue Jul 12, 2021 · 5 comments

Comments

@timint
Copy link

timint commented Jul 12, 2021

Testing direct bank finland I can access the payment page with usePayPageDirectBankOnly() rather than setting the bank.

image

But clicking the Nordea icon in the payment gateway immediately throws the customer back to the store with a response error:

object(Svea\WebPay\HostedService\HostedResponse\HostedPaymentResponse)#194 (9) {
  ["transactionId"]=> string(0) ""
  ["clientOrderNumber"]=> string(0) ""
  ["paymentMethod"]=> string(0) ""
  ["merchantId"]=> string(0) ""
  ["amount"]=> string(4) "0.00"
  ["currency"]=> string(0) ""
  ["accepted"]=> int(0)
  ["resultcode"]=> string(23) "308 (BAD_PAYMENTMETHOD)"
  ["errormessage"]=> string(33) "Invalid value for payment method."
}

How do I resolve this?

@timint
Copy link
Author

timint commented Jul 13, 2021

@alexanderwiden95 Any news on this one?

@alexanderwiden95
Copy link
Collaborator

Hi,

Since the action is made on Svea's webpage the issue is more related to their service rather than the SDK. I've contacted the product owner at Svea to get some clarification. They will reach out to you with more information

@timint
Copy link
Author

timint commented Jul 14, 2021

Okay. Just to clearify, this one uses usePayPageDirectBankOnly().
While Issue #89 uses Nordea FI as the preselected gateway.

timint added a commit to timint/sveawebpay-php-integration that referenced this issue Jul 27, 2021
timint added a commit to timint/sveawebpay-php-integration that referenced this issue Jul 27, 2021
timint added a commit to timint/sveawebpay-php-integration that referenced this issue Aug 26, 2021
…08 BAD_PAYMENTMETHOD

(cherry picked from commit 0ba57d3)
@alexanderwiden95
Copy link
Collaborator

Hi,

We're unable to reproduce the error following the code at #89 (but using usePayPageDirectBankOnly instead of usePaymentMethod). Could you provide us with some sample code that triggers this error?

@timint
Copy link
Author

timint commented Sep 6, 2021

        $response = $swp->usePayPageDirectBankOnly()
                    ->setPayPageLanguage($order->data['language_code'])
                    ->setReturnUrl(document::ilink('order_process'))
                    ->setCancelUrl(document::ilink('checkout'))
                    ->getPaymentUrl();

Let me explain how this works. The API does not have a DirectBankOnly option. So to do this, the library adds all the methods possible and removes some handpicked ones. Because some of the methods no longer available in the api are still available in the library the user receives an error.

Removing the no longer availabe options is the short term solution. Asking the API crew not to throw an error if an excluded option is already removed could ease the pain. But everytime a new method is added to the library, it will need to be excluded in DirectBankOnly.

The long term solution is that Svea implements an option for directbank only in the API. I think you should escalate this back to the API developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants