I've setup a custom defined form for creditcard payment. I use a wordpress environment and the Paypal-API-Call are made by ajax-request.php via custm Paypal.php
I've already implemented payment methods for monthly and once payments. The user need to be logged in with his paypal credentials and he can complete the payment via Popup. The credentials are working fine and the payments are visible and correctly done in paypal developer dashboard /account.
But if I want to create a creditcard payment also with the Paypal-API,but without paypallogin, I cant get the payment done.
At the moment the card expiry is not in the correct format. I've tried different formats like MM/YY or MM/YYYY or MM-YY, MM-YYYY.
I 've succeded to create an Order via checkout API. Afterwards, I sent the creditcard information and orderId to the API to complete the payment
$url = $this->baseUrl . "/v2/checkout/orders/$orderId/capture";
This is my paymentsource
'payment_source' => [
'card' => [
'number' => $cardNumber,
'expiry' => $expirationDate,
'security_code' => $cvv
'name' => $cardHolderName,
'billing_address' => [
'address_line_1' => $billingAddress ?? 'Default Street 1',
'admin_area_2' => $billingCity ?? 'Default City',
'postal_code' => $billingZip ?? '00000',
'country_code' => $billingCountry ?? 'DE'
]
]
]
Do you have any ideas, whats wrong here? This is the error in the result Object
{
"field": "/payment_source/card/expiry",
"value": "12/27",
"location": "body",
"issue": "INVALID_STRING_LENGTH",
"description": "The value of a field is either too short or too long."
}
It's helpful to consult the documentation. YYYY-MM