OroApruveBundle
Table of Contents
Description:
OroApruveBundle provides Apruve payment method integration, which means the following:
- Apruve integration type
- Apruve payment method which can be used in checkout process
Technical Components:
- Integration type:
Oro\Bundle\ApruveBundle\Integration\ApruveChannelType
Oro\Bundle\ApruveBundle\Integration\ApruveTransport
- Payment method:
Oro\Bundle\ApruveBundle\Method\ApruvePaymentMethod
- see namespace
Oro\Bundle\ApruveBundle\Method\PaymentAction
for concrete payment method actions implementations
- Apruve-specific models and builders for them:
- see namespaces
Oro\Bundle\ApruveBundle\Apruve\Model
andOro\Bundle\ApruveBundle\Apruve\Builder
- Apruve rest client:
-
Oro\Bundle\ApruveBundle\Client\ApruveRestClient
- works withRestClientFactoryInterface
under the hood -
Oro\Bundle\ApruveBundle\Client\Request\ApruveRequest
- request DTO
- Apruve webhooks:
-
Oro\Bundle\ApruveBundle\Controller\WebhookController
- entry point of webhooks processing. -
Oro\Bundle\ApruveBundle\EventListener\Callback\PaymentCallbackListener
- handles "return" payment event, which is triggered when user authorises a payment. Delegates further processing toOro\Bundle\ApruveBundle\Method\PaymentAction\AuthorizePaymentAction
.
PaymentTransactions Lifecycle:
-
PaymentTransaction 1 is created in
Oro\Bundle\ApruveBundle\Method\PaymentAction\PurchasePaymentAction
when a customer clicks Submit on the last step of checkout process. -
If a customer authorises payment in Apruve lightbox, PaymentTransaction 1 is updated with Apruve Order Id and is marked as successful in
Oro\Bundle\ApruveBundle\Method\PaymentAction\AuthorizePaymentAction
. Otherwise - nothing is changed. -
Once a payment is authorized, it can be invoiced using "Send Invoice" button in admin area on Order view page in the "Payment History" section. When you click "Send Invoice", PaymentTransaction 2 is getting created along with Apruve Invoice in
Oro\Bundle\ApruveBundle\Method\PaymentAction\InvoicePaymentAction
. As soon as Apruve Invoice is created successfully, PaymentTransaction 3 is getting created along with Apruve Shipment entity inOro\Bundle\ApruveBundle\Method\PaymentAction\ShipmentPaymentAction
. -
When a customer fulfils invoice, Apruve notifies about it via webhook
invoice.closed
which is getting processed starting from inOro\Bundle\ApruveBundle\Controller\WebhookController
. In case of success, PaymentTransaction 4 is created and marked as successful. If a customer does not pay for Apruve Invoice in time, it is being marked as overdue and silently canceled on Apruve side.
Things to Consider:
-
Apruve does not properly respect
price_total_cents
property of Apruve LineItem - it is not taken into account when secure hash is being generated from Apruve Order on Apruve side, though Apruve takesamount_cents
(see Merchant Integration Tutorial). That's why it was decided (and approved by Apruve Support) to useamount_cents
property in Apruve LineItem entity. SeeOro\Bundle\ApruveBundle\Apruve\Builder\LineItem\ApruveLineItemBuilder
andOro\Bundle\ApruveBundle\Apruve\Generator\OrderSecureHashGenerator
for details. On the other hand,price_total_cents
is required for the line items which reside in Apruve Invoice, that is why both of these properties are present in Apruve LineItem entity. -
Apruve wants to be notified about shipments from merchants who sell physical goods, but does not for other merchant types. Due to this fact it will not fulfil invoices in cases when it was not notified of shipment (when Shipment entity is not created via API) for merchants of physical goods. In order to unify the behavior for all types of merchants, it was decided to always notify Apruve about shipment, no matter goods of what type are sold. Shipment entity is created in Apruve along with Invoice entity when "Send Invoice" button is clicked on Order view page in the "Payment History" section.
FAQ:
Is customer being forwarded to the Apruve-hosted payment page during checkout process?
No, whole checkout process is being done without leaving commerce application. User has to authorise payment in Apruve popup (lightbox) on the last step.
How can I login/register in Apruve sandbox?
You have to ask Apruve Support (support@apruve.com) for test merchant and buyer account.
I have a corporate Apruve account, but it is not accepted during checkout process
Corporate accounts differ. You should have a corporate account associated exactly with the merchant account you are trying to deal with.