-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hello there,
i have currently the problem that my passed intent for just authorization of payment (not capture it) is ignored.
For source i have used the official Paypal-Developer-Page: https://developer.paypal.com/studio/checkout/standard/integrate
Currently i have the following code (simplified):
<script type="text/javascript" src="https://www.paypal.com/sdk/js?client-id=xxxsecretidxxx&intent=authorize" data-sdk-integration-source="developer-studio"></script>
In my php-server-checkout-file i have the createOrder- and authorizeOrder-Funktion:
function createOrder($cart, $client)
{
$orderBody = [
"body" => OrderRequestBuilder::init("AUTHORIZE", [
PurchaseUnitRequestBuilder::init(AmountWithBreakdownBuilder::init("EUR", "10")->build())->build(),
])->build(),
];
$apiResponse = $client->getOrdersController()->createOrder($orderBody);
return handleResponse($apiResponse);
}
function authorizeOrder($orderID, $client)
{
$authorizeBody = ["id" => $orderID,];
$apiResponse = $client
->getOrdersController()
->authorizeOrder($authorizeBody);
return handleResponse($apiResponse);
}
Both are executed via ajax and are working (first createOrder, second authorizeOrder. I receive the status-completed data from Paypal.
But: The payment is executed immediatly and not just authorized.
Do i have to set the intent also somewhere else?
Best regards,
Otto