Paymongo::source()->create([
'type' => 'gcash',
'amount' => 100,
'currency' => 'PHP',
'redirect' => [
'success' => 'http://localhost/success',
'failed' => 'http://localhost/failed'
]
])
Paymongo::shouldReceive('source')
->shouldReceive('create')
->andReturn(json_decode('
{
"data": {
"id": "gg",
"type": "source",
"attributes": {
"amount": 10000,
"billing": null,
"currency": "PHP",
"description": null,
"livemode": false,
"redirect": {
"checkout_url": "https://test-sources.paymongo.com/sources?id=gg",
"failed": "http://localhost/failed",
"success": "http://localhost/success"
},
"statement_descriptor": null,
"status": "pending",
"type": "gcash",
"created_at": 1648140991,
"updated_at": 1648140991
}
}
}',true));