Coder Social home page Coder Social logo

Comments (4)

cyattilakiss avatar cyattilakiss commented on August 15, 2024

Hi @alex-grau ,

Thank you for opening the issue. Could you please send us the object (with masked sensitive data) you send in the library request?

Debugging code we see that Adyen\Service\AbstractResource changes this field on the method handleApplicationInfoInRequestPOS, it adds: "applicationInfo":{"adyenLibrary":{"name":"adyen-php-api-library","version":"6.0.1"}} and changes format to base64encoded json (without urlencode!).

Adding the applicationInfo is an expected behaviour also reformatting should be fine but maybe there is a mismatch in that.

Thank you in advance,
Attila
Adyen

from adyen-php-api-library.

AlexandrosMor avatar AlexandrosMor commented on August 15, 2024

Hello @alex-grau,

Do you have any updates about the issue? Are you still able to send us the object that you send in the library request so we can investigate it further?

kind regards,
Alexandros

from adyen-php-api-library.

cyattilakiss avatar cyattilakiss commented on August 15, 2024

Hi @alex-grau ,

Due to inactivity I am closing this issue but please feel free to reopen it in case the issue is still there.

Best,
Attila
Adyen

from adyen-php-api-library.

alex-grau avatar alex-grau commented on August 15, 2024

Hello! Sorry, I was out and not using this library again, until today (and the error still exists, at least for me). The problem is using \Adyen\Service\PosPayment($client);

This is the current code:

$adyenClient = new Adyen\Client();
$adyenClient->setApplicationName($applicationName);
$adyenClient->setXApiKey($apiKey);
$adyenClient->setMerchantAccount($accountId);
$adyenClient->setEnvironment(Adyen\Environment::TEST);

$request = [
'SaleToPOIRequest' => [
'MessageHeader' => [
'ProtocolVersion' => '3.0',
'MessageClass' => 'Service',
'MessageCategory' => 'Payment',
'MessageType' => 'Request',
'SaleID' => $serialNumber,
'ServiceID' => '' . (string)rand(1000000, 9000000) . '',
'POIID' => $serialNumber
],
'PaymentRequest' => ['SaleData' => [
'SaleTransactionID' => [
'TransactionID' => (string)rand(1234, 5678),
'TimeStamp' => (new DateTime())->format(DateTime::ATOM)
],
'SaleToAcquirerData' => 'authorisationType=PreAuth'
],
'PaymentTransaction' => [
'AmountsReq' => [
'Currency' => 'USD',
'RequestedAmount' => 150.00
],
]
]
]
];

$service = new Adyen\Service\PosPayment($adyenClient);

$response = $service->runTenderSync($request);

var_dump($response);

Response.result is "Failure" because it seems that I don't have permisions, BUT, I receive an additional warning in AdditionalResponse: "eyAid2FybmluZ3MiOiAiQXQgU2FsZVRvUE9JUmVxdWVzdCwgZmllbGQgbWVyY2hhbnRBY2NvdW50OiBVbmV4cGVjdGVkIiwgIm1lc3NhZ2UiOiAiU2FsZSB0byBBY3F1aXJlciBEYXRhOiBOb3RBbGxvd2VkIFZhbHVlOiBleHRyYSBkYXRhLCBSZWFzb246IEZhaWxlZCB2YWxpZGF0aW9uIiB9", it means "{ "warnings": "At SaleToPOIRequest, field merchantAccount: Unexpected", "message": "Sale to Acquirer Data: NotAllowed Value: extra data, Reason: Failed validation" }"

But I haven't added that "merchantAccount" on the SaleToPOIRequest. I checked the library and it's on the Adyen\Service\AbstractResource:122, inside addDefaultParametersToRequest method.

from adyen-php-api-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.