PayPal_Laravel/README.md

2.5 KiB
Executable File

Sample project combining Paypal, reCaptcha, Excel export, laravel/breeze

Pay with Paypal

srmklive/paypal package

  • Install: composer require srmklive/paypal
  • Structure of order data:
[
    "intent" => "CAPTURE",
    "application_context" => [
        "return_url" => route('paypal.payment.success'),
        "cancel_url" => route('paypal.payment/cancel'),
    ],
    "purchase_units" => [
        0 => [
            'amount' => [
                'currency_code' => "",
                'value' => "",
                "breakdown" => [
                    "item_total" => [
                        "currency_code" => "",
                        "value" => "",
                    ],
                    "shipping" => [
                        "currency_code" => "",
                        "value" => "",
                    ],
                    "tax_total" => [
                        "currency_code" => "",
                        "value" => "",
                    ],
                    "discount" => [
                        "currency_code" => "",
                        "value" => "",
                    ],
                ],
            ],
            'items' => []
        ],
    ],
]
  • Structure of items data:
[
    [
        'id' => 1,
        'item' => [
            'name' => 'Laptop',
            'sku' => 'L001',
            'quantity' => '1',
            'unit_amount' => [
                'currency_code' => 'USD',
                'value' => '1000',
            ],
        ]
    ],
    [
        'id' => 2,
        'item' => [
            'name' => 'iPad',
            'sku' => 'I001',
            'quantity' => '1',
            'unit_amount' => [
                'currency_code' => 'USD',
                'value' => '500',
            ],
        ]
    ],
    
    ...
]

reCaptcha

anhskohbo/no-captcha package

Excel export

maatwebsite/excel package

Starter kits

laravel/breeze package

  • Install: composer require laravel/breeze