rotassator / omnipay-payway-restapi

PayWay REST API gateway for Omnipay payment processing library
MIT License
4 stars 11 forks source link

Example Usage of omnipay-payway-restapi #2

Closed ArjunKishore closed 7 years ago

ArjunKishore commented 7 years ago

@rotassator Can you add some sample usage of your package please ? Such as create and maintain customers generate single-use tokens take payments using tokenised credit card

It will be very helpful for someone new like me

brucealdridge commented 7 years ago

try this ...


/* @var \Omnipay\PaywayRest\Gateway $gateway */
$gateway = Omnipay::create('PaywayRest');
$gateway->setApiKeySecret($secretKey);
$message = $gateway->createCustomer([
    'customerNumber' => $customer_id,
    'singleUseTokenId' => $singleUseToken,
    'merchantId' => $merchantId,
]);
$response = $message>send();
if ($response->isSuccessful()) {
    $message = $gateway->updateCustomerContact([
        'customerNumber' => $customer_id,
        'customerName' => $first_name . ' ' . $last_name
    ]);
    $message->send();
}
ArjunKishore commented 7 years ago

@brucealdridge Thank you