Coder Social home page Coder Social logo

adyen / adyen-php-api-library Goto Github PK

View Code? Open in Web Editor NEW
151.0 19.0 102.0 5.59 MB

Adyen API Library for PHP

License: MIT License

PHP 99.78% Shell 0.01% Makefile 0.03% Mustache 0.18%
adyen adyen-api php payments payment-gateway payment-integration payment api-client api-library hacktoberfest

adyen-php-api-library's People

Contributors

acampos1916 avatar adyenautomationbot avatar aleffio avatar alexandrosmor avatar aprasker avatar candemiralp avatar cangelis avatar carlosperales95 avatar cyattilakiss avatar dependabot[bot] avatar djoykeabyah avatar fabricioblz avatar georgegg avatar jillingk avatar jocel1 avatar kadobot avatar lancergr avatar michaelpaul avatar msilvagarcia avatar peterojo avatar playmono avatar renovate-bot avatar renovate[bot] avatar rikterbeek avatar rkewlani avatar rvitaliy avatar soarecostin avatar szepeviktor avatar wboereboom avatar wilsonpinto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adyen-php-api-library's Issues

Error when using PreAuth on Terminal API (Cloud Sync)

PHP version: 7.2.24
Library version: 6.0.1
Description
I'm trying to PreAuth with the Terminal API (Cloud Sync https://docs.adyen.com/point-of-sale/pre-authorisation).

From documentation, if we add "authorisationType=PreAuth" to "SaleToAcquirerData" it should work. When we make this Request from Postman or own curl library, it works, but when using this library it does not work.
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!).

Then we receive a NonAuthorized error code.

Internal server error 500 using Boleto as payment method

PHP version: 7.2.13
Library version: 1.6.0
Environment: Using Docker for windows
Magento version: 2.3.0
Description

When I use boleto bancario as payment method the request response is:

AdyenLoggerTest.INFO: JSON Response is: {"status":500,"errorCode":"000","message":"HTTP Status Response - Internal server error","errorType":"internal"} {"is_exception":false} []
AdyenLoggerTest.ERROR: 000: HTTP Status Response - Internal server error {"is_exception":false} []

This error only appear inthis payment method, whe I use HPP the payment are processed correctly.

I'm debugging and I find that the error in the response is in this file:

<magento_base_dir>\src\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php

On the line 84:

list($result, $httpStatus) = $this->curlRequest($ch);

FYI

AdyenLoggerTest.INFO: Request url to Adyen: https://pal-test.adyen.com/pal/servlet/Payment/v40/authorise {"is_exception":false} []
AdyenLoggerTest.INFO: JSON Request to Adyen:
{
	"merchantAccount":"*****************",
	"shopperReference":"5",
	"shopperEmail":"*****@*******",
	"shopperIP":"******",
	"billingAddress":{
		"street":"Roque Petroni Jr",
		"postalCode":"04787910",
		"city":"Sa\u0303o Paulo",
		"houseNumberOrName":"",
		"stateOrProvince":"SP",
		"country":"BR"
	},
	"deliveryAddress":{
		"street":"Roque Petroni Jr",
		"postalCode":"04787910",
		"city":"Sa\u0303o Paulo",
		"houseNumberOrName":"",
		"stateOrProvince":"SP",
		"country":"BR"
	},
	"amount":{
		"currency":"BRL",
		"value":85779
	},
	"reference":"12000000049",
	"fraudOffset":"0",
	"browserInfo":{
		"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/72.0.3626.109 Safari\/537.36",
		"acceptHeader":"*\/*"
	},
	"enableOneClick":true,
	"enableRecurring":false,
	"socialSecurityNumber":"56861752509",
	"selectedBrand":"boletobancario_santander",
	"shopperName":{
		"firstName":"Jose\u0301","lastName":"Silva"
	},
	"deliveryDate":"2019-03-01T14:33:08 ",
	"applicationInfo":{
		"adyenLibrary":{
			"name":"adyen-php-api-library",
			"version":"1.6.0"
		},
		"adyenPaymentSource":{
			"version":"3.0.0",
			"name":"adyen-magento2"
		},
		"externalPlatform":{
			"version":"2.3.0",
			"name":"Magento"
		}
	}
} {"is_exception":false} []

Thx.

Cristian

when try payment with "Pay later with Klarna." using Drop-in method produce PHP Fatal error: Uncaught Adyen\AdyenException: ReflectiveOperationException java.util.List

PHP version: 7.2
Library version: 5.0
Description

When i try to make payment using "Pay later with Klarna" using /payment function then got error like,

Fatal error: Uncaught Adyen\AdyenException: ReflectiveOperationException java.util.List in C:\wamp64\www*******\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php on line 279

Is anyone got solution for this error?

Adyen 010 refused payment

Getting
( [errorType] => security [errorCode] => 010 [message] => Not allowed [pspReference] => 8614834610386710 [status] => 403 )

When trying to pay from : (I set correctly username and password with merchant account)

`$request = array(
"merchantAccount" => "XXXXX",
"amount.currency" => "EUR",
"amount.value" => "1990",
"reference" => "TEST-PAYMENT-" . date("Y-m-d-H:i:s"),
//"shopperIP" => "ShopperIPAddress",
"shopperEmail" => "[email protected]",
"shopperReference" => "12348",
"fraudOffset" => "0",

 	"card.billingAddress.street" => "Simon Carmiggeltstraat",
 	"card.billingAddress.postalCode" => "1011 DJ",
 	"card.billingAddress.city" => "Amsterdam",
 	"card.billingAddress.houseNumberOrName" => "6-50",
 	"card.billingAddress.stateOrProvince" => "",
 	"card.billingAddress.country" => "NL",

 	"card.expiryMonth" => "06",
 	"card.expiryYear" => "2018",
 	"card.holderName" => "John Smith",
 	"card.number" => "4111111111111111",
 	"card.cvc" => "004",
 	);
 
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, "https://pal-test.adyen.com/pal/servlet/Payment/v18/authorise");
 curl_setopt($ch, CURLOPT_HEADER, false); 
 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC  );
 curl_setopt($ch, CURLOPT_USERPWD, "ws@myCompany:myPassword");   
 curl_setopt($ch, CURLOPT_POST,1);
 curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($request));
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

 $result = curl_exec($ch);
 
 if($result === false)
 	echo "Error: " . curl_error($ch);
 else{
 	/**
	 * If the payment passes validation a risk analysis will be done and, depending on the
	 * outcome, an authorisation will be attempted. You receive a
	 * payment response with the following fields:
	 * - pspReference: The reference we assigned to the payment;
	 * - resultCode: The result of the payment. One of Authorised, Refused or Error;
	 * - authCode: An authorisation code if the payment was successful, or blank otherwise;
	 * - refusalReason: If the payment was refused, the refusal reason.
	 */ 

 	parse_str($result,$result);
 	echo "==== OUTPUT ";
 	print_r(($result));
 }
 
 curl_close($ch);`

Thank you

Adyen\ConfigInterface is missing functions

PHP version: all
Library version: 1.4.0
Description
The interface for the config object is missing, at least, the getEnvironment() function. It should be added if it's required to implement it (a service can't be created without it), an Exception is thrown (which, by the way, says corect instead of correct).

Support for Adyen MarketPay

Currenly looking at Adyen MarketPay, which seems quite interesting to be able to split incoming payments. However this API seems not to support this yet? Am I missing something, or is it scheduled to be supported?

Adyen - Unable to decrypt data

Am facing an issue as "Unable to decrypt data" when i try to authorize the payment.

I have used CSE method and generated the encrypted form data.

I have referred documentation from below url and send encrypted form value in card.encrypted.json. But am not sure what i am doing wrong. I have updated the username and password details from my WS user details.

http://adyen.github.io/adyen-php-api-library/payment.html
{
"amount": {
"value": 1499,
"currency": "GBP"
},
"reference": "payment-test",
"merchantAccount": "MY_MERCHANT_ACCOUNT",
"additionalData": {
"card.encrypted.json": "MY_ENCRYPTION_DATA"
}
}

API param's names inconsistency

PHP version: 7.2.19
Library version: 3.87.18
Description

$service = new Checkout(...);
$result = $service->payments(...);

This call returns array which contains data section which in turn contains MD, PaReq and TermUrl items. Then in case of RedirectShopper is should make "POST redirect" with that data section as POST params. And later on TermUrl call i will get MD and PaRes. And finally here in callback i should do next:

$service = new Payment(...);
$result = $service->authorise3D($params);

Where is $params contains those MD and PaRes. And in that case i get Configuration Problem mpiImplementation error becuse /authorise3d require md parameter but not MD.
Also it require paResponse but in TermUrl handler i got PaRes. Fortunately (or not) /authorise3d consume both.

P.S. Also if to change API_PAYMENT_VERSION from v40 to v49 (in Adyen\Client) it works well, but in documentation v46 is latest.

Could you keep your code, API and documentation consistent?

Unable to decrypt data

PHP version: 7.2.24
Library version: 4.2.0
Description
Hi,
I'm facing an "Unable to decrypt data" exception (status 422) while trying to integrate a card payment using secured fields, as described in the documentation:
https://docs.adyen.com/checkout/drop-in-web#step-2-add-drop-in

$paymentData = filter_input(INPUT_POST, 'payment_data');
$paymentMethod = json_decode($paymentData, true);

$result = $service->payments([
    "amount" => array(
      "currency" => "EUR",
      "value" => 1000
    ),
    "reference" => $order_key,
    "paymentMethod" => $paymentMethod['paymentMethod'],
    "returnUrl" => "http://{$_SERVER['HTTP_HOST']}/return.php",
    "merchantAccount" => $merchant_account
  ]);

In addition, the same problem is present testing the api with the api explorer:
https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v51/payments__example_payments-card-securedfields

Error code: 174. Unable to decrypt data.

{
  "status": 422,
  "errorCode": "174",
  "message": "Unable to decrypt data",
  "errorType": "validation"
}

Thanks for your support.
Massimo

010 Not allowed error

Hello I receive this error when using your code sample. Can you please advice where the problem might be the web service user I'm using has all the available permissions (see attached). Thank you in advance!
screen shot 2017-04-27 at 2 04 29 pm

Error Class Service\Payment

PHP version => 7.1.20
Library version => "adyen/php-api-library" : "1.5.0"

Hi, I installed the library via composer, and I try to create a payment request on Test with the sample code => but I receive an error : Class 'Service\Payment' not found. What can it be, can someone help me?

$client = new \Adyen\Client();
$client->setApplicationName("Adyen PHP Api Library Example");
$client->setUsername("YOUR USERNAME");
$client->setPassword("YOUR PASSWORD");
$client->setEnvironment(\Adyen\Environment::TEST);
$service = new Service\Payment($client);
$json = '{
"card": {
"number": "4111111111111111",
"expiryMonth": "6",
"expiryYear": "2016",
"cvc": "737",
"holderName": "John Smith"
},
"amount": {
"value": 1500,
"currency": "EUR"
},
"reference": "payment-test",
"merchantAccount": "YOUR MERCHANT ACCOUNT"
}';

$params = json_decode($json, true);
$result = $service->authorise($params);

screen shot 2018-09-21 at 17 23 42

countryCode is required for a DirectoryRequest

The manual states:

"All the fields mentioned in the request example (currencyCode, merchantAccount, paymentAmount, skinCode, merchantReference, sessionValidity and merchantSig), except countryCode, are mandatory."

However, the countryCode in the directoryRequest is set to mandatory. I've fixed it for now by giving it a value of 0, but it would be lovely to just supply the request with the right parameters.

How to get username and password

I have implemented this code and it's throwing error Fatal error: Uncaught Adyen\AdyenException: Invalid Merchant Account in C:\wamp64\www\xmiu\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php on line 279
Adyen\AdyenException: Invalid Merchant Account in C:\wamp64\www\xmiu\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php on line 279

Can anyone please tell me from where did I get the username and password.
==> $client->setUsername("YOUR USERNAME");
==> $client->setPassword("YOUR PASSWORD");

Is there any official Omnipay integration?

You can see that Omnipay has a lot of integrations.
https://omnipay.thephpleague.com/gateways/community/

Also it belongs to PHP League, what assures a high-quality code. And it's used by a lot of projects because it is compatible with a lot of payment processors.

But where is the official support for it?
I want to use Adyen with Laravel, and there is no way unless developing all my code, I think it can help Adyen to integrate with more projects as Omnipay is already there.

No status send in error exception

Error handling api docs says that every error response contains these data:

{
    "errorType" : "security",
    "errorCode" : "901",
    "message" : "Invalid Merchant Account",
    "status" : "403"
}

But in library method that handle this kind of errors (handleResultError in CurlClient) there are forwarded ONLY message and errorCode.

if(isset($decodeResult['message']) && isset($decodeResult['errorCode'])) {
    $logger->error($decodeResult['errorCode'] . ': ' . $decodeResult['message']);
    throw new \Adyen\AdyenException($decodeResult['message'], $decodeResult['errorCode']);
}

It would be a lot easier to handle errors if exceptions throws by "adyen-php-api-library" contains also status field.

Regards
Przemek

Market Pay Account/Fund ?

Hi there,

If I'm right, the package didn't manage the Market Pay Account/Fund services ?

Is it planned or should I extend the package on my own ?

Thanks in advance !

Keep getting 'Not allowed'

Hi,
I have a small problem, i keep getting this message :

AdyenException in CurlClient.php line 226:
Not allowed

The test payment is listed (with a psp ref) in my adyen.com test account but it's always 'not allowed'

Util/Util::calculateSha256Signature not valid for HMAC Notification signatures?

PHP version: 7.2.1
Library version: 1.5.0
Description

I'm trying to verify the HMAC signature provided by notifications, and thought I could use the util included in this library for that.

But it looks like that's not valid for notifications, as it uses a different signature format?

In particular, to get the right signature to be calculated, I needed to change these lines:

    // Sort the array by key using SORT_STRING order
    ksort($params, SORT_STRING);

    // Generate the signing data string
    $signData = implode(":", array_map($escapeval, array_merge(array_keys($params), array_values($params))));

To the following to (1) avoid it from messing up the order; in the calling code I'm constructing $params in the field order as defined in the documentation and (2) to not include the parameter key names into the $signData.

    // Sort the array by key using SORT_STRING order
    // Remove: ksort($params, SORT_STRING);

    // Generate the signing data string
    $signData = implode(":", array_map($escapeval, array_values($params)));

Is it expected that this utility can't be used for notifications or is this a bug?

Idempotency-Key support

PHP version: 7.0
Library version: 3.0.0
Description

  • please add support for the header Idempotency-Key: in the library

[PW-2782] Testing environment is incompatible with declared support php versions

Hi
i noticed what phpunit/phpunit: 9.1 support php: ^7.3 but this project declare support for php >= 5.3, i suppose that this environment are not covered by tests and that the support must been dropped.

Then, if support for old php version is dropped we can start to upgrade code base to typed properties and return types or this lib must rollback phpunit to support oldest php versions.
I suggest to drop old php versions, but it's code owner decision.

If you tell me how you prefer to move, I can help you solve the problem and prepare a PR.

Correction code

PHP version: > 5.6.0
Library version: @latest
Description

$client = new \Adyen\Client();
$client->setApplicationName("Adyen PHP Api Library Example");
$client->setUsername("YOUR USERNAME");
$client->setPassword("YOUR PASSWORD");
$client->setEnvironment(\Adyen\Environment::TEST);
//Add namespace to \Adyen
$service = new \Adyen\Service\Payment($client);

$json = '{
"card": {
"number": "4111111111111111",
"expiryMonth": "6",
"expiryYear": "2016",
"cvc": "737",
"holderName": "John Smith"
},
"amount": {
"value": 1500,
"currency": "EUR"
},
"reference": "payment-test",
"merchantAccount": "YOUR MERCHANT ACCOUNT"
}';

$params = json_decode($json, true);

$result = $service->authorise($params);

Throwing AdyenException for successful response

PHP version: 7.3
Library version: 6.0.1
Description

Adyen library is throwing the AdyenException for successful api results in transferFunds calls.

See the stacktrace.

Adyen\AdyenException: {"pspReference":"4215852201976584","resultCode":"Received","merchantReference":"RefundFee_4515852201309999"} in /tmp/vendor/adyen/php-api-library/src/Adyen/HttpClient/CurlClient.php:289
Stack trace:
#0 /tmp/vendor/adyen/php-api-library/src/Adyen/HttpClient/CurlClient.php(97): Adyen\HttpClient\CurlClient->handleResultError('{"pspReference"...', Object(Monolog\Logger))
#1 /tmp/vendor/adyen/php-api-library/src/Adyen/Service/AbstractResource.php(83): Adyen\HttpClient\CurlClient->requestJson(Object(Adyen\Service\Fund), 'https://cal-liv...', Array, NULL)
#2 /tmp/vendor/adyen/php-api-library/src/Adyen/Service/Fund.php(113): Adyen\Service\AbstractResource->request(Array)
#3 /var/task/app/Services/Adyen.php(161): Adyen\Service\Fund->transferFunds(Array)

Class 'Adyen\PrestaShop not found

PHP version: 17.2
Library version: last
Description
prestashop 1.6.1

sorry for my bad language

it is impossible to use the module for prestashop, after installing the composer I have several errors example line 1
Fatal error: Uncaught Error: Class 'Adyen\PrestaShop\service\Adyen\Helper\DataFactory' not found in modules/adyen/adyen.php:53 Stack trace: #0 [internal function]: Adyen->__construct() #1
so I log in ssh and I notice that in vendor / adyen / there is no prestashop directory as indicated by the error
'Adyen \ PrestaShop \ service \ Adyen \ Helper \ DataFactory', I already have to install more than one issue ever since it's the first time if you can help me

line 53

        $adyenHelperFactory = new \Adyen\PrestaShop\service\Adyen\Helper\DataFactory();
        $this->helper_data = $adyenHelperFactory->createAdyenHelperData(
            \Configuration::get('ADYEN_MODE'),
            _COOKIE_KEY_
        );

bug in script

PHP version: 1.4
Library version: 1.4
Description
i create a index.php at root and include vender folder autoload.php in it and when run throw Fatal error: Class 'Service\Payment' not found ,error please suggest me

Package update but no version released

We started getting an error on our tests because some public methods have been renamed from client on an update 8 days ago but no version was released for that changes, this is a BC break. We were hoping these changes would be in a 1.5.4, but instead the commit hash for 1.5.3 changed to a different one.

Do you follow semver?

Change: 5d8cad3#diff-abc460192ba028e993913c78030f5e15L231

Problem in screen shots:

image

image

CurlClient exception handling

In Adyen\HttpClient\CurlClient there are 2 private methods:

  • handleCurlError
  • handleResultError

They both returns the same exception: \Adyen\AdyenException
So there's no way to distinguish connection errors and "api result" errors (i.e that would allow to decide to retry payment or not.)

My proposal is to return two different exceptions:

  • \Adyen\ConnectionExceptionin handleCurlError
  • \Adyen\AdyenException in handleResultError

How to use it without composer?

Hi,

Would like to know how to use the SDK without composer. Can't find any include.php/autoload.php/includes.php. There is no clear documentation on this either. Please respond.

Could not verify Adyen's SSL certificate.

Hi,

I am getting the following error when i made request on my local to create payments.
Fatal error: Uncaught exception 'Adyen\AdyenException' with message 'Could not verify Adyen's SSL certificate. Please make sure that your network is not intercepting certificates. (Try going to https://pal-test.adyen.com/pal/servlet/Payment/v18/authorise in your browser.) If this problem persists, (Network error [errno 60]: SSL certificate problem: unable to get local issuer certificate)' in C:\xampp\htdocs\test\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php:210 Stack trace: #0 C:\xampp\htdocs\test\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php(74): Adyen\HttpClient\CurlClient->handleCurlError('https://pal-tes...', 60, 'SSL certificate...', Object(Monolog\Logger)) #1 C:\xampp\htdocs\test\vendor\adyen\php-api-library\src\Adyen\Service\AbstractResource.php(42): Adyen\HttpClient\CurlClient->requestJson(Object(Adyen\Service\Payment), 'https://pal-tes...', Array) #2 C:\xampp\htdocs\test\vendor\adyen\php-api-library\src\Adyen\Service\Payment.php(22): Adyen\Service\AbstractResource->request in C:\xampp\htdocs\test\vendor\adyen\php-api-library\src\Adyen\HttpClient\CurlClient.php on line 210

Here is the code which i am using to create payments

<?php error_reporting(E_ALL);
ini_set('display_errors', 1);
include 'vendor/autoload.php';
if(isset($_POST['adyen-encrypted-data']))
{
	echo 'test';
	$client = new \Adyen\Client();
	$client->setApplicationName("Adyen PHP Api Library Example");
	$client->setUsername("myusername");
	$client->setPassword("mypassword");
	$client->setEnvironment(\Adyen\Environment::TEST);

	$service = new Adyen\Service\Payment($client);

	$json = '{
			  "amount": {
			    "value": 1499,
			    "currency": "GBP"
			  },
			  "reference": "payment-test",
			  "merchantAccount": "mymerchantaccount",
			  "additionalData": {
			    "card.encrypted.json": "'.$_POST["adyen-encrypted-data"].'"
			  }
			}';

	$params = json_decode($json, true);

	$result = $service->authorise($params);
	var_dump($result);
}
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
<script type="text/javascript" src="https://test.adyen.com/hpp/cse/js/8214937568103526.shtml"></script>
	<form method="POST" action="pay.php" id="adyen-encrypted-form">
	    <input type="text" size="20" data-encrypted-name="number"/>
	    <input type="text" size="20" data-encrypted-name="holderName"/>
	    <input type="text" size="2" data-encrypted-name="expiryMonth"/>
	    <input type="text" size="4" data-encrypted-name="expiryYear"/>
	    <input type="text" size="4" data-encrypted-name="cvc"/>
	    <input type="hidden" value="<?php echo date('Y-m-d').'T'.date('H:i:s', time()).'000Z'; ?>"  data-encrypted-name="generationtime"/>
	    <input type="submit" value="Pay"/>
	</form>
	<script>
	// The form element to encrypt.
	var form = document.getElementById('adyen-encrypted-form');
	// See https://github.com/Adyen/CSE-JS/blob/master/Options.md for details on the options to use.
	var options = {};
	// Bind encryption options to the form.
	adyen.createEncryptedForm(form, options);
	</script>
</body>
</html> 

can you please let me know that what is the issue or i am missing something?

Invalid Card details or other Error codes produce PHP Fatal Error Uncaught exception 'Adyen\AdyenException'

If I create payments using your examples in a AJAX called PHP Script any error Message like "Invalid Card Details" or "request already processed or in progress", etc. will result in an Internal Server Error 500 and produce an PHP Fatal Error Uncaught exception 'Adyen\AdyenException' in php log file.

The specific line is 97 in CurlClient.php: Adyen\HttpClient\CurlClient->handleResultError(.....)

// result not 200 throw error
		if ($httpStatus != 200 && $result) {
			$this->handleResultError($result, $logger); 
		} elseif (!$result) {
			$this->handleCurlError($requestUrl, $errno, $message, $logger);
		}

If I comment "$this->handleResultError($result, $logger); " then I receive the full error JSON and can process the result.

Facing issue during installation - monolog/monolog 2.0.2

PHP version: PHP 7.2
Library version: ^6.0
Description
Facing issue during installation - monolog/monolog 2.0.2 with Laravel. Package requires a lower version of monolog and laravel is having higher version (conflict with version).

Fatal error: Class 'Adyen\TestCase' not found

I am trying to use php library but it giving me error "Fatal error: Class 'Adyen\TestCase' not found" I have tried all version but giving same issue.
I had tried it with xampp and wamp server and also with with live server where I have SSL installed
Please help me to resolve issue
I had tried to install library via composer to but is keep showing same

CurlClient using incorrect content-type?

PHP version: 7.0.27
Library version: 1.4.1
Description

When trying to call the DirectoryLookup service, I receive the following response:

Invalid Request
Unfortunately we were unable to process this request

Error: Skin null does not exist

(Note: these error messages are not visible on the live platform)

This also happens when i run the DirectoryLookupTest in PHPUnit.

I noticed that in the CurlClient.php class, the cURL request in requestPost() has a Content-Type of application/json.

        //Set the content type to application/json and use the defined userAgent
        $headers = array(
            'Content-Type: application/json',
            'User-Agent: ' . $userAgent
        );

Given that the postfields are being set using http_build_query:

curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));

I believe the Content-Type should be application/x-www-form-urlencoded instead of json. Making this change in CurlClient.php manually fixed the issue for me.

     //Set the content type to application/json and use the defined userAgent
        $headers = array(
            'Content-Type: application/x-www-form-urlencoded',
            'User-Agent: ' . $userAgent
        );

Can you please confirm?
(Note: these tests are skipped by default as no valid skin configuration is set in the repo)

Release schedule

Library version: 5.x.x
Description

Can you please share the release schedule so we can plan our releases accordingly as the library already released doesn't meet the official documentation?

Adyen\AdyenException: Not allowed?!

PHP version: 7.2
Library version: 1.5.4
Description
Im running the example code and getting Adyen\AdyenException: Not allowed.

Under transactions dashboard I can see that the transaction is there with the status "Rejected".

Can anyone help me in this case?! Or is this by design?!

Thank you

Monolog conflict using 'composer require'

New API looks great, would love to integrate this. However when I try to install via the composer require adyen/php-api-library there seems to be a conflict with the monolog versioning.... It's tiny but annoying, would rather not fork, would it be as simple as updating your composer.json as per this commit from @rikterbeek ?

Here is the error:

composer require adyen/php-api-library
(....processing ..... )

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Can only install one of: monolog/monolog[1.18.0, 1.16.0].
- Can only install one of: monolog/monolog[1.16.0, 1.18.0].
- Can only install one of: monolog/monolog[1.16.0, 1.18.0].
- adyen/php-api-library 1.0.0 requires monolog/monolog 1.16.0 -> satisfiable by monolog/monolog[1.16.0].
- Installation request for adyen/php-api-library ^1.0 -> satisfiable by adyen/php-api-library[1.0.0].
- Installation request for monolog/monolog == 1.18.0.0 -> satisfiable by monolog/monolog[1.18.0].

Installation failed, reverting ./composer.json to its original content.

Composer tries to install the master 1.0.0 branch, so I'm not sure if the #1 which is not yet pushed to the release version will fix this? If so, when would you update to a new release? thank you!

Please supply paymentDetails when using recurring payment library

I am using recurring payment to add customer card on Adyen with the help of given code which is

            $client = new \Adyen\Client();
            $client->setApplicationName("");
            $client->setUsername("");
            $client->setPassword("");
            $client->setEnvironment(\Adyen\Environment::TEST);
             $service = new \Adyen\Service\Payment($client);
             $recurring = array('contract' => \Adyen\Contract::RECURRING);
             $amount = array(
                "value" => 2400,
                "currency"=> "EUR"
             );
             $request = array(
                "selectedRecurringDetailReference" => "LATEST",
                "merchantAccount" => "",
                "amount" => $amount,
                "reference" => "recurring",
                "card" => $data['adyen-encrypted-data'],
                "shopperEmail" => "[email protected]",
                "shopperReference" => "TheShopperreference",
                "recurring" => $recurring['contract'],
                "shopperInteraction" => "ContAuth"
             );
             $result = $service->authorise($request);
             print_r("Payment Result:\n");
             print_r("- pspReference: " . $result['pspReference'] . "\n");
             print_r("- resultCode: " . $result['resultCode']. "\n");
             print_r("- authCode: " . $result['authCode']. "\n");
             print_r("- refusalReason: " . $result['refusalReason']. "\n");

it say's Please supply paymentDetails I am using CSE on client side.

Invalid PayWithGoogle token

PHP version:5.5.9
Library version: 1
Description

  • After go live I got error :Invalid PayWithGoogle token.. Other payment methods working fine.

Constant names for directory lookup on Client

PHP version: all
Library version: 1.4.0
Description
A bit of a nitpick, but the constant names for the directory lookup on the Client class are missing the D on ENDPOINT.

ENPOINT_TEST_DIRECTORY_LOOKUP and ENPOINT_LIVE_DIRECTORY_LOOKUP.

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.