Skip to content

Use of transactionReference for purchases in v2.3 causing error #21

@lukeholder

Description

@lukeholder

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions