Last active
April 28, 2019 13:42
-
-
Save ger86/86269b3887eceb9b337d68f919a709c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use App\Model\DTO\StripeProcessSubscriptionDTO; | |
use App\Service\StripeProcessSubscription; | |
class ProcessSubscriptionController extends AbstractController { | |
/** | |
* Creates a form to choose subscription | |
* | |
* @param StripePlanRepository $stripePlanRepository | |
* @param string $stripePublicKey | |
* @return Response | |
*/ | |
public function __invoke( | |
Request $request, | |
StripeProcessSubscription $stripeProcessSubscription | |
): Response { | |
$dto = new StripeProcessSubscriptionDTO( | |
$request->get('plan'), | |
$request->get('stripeToken'), | |
$request->get('stripeTokenType'), | |
$request->get('stripeEmail') | |
); | |
$subscription = ($stripeProcessSubscription)($dto); | |
return new Response('ok'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hola quisiera tener los archivos service.yml StripeProcessSubscriptionDTO.php y StripePlanRepository.php por favor lo necesito para el estudio