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

Missing support of create checkout with merchant_code #28

Open
ptrovatelli opened this issue Jul 13, 2021 · 2 comments
Open

Missing support of create checkout with merchant_code #28

ptrovatelli opened this issue Jul 13, 2021 · 2 comments

Comments

@ptrovatelli
Copy link

Hello,
According to the SDK documentation (https://developer.sumup.com/docs/php-sdk/), the checkout needs creating with :

$checkoutResponse = $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail);

However, according to the rest API, using the payToEmail field is discouraged and the mandatory merchant_code field should be used instead when creating checkouts: see https://developer.sumup.com/rest-api/#tag/Checkouts/paths/~1checkouts/post

pay_to_email | string <email>  Email address of the registered user (merchant) to whom the payment is made. It is highly recommended to use merchant_code instead of pay_to_email.

Looking at the SDK source code, there's no way to use merchant_code. See https://github.com/sumup/sumup-ecom-php-sdk/blob/master/src/SumUp/Services/Checkouts.php

public function create($amount, $currency, $checkoutRef, $payToEmail, $description = '', $payFromEmail = null, $returnURL = null)
    {

How bad is it to use payToEmail? Shouldn't the sdk evolve to take into account the API specifications?
Thanks!

@multikitty
Copy link

You can use $customService->request($method, $relativePath, $payload); instead of $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail);

@AInteriorB
Copy link

Same question 3 years later 🧠

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

3 participants