paylinebymonext / payline-php-sdk Goto Github PK
View Code? Open in Web Editor NEWPayline PHP SDK
Home Page: http://www.payline.com
License: GNU Lesser General Public License v3.0
Payline PHP SDK
Home Page: http://www.payline.com
License: GNU Lesser General Public License v3.0
Is there a way to easily override the SoapClient used by the SDK ?
$client = new SoapClient(dirname(__FILE__) . '/' . PaylineSDK::WSDL, $this->soapclient_options); $client->__setLocation($this->webServicesEndpoint . $PaylineAPI);
I need to use my own SoapClient connector.
Can you concider to a setClient(SoapClient $client) to the SDK ?
Your library forces installation of monolog v2.
Can you please installation of monolog v3?
Thank you
Bonjour, depuis peu la page de redirection de doWebPayment ne marche plus
(https://webpayment.payline.com/v2/?token=1IdSqIykTRKrbU2796151573656127505)
La page web affiche "Une erreur est survenue, veuillez réessayer."
Le serveur renvoi Erreur 500 sur l'URL (en ajax)
https://payment.payline.com/services/token/1IdSqIykTRKrbU2796151573656127505/state/current
Est-il possible d'avoir un message d'erreur plus détaillé
Hello
As we have an weird issues with some refunds (randomly "XXXXX : Error Fetching http headers"), Payline support team asks us to use v4.62 ( in production for a few days http://status.payline.com/incidents/ws9l6qpgjqrs ) to see if the issue is due to difference between the wsdl we use and the wsdl in production.
Have you planned to upgrade the PHP SDK soon?
Thanks for your feedback
Regards
Nicolas
Hello ,
when clicking Presto method , i get the same error , i change doWebPayment as mentionned but not working
` public function doWebPayment(array $array)
{
$this->formatRequest($array);
$WSRequest = array(
'payment' => $this->payment($array['payment']),
'returnURL' => $array['returnURL'],
'cancelURL' => $array['cancelURL'],
'order' => $this->order($array['order']),
'notificationURL' => $array['notificationURL'],
'customPaymentTemplateURL' => $array['customPaymentTemplateURL'],
'selectedContractList' => $array['contracts'],
'secondSelectedContractList' => $array['secondContracts'],
'privateDataList' => $this->privateData,
'languageCode' => $array['languageCode'],
'customPaymentPageCode' => $array['customPaymentPageCode'],
'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']),
'owner' => $this->owner($array['owner'], $array['ownerAddress']),
'securityMode' => $array['securityMode'],
'contractNumberWalletList' => $array['walletContracts'],
'merchantName' => $array['merchantName']
);
if (isset($array['payment']['mode'])) {
if (($array['payment']['mode'] == "REC") || ($array['payment']['mode'] == "NX")) {
$WSRequest['recurring'] = $this->recurring($array['recurring']);
}
}
return $this->webServiceRequest($array, $WSRequest, PaylineSDK::WEB_API, 'doWebPayment');
}`
Bonjour
L'exemple donnée en page d'accueil ne permet pas de récupérer les informations liés à l'order:
use Payline\PaylineSDK;
include "./include.php";
// INITIALIZE
$array = array();
$paylineSDK = new PaylineSDK(
$_SESSION['MERCHANT_ID'],
$_SESSION['ACCESS_KEY'],
$_SESSION['PROXY_HOST'],
$_SESSION['PROXY_PORT'],
$_SESSION['PROXY_LOGIN'],
$_SESSION['PROXY_PASSWORD'],
$_SESSION['ENVIRONMENT'],
$_SESSION['LOG_PATH'],
$_SESSION['LOG_LEVEL']
);
$getWebPaymentDetailsRequest = array();
$getWebPaymentDetailsRequest['token'] = $_GET['token']; // web payment session unique identifier
$getWebPaymentDetailsResponse = $paylineSDK->getWebPaymentDetails($getWebPaymentDetailsRequest);
print_r($getWebPaymentDetailsResponse);
Ci dessous la réponse:
{
"result": {
"code": "00000",
"shortMessage": "ACCEPTED",
"longMessage": "Transaction approved"
},
"transaction": {
"id": "28346175217678",
"date": "12\/12\/2018 17:52",
"isDuplicated": "0",
"isPossibleFraud": "0",
"fraudResult": "",
"explanation": "",
"threeDSecure": "N",
"score": "0"
},
"payment": {
"amount": "990",
"currency": "978",
"action": "101",
"mode": "CPT",
"contractNumber": "1234567",
"differedActionDate": ""
},
"authorization": {
"number": "A55A",
"date": "12\/12\/2018 17:52"
},
"privateDataList": {
"privateData": [
{
"key": "cartId",
"value": "4"
},
{
"key": "storeId",
"value": "1"
}
]
},
"authentication3DSecure": {
"md": null,
"xid": null,
"eci": null,
"cavv": null,
"cavvAlgorithm": null,
"vadsResult": null
}
}
Aucune information sur le détail de la commande alors qu'avec l'outil de demo du SDK je vois bien les informations de l'order....
Faut il ajouter un autre paramètre pour obtenir cette information?
Hello
Warning à la ligne 856 du fichier /../modules/payline/lib/monext/payline-sdk/src/Payline/PaylineSDK.php
[2] count(): Parameter must be an array or an object that implements Countable
Same as #30 on this file.
mcrypt is DEPRECATED in PHP 7.1.0, and REMOVED in PHP 7.2.0
http://php.net/manual/en/intro.mcrypt.php
used in PaylineSDK::getEncrypt()
and PaylineSDK::getDecrypt()
Nous rencontrons un erreur sur le format du retour du service de getCards. La valeur du champs cardList.cards était auparavant un tableau (de tableau associatif), c'est désormais un tableau associatif.
Cela n'est pas conforme à la documentation: https://payline.atlassian.net/wiki/spaces/DT/pages/1452180199/Webservice+-+getCardsResponse
Ci-joint un exemple de réponse reçu sur la version 4.49 et un exemple de réponse sur la version 4.59
new_response.txt
old_response.txt
Am running version 4.59.5
and I get this error when am running on php7.4
file: "/monext/payline-sdk/src/Payline/PaylineSDK.php"
line: 2472
message: "array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead"
Is there a version that supports php7.4?
Hello,
In the verifyEnrollment call, in threeDSInfo object, the field challengeWindowSize can be fill (cf doc: https://payline.atlassian.net/wiki/spaces/DT/pages/1437303489/Object+-+threeDSInfo)
but the field doesn't appear in v4.59.wsdl and not in ThreeDSInfo.php neither
Calling date_default_timezone_set
set the timezone for all datetimes in the script. after the PaylineSdk has been initialized.
It seems that the only purpose of that is to get the date in the log file name
As date does not accept a timezone as a parameter, you can use the DateTime
object, compatible with PHP >= 5.2 (which is lower than your PHP requirement).
Your library forces installation of monolog v1.
Can you please installation of monolog v2?
Thank you
It is impossible to make an information request.
By setting the amount to null and the action code to 108, the answer is: Invalid field format: Payment Currency: Must be numeric(3), ex: 978
When removing the line the return is the same.
To fix the problem, delete in the 4.59 wsdl line 1942 the "nillable="true""
V4.68 Introduced a dependency to symfony/cache: ^3.4 which is an old version and not compatible with the latest laravel version v8.x, could this dependency be adjusted to allow up to v6
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/cache[v3.4.0-BETA1, ..., 3.4.x-dev] require psr/log ~1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list
it as an argument for the update command.
- monext/payline-sdk 4.68 requires symfony/cache ^3.4 -> satisfiable by symfony/cache[v3.4.0-BETA1, ..., 3.4.x-dev].
- Root composer.json requires monext/payline-sdk ^4.68 -> satisfiable by monext/payline-sdk[4.68].
Hi,
I'm reading the doc but don't figure out how to switch a card's default status, something fast like the enableWallet/disabledWallet functions ?
Too few arguments to function Payline\PaylineSDK::buildSoapObject(), 2 passed in
(...)/vendor/monext/payline-sdk/src/Payline/PaylineSDK.php on line 1586 and exactly 3 expected
Ii seems that WebserviceClient::getAllFailoverServicesEndpoint()
method is not honoring the proxy settings that can be set when initializing the PaylineSDK
class.
This then generates lots of warnings caused by request timeouts.
A call to paylineSDK->setFailoverOptions('disabled', true);
solves the issue but also of course disables the failover capability...
Hello, the doReset function only takes these two parameters: 'transactionID' and 'comment'. So when I try to pass the 'amount' or 'currency', it's not sent in the request. Could you please fix this?
When the wallet has severals cards, the array like this:
array:2 [
"result" => array:3 [
"code" => "02500"
"shortMessage" => "Operation Successfull"
"longMessage" => "Operation Successfull"
]
"cardsList" => array:1 [
"cards" => array:2 [
0 => array:12 []
1 => array:12 []
]
]
]
But when the wallet has only on card, we got that:
array:3 [
"result" => array:3 []
"cardsList" => array:1 [
"cards" => array:12 [
"walletId" => "walletID"
"lastName" => "DUPONT"
"firstName" => "Martin"
"email" => "[email protected]"
"shippingAddress" => array:7 []
"card" => array:6 []
"cardInd" => "1"
"comment" => ""
"isDisabled" => "0"
"disableDate" => null
"extendedCard" => array:5 []
"default" => "Y"
]
]
"privateDataList" => []
]
Why don't provide a "cards" array with one card like this?
array:2 [
"result" => array:3 [
"code" => "02500"
"shortMessage" => "Operation Successfull"
"longMessage" => "Operation Successfull"
]
"cardsList" => array:1 [
"cards" => array:1 [
0 => array:12 []
]
]
]
This requires us to verify the content of the "cards" array to check if it's the array is a card, or if the array contains cards
Hello,
In src/Payline/PaylineSDK.php
at line 816, the count() function is used on something that may not be countable. It works in PHP7.1 but this is deprecated in PHP7.2 and triggers a warning in the code.
See http://php.net/manual/en/migration72.incompatible.php for reference
Could it be fixed for PHP7.2 compatibility please?
TypeError: Argument 1 passed to Payline\PaylineSDK::order() must be of the type array, null given, called in /var/www/html/vendor/monext/payline-sdk/src/Payline/PaylineSDK.php on line 1472
According to Monext documentation, the 'order' details are not mandatory for a doReAuthorizationRequest
Calling the service with an empty 'order' array returns :
ERROR. Code 02305 : Invalid field format : Order Amount : Must be numeric(12), ex : 15078
Is there a workaround for reAuthorizing a transaction without order details ?
Attention, mcrypt library was deprecated in php7 and removed in php7.2
Hi,
I'm migrating to php 7
But I encounter difficulties with Paylinee
indeed with PHP Version 5.x I have no problem
However with PHP 7 (I tried with PHP 7.0.5) all my transactions have an exception :
Exception : Function ("doAuthorization") is not a valid method for this service
Thank you
Since the 4.52 I have the following return :
array (size=3)
'result' =>
array (size=5)
'code' => string 'XXXXX' (length=5)
'longMessage' => string 'Unauthorized' (length=12)
'shortMessage' => string 'ERROR' (length=5)
'partnerCode' => null
'partnerCodeLabel' => null
Warning: A non-numeric value encountered in /monext/payline-sdk/src/Payline/PaylineSDK.php on line 345
I did a PR to fix it: #19
With the remove of mcrypt (#35), I can't use the encrypt anymore :
$aes256Key = hash('SHA256', $accessKey, true);
$messageUtf8 = utf8_encode($merchandId.';'.$orderRef.';'.$contractNumber);
$encrypted = $paylineSDK->getEncrypt($messageUtf8, $aes256Key);
give me empty string because openssl_encrypt
return false
with an error:
if (false === $encrypted) {
echo openssl_error_string();
die;
}
0607F08A:digital envelope routines:EVP_EncryptFinal_ex:data not multiple of block length
Le commerçant VPG rencontre des erreurs de lecture des codes retour des transactions réalisées.
En effet, une transaction acceptée sur le CA est affichée avec le code XXXXX sur le SDK PHP.
Voici le message affiché :
( {"result":{"code":"XXXXX","longMessage":"Undefined index: id","shortMessage":"Undefined index: id","partnerCode":null,"partnerCodeLabel":null}})
La version utilisée est la 4.55.
You added a lot of function calls in the verifyEnrollment
method, but those function now requires an array as first parameter. This is a breaking change.
4.55.3...4.59.0#diff-eec0d48cf2eda6e48bad70276112f445R1776-R1781
According to your documentation, only the order
is required for version 21
UpdatePaymentRecord and UpdateBillingRecord newAmount field not working
all your file is ending by CRLF
So we can't make a patch on your file.
Change it please
Hello,
There's a warning with PHP 8.2:
Deprecated: Creation of dynamic property Classes\MonextAPI: :$webServicesEndpoint is deprecated in /monext/payline-sdk/src/Payline/PaylineSDK.php on line 433
Is The SDK plainly compatible with PHP 8.2 ?
Hello,
We used to have the ability to use custom SoapClient before version 4.68.
payline-php-sdk/src/Payline/PaylineSDK.php
Lines 1016 to 1022 in 434ea1a
Since the introduction of WebserviceClient v4.68, this option is no longer available.
payline-php-sdk/src/Payline/WebserviceClient.php
Lines 307 to 310 in 781abe2
This is a breaking change and should be addressed urgently.
Bizarrement je tente de passer les infos shippingAdress dans doWebPaymentRequest comme cela:
$doWebPaymentRequest['buyer']['shippingAdress']['Name'] = $societe;
$doWebPaymentRequest['buyer']['shippingAdress']['firstName'] = $prenom;
$doWebPaymentRequest['buyer']['shippingAdress']['lastName'] = $nom;
$doWebPaymentRequest['buyer']['shippingAdress']['street1'] = $adresse;
$doWebPaymentRequest['buyer']['shippingAdress']['cityName'] = $ville;
$doWebPaymentRequest['buyer']['shippingAdress']['zipCode'] = $cp;
Et lors de la réponse les champs sont vides:
[shippingAdress] => Array
| (
| [title] =>
| [name] =>
| [firstName] =>
| [lastName] =>
| [street1] =>
| [street2] =>
| [cityName] =>
| [zipCode] =>
| [country] =>
| [phone] =>
| [state] =>
| [county] =>
| [phoneType] =>
| )
```
Une idée du pourquoi cela ne fonctionne pas?
Merci
Bonjour,
Dans la doc aucune référence à la mise à jour du SDK lorsqu'on a déjà une version live. Pouvez vous me donner cela svp avant de tout écraser et peut être planter ce qui marche ;)
Merci
Greetings,
We've updated our production to 4.52 and we're touched by the cast warning recently introduced in PaylineSDK
.
Actually, any call to the API won't work until we manually fix the cast, that mean any payment or wallet creation wouldn't lead to success and it's really penalizing our production.
It seems it has been fixed into this commit but no release has been made since.
Any information to give ?
payline-php-sdk/src/Payline/PaylineSDK.php
Line 1563 in 86dd172
Hello !
According to the documentation the amount field inOrder and Payment objects is mandatory. It's ok, I can understand that. But...
Our problem is that for DSP2, we need to send amount of 0€. By the way, the sdk create a soap object with null value and not 0, then the api refuse to get this amount.
I have seen in sdk code (\Payline\SoapVarFactory::userDataIsNotEmpty) that when it create the object, the empty() php function is used. But for php empty(0) = true, so the final value is null.
How could we do to send 0€ amount ?
Thanks
Is that normal that function updateWallet
does not use
$this->formatRequest($array);
but createWallet does?
If $array['merchantAuthentication']
is not defined, it broke because PaylineSDK::buyer()
method need 4th argument to be an array and not null. formatRequest
is adding merchantAuthentication
as empty array if not exists
Hi,
I use your sdk with Payline woocommerce plugin and I have the following error for some products : error code 02305 : Invalid field format : OrderDetail Ref : Max length 50 characters.
How can I see what is send in the OrderDetail to correct the product ?
Thanks,
Hello,
The Payline kit has been updated.
Can you please update to the latest version?
https://support.payline.com/hc/fr/articles/220595087-Nouvelles-fonctionnalit%C3%A9s-Payline-4-47
Thank you
Nico
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.