Skip to content
eyal1 edited this page Mar 11, 2014 · 8 revisions

Overview

This wiki will describe the requirements and implementation steps for the Riskified PHP SDK.

Purpose

The purpose of the SDK is to help merchants integrate with Riskified in a fast and straight forward way on their end, and for Riskified to receive the full order information.

Currently we supply them a sample script that builds the data structure that is sent over the wire. This causes the following problems:

  1. In some cases, they need us on the other side to tell them what the error is.
  2. They have no indication of which fields are mandatory and which fields are optional.
  3. We need to perform several iterations with them until all the order information is full.

Implementation steps

  1. Create the first release of the PHP SDK.
  2. Integrate the release into the Magento extension and make sure that it works.
  3. Release the PHP SDK.

Design Goals

The following design goals should be satisfied by the SDK:

  1. Provide client side validation (give the Merchant informative error messages about missing/invalid data.
  2. Separate the transport layer from the data models/objects. We should be able to use separate PHP transport mechanisms (such as curl or guzzle) to submit the order information to Riskified.
  3. Require not external dependencies on other PHP packages. Meaning, the data models should not rely on external PHP packages. In theory only the transport layer should depend on external packages.

Requirements

  1. The user should be able to submit an order in either JSON or XML format.
  2. The classes that need to be implemented are committed in skeleton from into the repository. They are taken directly from the latest integration spec document (version 2.01).
  3. Each class should be able to validate itself. The optional and required fields appear in the integration spec document.
  4. The order class should perform the final validation.
  5. Validation should be limited in the beginning to making sure that the necessary fields are filled. No need to go overboard with field validation.
Clone this wiki locally