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

Send (type redirect) REST request with items #14

Open
hubertprein opened this issue Dec 14, 2016 · 5 comments
Open

Send (type redirect) REST request with items #14

hubertprein opened this issue Dec 14, 2016 · 5 comments

Comments

@hubertprein
Copy link

hubertprein commented Dec 14, 2016

The array with items are transformed into an instance of ItemBag, with a collection of items. When you fire the redirect RestPurchaseRequest, it is executed through Guzzle. Guzzle then falls over the ItemBag, since it's not an array which can't be added to the GET request. So it tries to add the object to the request and pops up with this error: rawurlencode() expects parameter 1 to be string, object given

@delatbabel
Copy link
Contributor

Can you submit a PR for this?

@hubertprein
Copy link
Author

@delatbabel Euhm, I'm not sure we're on the same page here. I don't have a fix available, so what pull request could I make?

@Swahjak
Copy link
Contributor

Swahjak commented Mar 16, 2017

@delatbabel Why doesn't RestPurchaseRequest just simply use the same logic as PurchaseRequest? I was quite surprised that this isn't implemented since it is a core omnipay feature (the ItemBag).

if ($items = $this->getItems()) {
    $itemsHtml = '<ul>';
    foreach ($items as $item) {
        $itemsHtml .= "<li>{$item['quantity']} x {$item['name']}</li>";
    }
    $itemsHtml .= '</ul>';
    $transaction->addChild('items', htmlspecialchars($itemsHtml));
}

@delatbabel
Copy link
Contributor

I'm actually not familiar enough with multisafepay to be able to answer that question. If you think that that code would resolve the issue then commit that, test it, and make a PR.

jeffreyzant added a commit to jeffreyzant/omnipay-multisafepay that referenced this issue Apr 11, 2017
@jeffreyzant
Copy link
Contributor

I just created a PR for this. :)

delatbabel added a commit that referenced this issue May 28, 2017
Send (type redirect) REST request with items #14
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

4 participants