Skip to content

Checkout PurchaseRequest never sends customer information, even when set #238

@garak

Description

@garak

See https://github.com/thephpleague/omnipay-stripe/blame/master/src/Message/Checkout/PurchaseRequest.php#L149

The data retrieved never includes the customer key, even if the customer reference is set (i.e. the customerReference key is present in the parameters).

The fix is pretty simple:

<?php

    public function getData()
    {
        $data = [
            'success_url' => $this->getSuccessUrl(),
            'cancel_url' => $this->getCancelUrl(),
            'payment_method_types' => $this->getPaymentMethodTypes(),
            'mode' => $this->getMode(),
            'line_items' => $this->getLineItems(),
            'customer' => $this->getCustomerReference() ?? null,  // <---- this new line is needed
        ];

        return $data;
    }

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