PHP code example of strider-tech / peach-payments

1. Go to this page and download the library: Download strider-tech/peach-payments library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

strider-tech / peach-payments example snippets


'providers' => [
    ...
    'StriderTech\PeachPayments\PeachPaymentsServiceProvider',
]

'aliases' => [
    ...
    'PeachPayments' => 'StriderTech\PeachPayments\Facade\PeachPaymentsFacade',
]

php artisan vendor:publish --provider="StriderTech\PeachPayments\PeachPaymentsServiceProvider"

php artisan migrate

$user = Auth::user();

$card = new PaymentCard();
$card->setCardBrand(CardBrand::MASTERCARD)
    ->setCardNumber('5454545454545454')
    ->setCardHolder('Jane Jones')
    ->setCardExpiryMonth('05')
    ->setCardExpiryYear('2020')
    ->setCardCvv('123');
    
$user->storeCard($card);

$user->storeCardByToken($token);

$user->deleteCardByToken($token);