rotassator/omnipay-payway-restapi

Make a Purchase without creating new Customer

Closed this issue · 1 comments

As per the trusted frame documentation, It is possible for us to make a payment transaction without creating new customer.
https://www.payway.com.au/docs/rest.html#transactions

This is possible if you send singleUseTokenId in
Message/PurchaseRequest.php data array line number 40

if($this->getSingleUseTokenId()){
$data['singleUseTokenId'] = $this->getSingleUseTokenId();
}

So the implementation will go like this
$gateway->setApiKeyPublic($this->publicKey);
$gateway->setApiKeySecret($this->secretKey);
$customerId = 'UNREGISTEDUSER01'; /// can be any value

        // process the payment
        $message = $gateway->purchase([
            'customerNumber' => $customerId,
            'singleUseTokenId' => $singleUseToken,
            'principalAmount' => 610.00,
            'currency' => 'AUD',
            'orderNumber' => 'ORDER'
        ]);
        $response = $message->send();

I hope someone will find this useful

See #5 for resolution.