Skip to content

Conversation

@firstred
Copy link

This PR adds the missing PaymentData object.

Not sure if the tokenize property should be added, but it is described on the payment components page (step 3): https://archive.is/wjc5D
It is missing from the API reference, though (Body Params: Payment Component): https://docs.multisafepay.com/reference/createorder

@vinodsowdagar
Copy link
Member

Hi @firstred ,

Thank you for your contribution. We are currently looking into it and will provide an update later.

@vinodsowdagar
Copy link
Member

Hi @firstred ,

The changes look good, we are going to include them in the next release.

This is a welcome change that makes it easier to add the payment_data object to the OrderRequest, but did you know there is a different way to add this?

The OrderRequest object extends from the RequestBody object.
https://github.com/MultiSafepay/php-sdk/blob/master/src/Api/Transactions/OrderRequest.php#L35

The RequestBody object extends from the DataObject object.
https://github.com/MultiSafepay/php-sdk/blob/master/src/Api/Base/RequestBody.php#L15C7-L15C18

In the DataObject there is a method called addData();
https://github.com/MultiSafepay/php-sdk/blob/master/src/Api/Base/DataObject.php#L13

use MultiSafepay\Api\Transactions\OrderRequest;

$orderRequest = new OrderRequest();
$orderRequest->addData( 
  array( 'payment_data' => [...] )
);

We will come back to you when the release has been done with your suggested improvements.

@firstred
Copy link
Author

Thanks for your reply and looking into it!

I wasn't aware that it was possible to add additional data, I expected that it would be filtered out. Great as a workaround for now, thanks!

I'll have a look at the code style and make the necessary changes.

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

Successfully merging this pull request may close these issues.

2 participants