{"title":"Set up the OCC extension","category":"default","creationDate":1557407160,"content":"<p>The Adyen payments add-on supports SAP Omni Commerce Connect (OCC) V2 through <a href=\"https:\/\/github.com\/Adyen\/adyen-hybris\/blob\/develop\/adyenv6core\/src\/com\/adyen\/v6\/facades\/AdyenCheckoutFacade.java\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">com.adyen.v6.facades.AdyenCheckoutFacade<\/a>.<\/p>\n<p>With this integration, you can accept:<\/p>\n<ul>\n<li><a href=\"\/payment-methods\/cards\">Credit cards<\/a>, including <a href=\"\/online-payments\/tokenization\/make-token-payments\">shopper-present recurring payments<\/a> and <a href=\"\/payment-methods\/cards\/credit-card-installments\">installments<\/a><\/li>\n<li><a href=\"\/payment-methods\/boleto-bancario\">Boleto<\/a><\/li>\n<\/ul>\n<p>The add-on supports the following methods:<\/p>\n<h3>Return the stored cards associated with the shopping cart<\/h3>\n<ul>\n<li>OCC controller: <code>UsersController.getPaymentInfos<\/code><\/li>\n<li>Endpoint: GET <code>\/{USER_ID}\/paymentdetails<\/code><\/li>\n<\/ul>\n<p>Internally, this calls the following method:<\/p>\n<pre><code class=\"language-js\">PaymentDetailsListWsDTO getPaymentDetails(String userId) throws IOException, ApiException;<\/code><\/pre>\n<h3>Receive and store payment details<\/h3>\n<ul>\n<li>OCC controller: <code>CartsController.addPaymentDetails<\/code><\/li>\n<li>Endpoint: POST <code>\/{CART_ID}\/paymentdetails<\/code><\/li>\n<\/ul>\n<p>Depending on the payment method, you may need to pass some additional parameters:<\/p>\n<ul>\n<li><strong>Credit cards<\/strong>: Encrypted cardholder data. For more information, refer to <a href=\"\/payment-methods\/cards\">Cards<\/a>.<\/li>\n<li><strong>Stored cards<\/strong>: The <code>recurringDetailReference<\/code>, the <code>shopperReference<\/code>, and the encrypted CVC. For more information, refer to <a href=\"\/online-payments\/tokenization\">Tokenization<\/a>.<\/li>\n<li><strong>Installments<\/strong>: The number of installments. For more information, refer to <a href=\"\/payment-methods\/cards\/credit-card-installments\">Credit cards<\/a>.<\/li>\n<li><strong>Boleto<\/strong>: The social security number. For more information, refer to <a href=\"\/payment-methods\/boleto-bancario\">Boleto<\/a>.<\/li>\n<\/ul>\n<p>For example, to make an installments payment and store credit card details, submit a POST <code>\/{CART_ID}\/paymentdetails<\/code> request, providing:<\/p>\n<pre><code class=\"language-js\">{\n   \"encryptedCardNumber\": \"adyenjs_0_1_1 ...\",\n   \"encryptedExpiryMonth\": \"adyenjs_0_1_1 ...\",\n   \"encryptedExpiryYear\": \"adyenjs_0_1_1 ...\",\n   \"encryptedSecurityCode\": \"adyenjs_0_1_1 ...\",\n   \"installments\": \"10\",\n        \"saveCardData\": true,\n        \"accountHolderName\": \"ABC\",\n        \"cardNumber\": \"4111111111111222\",\n        \"expiryMonth\": \"03\",\n        \"expiryYear\": \"2030\",\n        \"cardType\" : {\"code\": \"visa\"},\n        \"adyenPaymentMethod\": \"adyen_cc\",\n        \"billingAddress\" : {\n            \"titleCode\": \"mr\",\n            \"firstName\": \"Joao\",\n            \"lastName\": \"Paulo\",\n            \"line1\": \"Rua Luiz Fernandes\",\n            \"town\": \"SJC\",\n            \"postalCode\": \"12236750\",\n            \"country\": {\"isocode\": \"BR\"},\n            \"shippingAddress\": true,\n            \"region\" : {\n                \"countryIso\" : \"BR\",\n                \"isocode\": \"SP\",\n                \"name\": \"Sao Paulo\"\n            }\n        }\n   }<\/code><\/pre>\n<p>Internally, this calls the following method:<\/p>\n<pre><code class=\"language-js\">PaymentDetailsWsDTO addPaymentDetails(PaymentDetailsWsDTO paymentDetails, DataMapper dataMapper);<\/code><\/pre>\n<h3>Place an order using stored payment details<\/h3>\n<p>After storing payment information using the above methods, you can place an order:<\/p>\n<ul>\n<li>OCC controller: <code>OrdersController.placeOrder<\/code><\/li>\n<li>Endpoint: POST <code>\/users\/{USER_ID}\/orders<\/code><\/li>\n<\/ul>\n<p>Internally, this calls the following method:<\/p>\n<pre><code class=\"language-js\">OrderData authorisePayment(CartData cartData) throws Exception;<\/code><\/pre>\n<p>After a successful response from the Adyen API, the system registers the payment response on the cart\/order level. It returns an instance of <code>OrderWSDTO<\/code> obtained from <code>OrderData<\/code> of the placed order.<\/p>\n<p>For Boleto, the response contains the URL to the PDF, the Base64 encoded data, the expiration date, and the due date.<\/p>\n<h2>Set up the notification extension<\/h2>\n<p>If you want to receive Adyen webhooks, add the following Adyen extension\u00a0to the\u00a0<strong>config\/localextensions.xml<\/strong>\u00a0file:<\/p>\n<pre><code class=\"language-xml\">    &lt;extension dir=\"${HYBRIS_BIN_DIR}\/custom\/adyen-hybris\/adyenv6notification\"\/&gt;<\/code><\/pre>\n<p>After you have added the notification extension, <a href=\"\/plugins\/hybris\/set-up-the-add-on#server-notification-settings\">set up webhooks in your Adyen Customer Area<\/a>.<\/p>","url":"https:\/\/docs.adyen.com\/plugins\/hybris\/set-up-the-occ-extension","articleFields":{"description":"Set up the SAP Omni Commerce Connect (OCC) extension in the Adyen payments add-on.","next_steps":[{"title":"Test your integration","description":"Use our test card numbers to make test payments.","url":"\/development-resources\/test-cards-and-credentials\/test-card-numbers","required":true},{"title":"Configure your live account","description":"Follow this checklist before you start accepting live payments.","url":"\/plugins\/hybris\/go-live-checklist","required":true}],"last_edit_on":"01-07-2019 14:57"},"algolia":{"url":"https:\/\/docs.adyen.com\/plugins\/hybris\/set-up-the-occ-extension","title":"Set up the OCC extension","content":"The Adyen payments add-on supports SAP Omni Commerce Connect (OCC) V2 through com.adyen.v6.facades.AdyenCheckoutFacade.\nWith this integration, you can accept:\n\nCredit cards, including shopper-present recurring payments and installments\nBoleto\n\nThe add-on supports the following methods:\nReturn the stored cards associated with the shopping cart\n\nOCC controller: UsersController.getPaymentInfos\nEndpoint: GET \/{USER_ID}\/paymentdetails\n\nInternally, this calls the following method:\nPaymentDetailsListWsDTO getPaymentDetails(String userId) throws IOException, ApiException;\nReceive and store payment details\n\nOCC controller: CartsController.addPaymentDetails\nEndpoint: POST \/{CART_ID}\/paymentdetails\n\nDepending on the payment method, you may need to pass some additional parameters:\n\nCredit cards: Encrypted cardholder data. For more information, refer to Cards.\nStored cards: The recurringDetailReference, the shopperReference, and the encrypted CVC. For more information, refer to Tokenization.\nInstallments: The number of installments. For more information, refer to Credit cards.\nBoleto: The social security number. For more information, refer to Boleto.\n\nFor example, to make an installments payment and store credit card details, submit a POST \/{CART_ID}\/paymentdetails request, providing:\n{\n   \"encryptedCardNumber\": \"adyenjs_0_1_1 ...\",\n   \"encryptedExpiryMonth\": \"adyenjs_0_1_1 ...\",\n   \"encryptedExpiryYear\": \"adyenjs_0_1_1 ...\",\n   \"encryptedSecurityCode\": \"adyenjs_0_1_1 ...\",\n   \"installments\": \"10\",\n        \"saveCardData\": true,\n        \"accountHolderName\": \"ABC\",\n        \"cardNumber\": \"4111111111111222\",\n        \"expiryMonth\": \"03\",\n        \"expiryYear\": \"2030\",\n        \"cardType\" : {\"code\": \"visa\"},\n        \"adyenPaymentMethod\": \"adyen_cc\",\n        \"billingAddress\" : {\n            \"titleCode\": \"mr\",\n            \"firstName\": \"Joao\",\n            \"lastName\": \"Paulo\",\n            \"line1\": \"Rua Luiz Fernandes\",\n            \"town\": \"SJC\",\n            \"postalCode\": \"12236750\",\n            \"country\": {\"isocode\": \"BR\"},\n            \"shippingAddress\": true,\n            \"region\" : {\n                \"countryIso\" : \"BR\",\n                \"isocode\": \"SP\",\n                \"name\": \"Sao Paulo\"\n            }\n        }\n   }\nInternally, this calls the following method:\nPaymentDetailsWsDTO addPaymentDetails(PaymentDetailsWsDTO paymentDetails, DataMapper dataMapper);\nPlace an order using stored payment details\nAfter storing payment information using the above methods, you can place an order:\n\nOCC controller: OrdersController.placeOrder\nEndpoint: POST \/users\/{USER_ID}\/orders\n\nInternally, this calls the following method:\nOrderData authorisePayment(CartData cartData) throws Exception;\nAfter a successful response from the Adyen API, the system registers the payment response on the cart\/order level. It returns an instance of OrderWSDTO obtained from OrderData of the placed order.\nFor Boleto, the response contains the URL to the PDF, the Base64 encoded data, the expiration date, and the due date.\nSet up the notification extension\nIf you want to receive Adyen webhooks, add the following Adyen extension\u00a0to the\u00a0config\/localextensions.xml\u00a0file:\n    &lt;extension dir=\"${HYBRIS_BIN_DIR}\/custom\/adyen-hybris\/adyenv6notification\"\/&gt;\nAfter you have added the notification extension, set up webhooks in your Adyen Customer Area.","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Plugins","lvl2":"SAP Commerce (Hybris)","lvl3":"Set up the OCC extension"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/plugins","lvl2":"https:\/\/docs.adyen.com\/plugins\/hybris","lvl3":"\/plugins\/hybris\/set-up-the-occ-extension"},"levels":4,"category":"Plugins","category_color":"green","tags":["extension"]}}
