Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adyen: Support preAuths and Synchronous Adjusts #3212

Conversation

curiousepic
Copy link
Contributor

Allows passing of authorisationType PreAuth to enable Adjusts to be made
on Auths, and allows passing of adjustAuthorisationData from responses
to support Synchronous Adjusts - this requires Adyen to set your account
to Synchronous Adjust mode.

Remote:
60 tests, 187 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Unit:
37 tests, 179 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Allows passing of authorisationType PreAuth to enable Adjusts to be made
on Auths, and allows passing of adjustAuthorisationData from responses
to support Synchronous Adjusts - this requires Adyen to set your account
to Synchronous Adjust mode.

Remote:
60 tests, 187 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Unit:
37 tests, 179 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
@curiousepic curiousepic requested a review from a team May 9, 2019 14:41
response['response'] == "[#{action}-received]"
when 'adjustAuthorisation'
response['response'] == 'Authorised' || response['response'] == '[adjustAuthorisation-received]'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first condition is true for sync mode, the second for default/async.

@@ -174,6 +175,9 @@ def add_extra_data(post, payment, options)
post[:additionalData][:overwriteBrand] = normalize(options[:overwrite_brand]) if options[:overwrite_brand]
post[:additionalData][:customRoutingFlag] = options[:custom_routing_flag] if options[:custom_routing_flag]
post[:additionalData]['paymentdatasource.type'] = NETWORK_TOKENIZATION_CARD_SOURCE[payment.source.to_s] if payment.is_a?(NetworkTokenizationCreditCard)
post[:additionalData][:authorisationType] = options[:authorisation_type] if options[:authorisation_type]
post[:additionalData][:adjustAuthorisationData] = options[:adjust_authorisation_data] if options[:adjust_authorisation_data]
post[:additionalData][:RequestedTestAcquirerResponseCode] = options[:requested_test_acquirer_response_code] if options[:requested_test_acquirer_response_code] && test?
Copy link
Contributor Author

@curiousepic curiousepic May 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to explicitly invoke specific response codes; actually a pretty nice sandbox feature compared to others.

@molbrown
Copy link
Contributor

molbrown commented May 9, 2019

For async, is there a follow-up message after the received Adjust succeeds? 🤔

@curiousepic
Copy link
Contributor Author

Not built-in. The same is true for refunds that are technically async; we still return the confirmation of receipt as a success.

@curiousepic
Copy link
Contributor Author

curiousepic commented May 9, 2019

To clarify, Adyen does send a confirmation of finalization via their own notification/callback system, but we can't handle that in AM.

Copy link
Contributor

@molbrown molbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@curiousepic curiousepic deleted the ECS_310_adyen_adjust_data branch May 9, 2019 18:28
whitby3001 pushed a commit to whitby3001/active_merchant that referenced this pull request Sep 3, 2019
Allows passing of authorisationType PreAuth to enable Adjusts to be made
on Auths, and allows passing of adjustAuthorisationData from responses
to support Synchronous Adjusts - this requires Adyen to set your account
to Synchronous Adjust mode.

Closes activemerchant#3212

Remote:
60 tests, 187 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

Unit:
37 tests, 179 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants