This a framework agnostic PHP wrapper for accessing Paymongo API.
composer require jenn0pal/paymongo-php:dev-master
For payload, please refer to Paymongo API reference
use jenn0pal\Paymongo\Paymongo;
$config = [
'secret_key' => 'YOUR-SECRET-KEY'
];
$payload = [
'data' => [
'attributes' => [
'amount' => 10000,
'payment_method_allowed' => ['card'],
'payment_method_options' => [
'card' => ['request_three_d_secure']
],
'description' => 'A payment intent',
'statement_descriptor' => 'MyStore',
'currency' => 'PHP',
'metadata' => []
]
]
];
$paymentIntent = Paymongo::payment($config)->create($payload);