Coder Social home page Coder Social logo

marlon-ogone's People

Contributors

abdullahzn avatar bcerati avatar brechtbonte avatar bvleur avatar caseycs avatar drmonkeyninja avatar fabrizzio avatar fafa973 avatar jelte avatar jorenvanhee avatar jverdeyen avatar l00cyph3r avatar lalop avatar maciejzgadzaj avatar maef avatar malika- avatar mathiasverraes avatar mhstudioos avatar mnokin avatar mvanmeerbeck avatar nclavaud avatar peternijssen avatar renedekat avatar rieschl avatar tijuan avatar unreal4u avatar wimvds avatar woutersioen 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

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

marlon-ogone's Issues

Automatically submit form and redirect

I'm using this in Laravel 5.6 - is there a way to automatically submit the form and redirect to Ogone?

My code:

        // Create ogone payment request
        $ecommercePaymentRequest = $this->generatePaymentRequest($order);

        // Return html form for Ogone
        $formGenerator = new SimpleFormGenerator;
        $html = $formGenerator->render($ecommercePaymentRequest);

        return new Response('<h1>Pay for order</h1><p></p>' . $html);

Added to packagist

Ive added your package to packagist.org (http://packagist.org/packages/marlon-be/marlon-ogone). If youd like to be added as a maintainer then let me know and i`ll add you.

I needed this to get composer to work :-).

EcommercePaymentResponse -- Double encoded url

For a while I've had the trouble of EcommercePaymentResponse objects not being valid using:
if($ecommercePaymentResponse->isValid($shaComposer) && $ecommercePaymentResponse->isSuccessful())

The problem here was that the redirect url (that I get from Ogone was double encoded).
Ex.
dot was '%252E' instead of '%2E'

This resulted in the $shaString being incorrect so it wouldnt be the same as the shaSign I got with the request (and thus isValid resulting in false).

It might have been a misconfiguration of Ogone on my part but for now I fixed it by urldecoding all the values from the request before creating the EcommercePaymentResponse.

A quick fix might be to do the following:
AllParametersShaComposer.php

public function compose(array $parameters)
    {
        foreach($this->parameterFilters as $parameterFilter) {
            $parameters = $parameterFilter->filter($parameters);
        }

        ksort($parameters);

        // compose SHA string
        $shaString = '';
        foreach($parameters as $key => $value) {
            $shaString .= $key . '=' . urldecode($value) . $this->passphrase;
        }

        return strtoupper(hash($this->hashAlgorithm, $shaString));
    }

instead of

public function compose(array $parameters)
    {
        foreach($this->parameterFilters as $parameterFilter) {
            $parameters = $parameterFilter->filter($parameters);
        }

        ksort($parameters);

        // compose SHA string
        $shaString = '';
        foreach($parameters as $key => $value) {
            $shaString .= $key . '=' . $value . $this->passphrase;
        }

        return strtoupper(hash($this->hashAlgorithm, $shaString));
    }

I don't know what the implication of this "fix" are, just wanted to give you guys an update on this particular problem.

OwnerAddress length should be 50 and not 35

According to https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/directlink, the max length authorized for OwnerAddress parameter should be 50 characters, and not 35, as set in the AbstractPaymentRequest.php line 192.

public function setOwnerAddress($owneraddress)
{
if (strlen($owneraddress) > 35) {
throw new InvalidArgumentException("Owner address is too long");
}
$this->parameters['owneraddress'] = $owneraddress;
}

Not ?

alias with e-commerce

Hi,
I'm new to php, wordpress, ogone (I'm a Java guy), and I'd like to know if I can generate an e-commerce form with an alias.
I haven't found it. I guess I'll try to override ECommercePaymentRequest. I'll try not to modify the library files.

Thx in advance,

Olivier Allouch

Delete classloader submodule

I think the classloader submodule in vendor/ can be deleted. The classloader component can be required in the composer.json file.
If you want I can send a PR for this change, easy peasy :) But I'd like to hear your opinion first.

GeneralParameterFilter, array_walk -> trim

Is this extra array_walk doing anything to the values? https://github.com/marlon-be/marlon-ogone/blob/master/lib/Ogone/ParameterFilter/GeneralParameterFilter.php#L19

As far as I can tell it's not changing any of the values as the trimmed values are not saved in the original values by trim().

Note: If you decide to fix this with a proper callback so that original values get changed, be careful to only trim values which are of type "string". Trimming int/float results in string and Ogone will fail when, for example, "AMOUNT" is a string.

Something like:

    public function filter(array $parameters)
    {
        $parameters = array_change_key_case($parameters, CASE_UPPER);

        array_walk($parameters, function (&$value) {
            $value = is_string($value) ? trim($value) : $value;
        });

        $parameters = array_filter($parameters, function ($value) {
            return (bool) strlen($value);
        });

        return $parameters;
    }

Accessing fields from Response

I'm trying to access the fields from the response. Is it correct I have to make sure to add this line?

$shaComposer->addParameterFilter(new ShaOutParameterFilter); //optional

If so, when I do, Im getting Class 'ShaOutParameterFilter' not found.

use PostFinance\Ecommerce\EcommercePaymentResponse;
use PostFinance\ShaComposer\AllParametersShaComposer;

are present and the rest of the payment flow works like a breeze.

Any guidance on accessing the response fields would be much appreciated or maybe an extra paragraph in the readme?

Allow "alias" and "aliasusage" params in EcommercePaymentRequest

Allow extra parameters "alias" and "aliasusage" to be used in the ECommercePaymentRequest to enable the Alias checkbox in the Ecommerce flow.

For now, the Alias functionality is implemented via the Ogone\DirectLink\CreateAliasRequest using the separate alias gateway endpoint at Ingenico side.

It will probably suffice to add these two fields to the $ogoneFields array in "Ogone\AbstractRequest".

Update parameters/ogoneFields

The Ogone parameters are not up to date anymore. I would be happy to update them, but I wondered if there is a better place to put them. The out params for instance, are now in two different places. The ShaOutParameterFilter and AbstractResponse class.

DirectLink CardNO params

As I understand when user pay by credit card code must be looks like:

  1. create direct link request
  2. send post to $directLinkRequest->getOgoneUri() with adding params from toArray, getShaSign and CARDNO, CVC and so on (something like from readme for CreateAliasRequest)

Problem is that from documentation CARDNO, CVC and so on must be calculated in SHA: List of Parameters to be included in SHA IN Calculation

Does it just not realized functionality now or there is another way to create direct link request with CARDNO, CVC and other params?

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.