Giter Club home page Giter Club logo

payline-php-sdk's People

Contributors

antoinelemaire avatar belunet avatar charleliebouvier avatar colonelmoutarde avatar cyrilleh avatar jdeniau avatar llaville avatar monext-ofrancome avatar neopheus avatar nickinthebox avatar nicogodon avatar nicolasdewez avatar paylinegithub avatar romulused69 avatar vpietri-tbd 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

payline-php-sdk's Issues

Override SoapClient

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 ?

Version 4.62

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

Payline Presto payment error 500

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');
}`

getWebPaymentDetailsResponse et order

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?

Format différent champ "cardList.cards" sur la version 4.59 du kit PHP

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

Support for PHP 7.4

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?

Authorize monolog v2

Your library forces installation of monolog v1.
Can you please installation of monolog v2?

Thank you

account verification request

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""

4.68 Incompatible with laravel v8

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].

Switch the "default" status of a card

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 ?

WebserviceClient::getAllFailoverServicesEndpoint is not using the proxy settings

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...

doReset missing parameters

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?

getCards with single card

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

[\Payline\PaylineSDK::doReAuthorization] 'order' parameter is mandatory

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 ?

mcrypt

Attention, mcrypt library was deprecated in php7 and removed in php7.2

Problem on PHP Version 7.0.5

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

$merchant_id casting with 4.52 cause failures

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

openssl_encrypt error

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

Erreur XXXXX

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.

File ending by CRLF

all your file is ending by CRLF
So we can't make a patch on your file.
Change it please

Warning on PHP8.2

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 ?

Custom SOAP client no longer working,

Hello,

We used to have the ability to use custom SoapClient before version 4.68.

if ($this->soapclient_options['soap_client'] instanceof \SoapClient) {
$client = $this->soapclient_options['soap_client'];
} else {
$client = new SoapClient(__DIR__ . '/wsdl/' . $PaylineAPI . '.wsdl', $this->soapclient_options);
}
$client->__setLocation($this->webServicesEndpoint . $PaylineAPI);

Since the introduction of WebserviceClient v4.68, this option is no longer available.

$sdkClient = new SoapClient($this->sdkWsdl, $options);
$sdkClient->__setLocation($location);

This is a breaking change and should be addressed urgently.

prise en compte du champ shippingAdress dans doWebPaymentRequest

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

Procédure de mise à jour

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

SDK is broken since 4.52

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 ?

[SDK 4.65.1 +] amount is mandatory, but do not accept 0 value

Hello !
According to the documentation the amount field inOrder and Payment objects is mandatory. It's ok, I can understand that. But...

image

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

PaylineSDK::updateWallet & formatRequest

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

image

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.