GithubHelp home page GithubHelp logo

omnipay-payflow's Introduction

Omnipay: Payflow

Payflow driver for the Omnipay PHP payment processing library

Build Status Latest Stable Version Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Payflow support for Omnipay.

This package is tested and works with PHP 7 and 7.1.

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "omnipay/payflow": "~2.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

The following gateways are provided by this package:

For general usage instructions, please see the main Omnipay repository.

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

omnipay-payflow's People

Contributors

aderuwe avatar amacneil avatar barryvdh avatar delatbabel avatar dranes avatar greydnls avatar jtgrimes avatar kmarenov avatar korri avatar philsturgeon avatar robvh avatar

Stargazers

 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

omnipay-payflow's Issues

is getCardReference() deprecated?

In the documentation at the top of src/message/CreateCardRequest, we have the following example:

// Create a credit card object
// This card can be used for testing.
$card = new CreditCard(array(
            'firstName'    => 'Example',
            'lastName'     => 'Customer',
            'number'       => '4242424242424242',
            'expiryMonth'  => '01',
            'expiryYear'   => '2020',
            'cvv'          => '123',
));

// Do a create card transaction on the gateway
$transaction = $gateway->createCard(array(
    'card'                     => $card,
));

$response = $transaction->send();

if ($response->isSuccessful()) {
    echo "Create Card transaction was successful!\n";
    $card_id = $response->getCardReference();
    echo "Card reference = " . $card_id . "\n";
}

However, calling getCardReference() on the successful response results in the following exception:

[Symfony\Component\Debug\Exception\FatalThrowableError]                        
Call to undefined method Omnipay\Payflow\Message\Response::getCardReference()

Has this method been deprecated? If so, what is the appropriate replacement that can be used to get the card reference?

Test Cards

Throughout this library, the test card number 4242424242424242 is used as an example in the comments. It seems as though this card number is no longer a valid test card for Payflow. Valid card numbers can be found here.

I may eventually have time to update this and submit a pull request, but for now hopefully this helps someone.

Currency not being passed

We recently ran across an issue with a client in Australia using PayFlow where they were unable to pass AUD as a currency, and USD was being picked by default.

Currency was provided to the PayFlow library through the Omnipay request parameters, but I noticed the actual request being sent to PayFlow's API from the PayFlow driver did not contain a CURRENCY setting.

The PayFlow docs seem a bit spare when it comes to the parameter list, but I noticed there were quite a few examples that included CURRENCY. Here's an example from the linked docs:

TRXTYPE=A&BILLTOSTREET=123 Main St.&BILLTOZIP=95131&AMT=23.45&CURRENCY=USD&INVNUM=INV12345
&PONUM=PO9876&**CREATESECURETOKEN**=Y&**SECURETOKENID**=9a9ea8208de1413abc3d60c86cb1f4c5

I believe adding $data['CURRENCY'] to getData() in AuthorizeRequest.php might resolve the issue?

Use of `transactionReference` for purchases in v2.3 causing error

It looks like special use of transactionReference was added in 2.3 to this omnipay driver. It has broken our multi-gateway commerce implementation when our customers use this driver.

Code Changes:
#19
v2.2.2...v2.3

I think using the transaction reference for the purchase is wrong here. No other omnipay gateways do this for a ->purchase(). I supply a transaction reference to all gateways on purchase in cases where they are happy to use our reference over their own. If they respond with their own transaction reference in response, then we use theirs from then on.

I believe it should be setting the cardReference to a token that can make the purchase (even if token that is a stored transaction reference).

@RobvH You are using the transactionRef to override the ORIGID
https://github.com/thephpleague/omnipay-payflow/blob/master/src/Message/PurchaseRequest.php#L87-L89

But the card reference is also already doing this:
https://github.com/thephpleague/omnipay-payflow/blob/master/src/Message/AuthorizeRequest.php#L240-L242

@RobvH you state in the code comments:

// Next, there are two ways to conduct a sale with Payflow:
// 1. a reference sale in which an authorization transaction reference is passed
// 2. a sale in which card data is directly passed
//
// #1 should be used any time multiple charges must be committed against an authorization
// either because parts of an order shipped at different times or because authorization is
// being used to "tokenize" a card and store it on the gateway (a Paypal prescribed process).
// Capture can only be called once against an authorization but sale does not have this limitation.

I understand using the transactionReference to refund or capture since it is the identification of the original transaction in the gateway, but not for new purchases.

From Payflows perspective this may be correct, but there is nothing stopping you from using the previous transaction reference and setting it to the card token to acheive the same outcome

No other omnipay gateway I can find uses transaction reference to determine the charge source. We should stick to using cardReference and straight credit card data being passed to purchase()

@delatbabel can we move to correct this soon?

Token billing ?

Hello, there is any chance this driver supports Token billing ?

Tag 2.3.0 stable

@delatbabel we are currently running my downstream 2.3.0 in production which has pull request #19 merged. When you can, I suggest we merge that and JT's PR and tag 2.3.0 so that I can switch back to the upstream repo.

Regards,
Rob_vH

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.