PHP code example of 64robots / checkout

1. Go to this page and download the library: Download 64robots/checkout 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/ */

    

64robots / checkout example snippets


return [

    /*
     * Required parameters when submitting an order to /api/orders endpoint
     */
    'address_line1',
        // 'shipping_address_line2',
        'shipping_address_city',
        'shipping_address_region',
        'shipping_address_zipcode',
        'shipping_address_phone',
        'billing_first_name',
        'billing_last_name',
        'billing_address_line1',
         // 'billing_address_line2',
        'billing_address_city',
        'billing_address_region',
        'billing_address_zipcode',
        'billing_address_phone',
    ],

    /*
     * Terms and conditions url used usually in the checkout UI
     */
    'toc_url' => '#',

    /*
     * Currency code that will be saved with every order and symbol
     * that is usually used in the Cart, Checkout and Order UI
     */
    'currency' => [
        'code' => env('CHECKOUT_CURRENCY_CODE', 'USD'),
        'symbol' => env('CHECKOUT_CURRENCY_SYMBOL', '$')
    ],

    /*
     * Percentage of Cart total and fixed fee will be stored for every
     * order purchase (transaction)
     */
    'stripe' => [
        'percentage_fee' => env('CHECKOUT_STRIPE_PERCENTAGE_FEE', 29 / 1000),
        'fixed_fee' => env('CHECKOUT_STRIPE_FIXED_FEE', 30)
    ],

    /*
     * Shipping city and state is automatically resolved from zip code
     * using GeoNames service http://www.geonames.org/
     *
     * Country code constraints the search results
     * to specific country
     */
    'geo_names' => [
        'username' => env('CHECKOUT_GEO_NAMES_USERNAME', 'demo'),
        'country_code' => env('CHECKOUT_GEO_NAMES_COUNTRY_CODE', 'US')
    ],

    /*
     * Class names can be replaced and extended with your own logic
     */
    'product_model' => R64\Checkout\Models\Product::class,
    'customer_model' => R64\Checkout\Models\Customer::class,
    'cart_model' => R64\Checkout\Models\Cart::class,
    'cart_item_model' => R64\Checkout\Models\CartItem::class,
    'coupon_model' => R64\Checkout\Models\Coupon::class,
    'order_model' => R64\Checkout\Models\Order::class,
    'order_item_model' => R64\Checkout\Models\OrderItem::class,
    'product_resource' => R64\Checkout\Http\Resources\ProductResource::class,
    'payment' => R64\Checkout\StripePaymentHandler::class
];

php artisan vendor:publish --provider="R64\Checkout\CheckoutServiceProvider" --tag="migrations"

php artisan migrate

php artisan vendor:publish --provider="R64\Checkout\CheckoutServiceProvider" --tag="config"

php artisan vendor:publish --provider="R64\Checkout\CheckoutServiceProvider" --tag="nova"