Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing docs? #631

Open
linups opened this issue Apr 9, 2024 · 1 comment
Open

Missing docs? #631

linups opened this issue Apr 9, 2024 · 1 comment

Comments

@linups
Copy link

linups commented Apr 9, 2024

Hello,

Sorry, this is not exact issue, but i'm not able to find, where to post question.

I see in documentation a lot of examples with subscription. But i cannot find any example with regular charge (when is needed simple charge for one or multiple items) Did i missed something?

Thank you.

@eqxDev
Copy link

eqxDev commented Apr 13, 2024

This is the code I use which functions, the data is just the same from the Paypal order create API

$provider = new PayPal();
$provider->setApiCredentials(config('paypal'));
$provider->getAccessToken();

    $response = $provider->createOrder([
        "intent" => "CAPTURE",
        "application_context" => [
            "return_url" => route('checkout.success', ['order' => $order->id, 'token' => $token, 'type' => 'paypal']),
            "cancel_url" => route('checkout.cancel', ['order' => $order->id, 'token' => $token]),
        ],
        "purchase_units" => [
            0 => [
                'reference_id' => 'web-' . $order->id,
                "amount" => [
                    "currency_code" => "GBP",
                    "value" => $total
                ]
            ]
        ]
    ]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants