2017 © Pedro Peláez
 

symfony-bundle paymentsips-bundle

paymentsips bundle for symfony2

image

jrk/paymentsips-bundle

paymentsips bundle for symfony2

  • Monday, February 5, 2018
  • by jreziga
  • Repository
  • 1 Watchers
  • 3 Stars
  • 656 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 12 % Grown

The README.md

Getting started with JRKPaymentSipsBundle

Setup

JRKPaymentSipsBundle requires the ATOS api folder, (*1)

  • Using composer

Add jrk/paymentsips-bundle as a dependency in your project's composer.json file:, (*2)

{
    "require": {
        "jrk/paymentsips-bundle": "dev-master"
    }
}

Update composer, (*3)

php composer update
or
php composer.phar update
  • Add JRKPaymentSipsBundle to your application kernel

``` php Install assets ``` php app/console assets:install ``` > Generate pathfile assets - You'll have to specify param's path directory (by default use [app/config/sips/param]) ``` php app/console jrk:sips:install ``` For example, with default values of the bundle, you can extract the API like this: . |-- app | `-- config | `-- sips | `-- bin | `-- static | `-- request | `-- response | `-- param | `-- certif.XXXXXXXXXXXX | `-- parmcom.XXXXXXXXXXXX | `-- parmcom.mercanet # if you are using mercanet for example | `-- pathfile # generated | `-- Version.txt Usage ----- - Using service Open your controller and call the service. ``` php get('jrk_paymentsips')->get_sips_request( array( "amount" => 10, "currency_code" => 978 // Override params if you need "order_id" => 12 ), $YourTransactionEntityExample ); ?>, (*4)


The bundle forward an array with the server response in a multidimensionnal array : In your response action, if you call this : `$structuredData = $request->attributes->get('response_data')`; the variable structuredData will contain the following data : - code - error - merchant_id - merchant_country - amount - transaction_id - payment_means - transmission_date - payment_time - payment_date - response_code - payment_certificate - authorisation_id - currency_code - card_number - cvv_flag - cvv_response_code - bank_response_code - complementary_code - complementary_info - return_context - caddie - receipt_complement - merchant_language - language - customer_id - order_id - customer_email - customer_ip_address - capture_day - capture_mode - data - order_validity - transaction_condition - statement_reference - card_validity - score_value - score_color - score_info - score_threshold - score_profile Attributes "code" and "response_code" will give you more informations about the state of the payment. You can now use the "sips_route_response" method in your controller ``` php attributes->get('response_data'); $orderId = $responseData['order_id']; // Get your order entity $order = $this ->getDoctrine() ->getEntityManager() ->getRepository('YourBundle:YourEntity') ->find($orderId) ; // Update your entity data, for exemple order state $order->setState("ACCEPTED"); $em=$this->getDoctrine()->getEntityManager(); $em->persist($order); $em->flush(); ?>

Controller example, (*5)

``` php get('jrk_paymentsips')->get_sips_request( array( 'amount' => $price, 'order_id' => $order->getId() ), $order ); // Render your payment page, you can render the sips form like that for twig : {{ sips_form }} return $this->render('ShopFrontBundle:MyController:paymentpage.html.twig', array( "sips_form"=>$paymentForm ) ); } // Controller set in your config.yml : my_sips_response parameter public function my_sips_responseAction() { $responseData = $request->attributes->get('response_data'); $orderId = $responseData['order_id']; // Find your order in your database $order = $this ->getDoctrine() ->getEntityManager() ->getRepository('YourBundle:YourEntity') ->find($orderId) ; // Store your transaction entity in database for example, or attributes. $order->setState("ACCEPTED"); $em = $this->getEntityManager(); $em->persist($order); $em->flush(); // Notify the user by mail for example /* ... */ // Redirect the user in his history orders for example return $this->redirect($this->generateUrl("user_history_orders")); } } ?>, (*6)


View (twig example)

Order page : {{ sips_form|raw }} ```, (*7)

The Versions

05/02 2018

dev-master

9999999-dev http://github.com/jr-k/JRKPaymentSipsBundle

paymentsips bundle for symfony2

  Sources   Download

MIT GNU GPL v2

The Requires

 

payment card credit sips jrk atos paymentsips