Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

How to create Payments instance with array $data argument? #37

Open
papajin opened this issue Oct 24, 2019 · 0 comments
Open

How to create Payments instance with array $data argument? #37

papajin opened this issue Oct 24, 2019 · 0 comments

Comments

@papajin
Copy link

papajin commented Oct 24, 2019

Seems like the following way of creating a Payments instance doesn't work:
$data = [
"operation" => "Purchase",
"intent" => "Authorization"
];
$payment = new PayEx\Api\Service\Payment\Request\Payments( $data );
I believe, this is because in \src\PayEx\Api\Service\Request (parent class) in the constructor the $data is sent as a first and only argument (in case if $data is array or string):
$this->setRequestResource($this->resourceFactory->newRequestResource($data));
while newRequestResource method of PayEx\Api\Service\ResourceFactory class expects 3 optional arguments, where $data is the last one:
public function newRequestResource($service = '', $resource = '', $data = [])

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

No branches or pull requests

1 participant