Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Adyen Magento2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared Libs
Adyen Magento2
Commits
46d822fc
Commit
46d822fc
authored
Dec 21, 2018
by
Rik ter Beek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error caused by rebase
parent
51567726
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
51 deletions
+0
-51
Helper/Data.php
Helper/Data.php
+0
-51
No files found.
Helper/Data.php
View file @
46d822fc
...
...
@@ -1351,8 +1351,6 @@ class Data extends AbstractHelper
{
return
new
\Adyen\Service\PosPayment
(
$client
);
}
return
$client
;
}
/**
* @return \Adyen\Client
...
...
@@ -1447,53 +1445,4 @@ class Data extends AbstractHelper
return
self
::
CHECKOUT_COMPONENT_JS_LIVE
;
}
public
function
createAdyenBillingAgreement
(
$order
,
$additionalData
){
$storeId
=
$order
->
getStoreId
();
$customerReference
=
$order
->
getCustomerId
();
$listRecurringContracts
=
null
;
try
{
// Get or create billing agreement
$billingAgreement
=
$this
->
_billingAgreementFactory
->
create
();
$billingAgreement
->
load
(
$additionalData
[
'recurring.recurringDetailReference'
],
'reference_id'
);
// check if BA exists
if
(
!
(
$billingAgreement
&&
$billingAgreement
->
getAgreementId
()
>
0
&&
$billingAgreement
->
isValid
()))
{
// create new
$this
->
adyenLogger
->
addNotificationLog
(
"Creating new Billing Agreement"
);
$billingAgreement
=
$this
->
_billingAgreementFactory
->
create
();
$billingAgreement
->
setStoreId
(
$order
->
getStoreId
());
$billingAgreement
->
importOrderPayment
(
$order
->
getPayment
());
$message
=
__
(
'Created billing agreement #%1.'
,
$additionalData
[
'recurring.recurringDetailReference'
]);
}
else
{
$billingAgreement
->
setIsObjectChanged
(
true
);
$message
=
__
(
'Updated billing agreement #%1.'
,
$additionalData
[
'recurring.recurringDetailReference'
]);
}
// Populate billing agreement data
$billingAgreement
->
setCcBillingAgreement
(
$additionalData
);
if
(
$billingAgreement
->
isValid
())
{
// save into sales_billing_agreement_order
$billingAgreement
->
addOrderRelation
(
$order
);
// add to order to save agreement
$order
->
addRelatedObject
(
$billingAgreement
);
}
else
{
$message
=
__
(
'Failed to create billing agreement for this order.'
);
throw
new
\Exception
(
$message
);
}
}
catch
(
\Exception
$exception
)
{
$message
=
$exception
->
getMessage
();
$this
->
adyenLogger
->
addAdyenDebug
(
"exception: "
.
$message
);
}
$comment
=
$order
->
addStatusHistoryComment
(
$message
);
$order
->
addRelatedObject
(
$comment
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment