Giter Site home page Giter Site logo

php's People

Contributors

cristian-vatca-osf avatar cristianbalajosf avatar ebanolopes avatar khiminrm-lemberg avatar pearsonifyd avatar rbpotter avatar rojoangel avatar sig-chrismorris528 avatar varunbhoomi avatar

Stargazers

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

php's Issues

How to use validate webhook request inside Laravel

I am using this package inside a Laravel app, i want to validate webhook request, in Laravel , you can get request body using $request->getContents(), $request->all(), $request->all()returns PHP array which ijson_encode`'s and passes to https://github.com/signifyd/signifyd-php/blob/master/lib/Core/SignifydAPI.php#L159

Please can you explain, what the structure of $request should be, fields and data type, obviously it should be a string but how is that string generated, from what?

I get wrong hash no matter what i do, it does not match the request header's X-SIGNIFYD-SEC-HMAC-SHA256

Mistyped and advice

Hello,

In Model Product has not sense property $itemHeight, probably you want $itemWeight, right?

IMHO your system lack of a basic feature, the ability to send you not successful transaction, sometime thelf try many time with different cards until success.

Perhaps I'm wrong but you don't create fingerprint on client site?I couldn't find yet any signifyd's JS to integrate in our system that send you that information.

Thank you.

Improve SignifydAPI error logging by providing more context

Currently when a call to the API results in an error the only information being logged is the HTTP code returned by the server:

$this->logError("Returned http error: ".$info['http_code'])

Under certain circumstances it is hard to figure out what's the error root cause with just the HTTP code. The logging error message could be easily improved by adding the response returned by the server in order to provide more context.

A couple of examples:

  • when attempting a request with an invalid API key
    the error logged is: "Returned http error: 401"
    whereas the response returned by the server already contains : {"message":"Provided API Key not found."}
  • when attempting a request with an invalid date format
    the error logged is: "Returned http error: 400"
    whereas the response returned by the server already contains: {"errors":{"purchase.createdAt":["Failed to parse field"]}}

Product Model is missing itemImage field

There's a mismatch between the documentation and the implementation for the Product Model.
According to the documentation it should expose an itemImage attribute:

        {
                "itemId": "1",
                "itemName": "Sparkly sandals",
                "itemUrl": "http://mydomain.com/sparkly-sandals",
                "itemImage": "http://mydomain.com/images/sparkly-sandals.jpeg",
                "itemQuantity": 1,
                "itemPrice": 49.99,
                "itemWeight": 5
            }

But the field is missing from the \Signifyd\Models\Product class.
The issue is present in the library version 0.1.2

Version v0.1.3 should be tagged v0.1.3

... in order to be recognized as a stable version by composer.

Currently the tag is 0.1.3 but it should be v0.1.3.

With the current tag composer install yields the following message:

The requested package signifyd/signifyd-php ^0.1.3 exists as signifyd/signifyd-php[dev-SDK, dev-master, v0.1.0, v0.1.1, v0.1.2] but these are rejected by your constraint.

Packagist/composer not pulling 0.1.6

For some reason the latest version is not pulling in properly via composer. It simply removes the package completely unless I peg it to a previous version.

Error: Call to undefined method Signifyd\Core\Response\TransactionsResponse::setError()

Hi! While testing sending transaction, I've received error:
Error: Call to undefined method Signifyd\Core\Response\TransactionsResponse::setError() in Signifyd\Core\Connection->handleResponse() (line 275 of /var/www/html/vendor/signifyd/signifyd-php/lib/Core/Connection.php)

Maybe TransactionsResponse should extend Response class instead of Model and implement the setError() method? Other classed from Response folder extend Response.

I used such code:

$caseApi = new CaseApi(['apiKey' => $this->apiKey]);
 $response = $caseApi->createTransaction($transactions_data);

where $transactions_data is array of test values.

CaseReponse Error transactions[0].type "This field is required."

We recently upgraded from v3.* to v4.0.2 and are still operating on V2 of the API. I am getting an error when attempting to create a case (https://api.signifyd.com/v2/cases) which says a transaction type is required. I am passing one along but I notice in v4.0.0 $type was removed from the Transactions class and its $fields array which is called in CaseModel which may be the cause. Any help is appreciated.

$caseApi = signifyd_get_case_api();
$case = new \Signifyd\Models\CaseModel($caseDetails);
$caseResponse = $caseApi->createCase($case); // Error 

$caseDetails:

[
  'purchase' => [...],
  'transactions' => 
  [
    0 => 
    [
      'transactionId' => '...',
      'createdAt' => '2022-09-22T20:20:59+00:00',
      'gateway' => '...',
      'gatewayStatusCode' => 'SUCCESS',
      'paymentMethod' => 'CREDIT_CARD',
      'type' => 'AUTHORIZATION', // Type Here
      'currency' => 'USD',
      'amount' => '43.09',
      'checkoutPaymentDetails' => [...]
    ],
  ],
  'userAccount' => NULL,
]

$case:

   'transactions' => [
    0 => [
        'transactionId' => '...',
        'gatewayStatusCode' => 'SUCCESS',
        'paymentMethod' => 'CREDIT_CARD',
        'checkoutPaymentDetails' => []
        'billingAddress' => [...],
        'accountHolderName' => NULL,
        'accountHolderTaxId' => NULL,
        'accountHolderTaxIdCountry' => NULL,
        'accountLast4' => NULL,
        'abaRoutingNumber' => NULL,
        'cardToken' => NULL,
        'cardTokenProvider' => NULL,
        'cardBin' => '...',
        'cardExpiryMonth' => '...',
        'cardExpiryYear' => '...',
        'cardLast4' => '...',
        'cardBrand' => NULL,
        'cardFunding' => NULL,
        'cardInstallments' => NULL,
        'fields' => [...],
        'fieldsValidation' => [...],
    ]
]

Full Error:

<?
Signifyd\Core\Response\CaseResponse::__set_state(array(
   'messages' => 
  array (
    0 => '{"errors":{"transactions[0].type":["This field is required."]}}',
  ),
   'guaranteeEligible' => NULL,
   'guaranteeDisposition' => NULL,
   'status' => NULL,
   'caseId' => NULL,
   'score' => NULL,
   'uuid' => NULL,
   'headline' => NULL,
   'orderId' => NULL,
   'orderDate' => NULL,
   'orderAmount' => NULL,
   'associatedTeam' => NULL,
   'reviewDisposition' => NULL,
   'createdAt' => NULL,
   'updatedAt' => NULL,
   'orderOutcome' => NULL,
   'currency' => NULL,
   'adjustedScore' => NULL,
   'testInvestigation' => NULL,
   'logger' => 
  Signifyd\Core\Logging::__set_state(array(
     'logger' => 
    Monolog\Logger::__set_state(array(
       'name' => 'Signifyd PHP Library',
       'handlers' => 
      array (
        0 => 
        Monolog\Handler\StreamHandler::__set_state(array(
           'level' => 
          Monolog\Level::Debug,
           'bubble' => true,
           'processors' => 
          array (
          ),
           'formatter' => NULL,
           'streamChunkSize' => 13421772,
           'stream' => NULL,
           'url' => '...',
           'errorMessage' => NULL,
           'filePermission' => NULL,
           'useLocking' => false,
           'dirCreated' => NULL,
        )),
      ),
       'processors' => 
      array (
      ),
       'microsecondTimestamps' => true,
       'timezone' => 
      DateTimeZone::__set_state(array(
         'timezone_type' => 3,
         'timezone' => 'UTC',
      )),
       'exceptionHandler' => NULL,
       'logDepth' => 0,
       'detectCycles' => true,
    )),
     'settings' => 
    Signifyd\Core\Settings::__set_state(array(
       'apiKey' => '...',
       'apiAddress' => 'https://api.signifyd.com/',
       'timeout' => 30,
       'retry' => true,
       'SSLVerification' => false,
       'consoleOut' => false,
       'logEnabled' => false,
       'logFileName' => 'signifyd_core.log',
       'logLocation' => '.',
    )),
  )),
   'isError' => false,
   'errorMessage' => NULL,
   'checkpointAction' => NULL,
   'checkpointActionReason' => NULL,
   'test' => NULL,
   'guaranteeIneligibleReason' => NULL,
   'guaranteed' => NULL,
   'recommendedAction' => NULL,
   'isTest' => NULL,
   'customerCaseId' => NULL,
))

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.