Skip to content

Commit

Permalink
Contributing updated, comments added to combination example
Browse files Browse the repository at this point in the history
  • Loading branch information
Shu Chen committed Jul 19, 2022
1 parent 04eafcc commit 6e9baa2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@


### Contribution to refactoring:
- branch should be created from refactoring
- code changes should follow Magento2 coding standard
- include unit tests
- open the Pull Request
- check that git workflows checks have passed
6 changes: 6 additions & 0 deletions example/transactions/credit_management.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

$buckaroo = new Buckaroo($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']);

// Sometimes we need to combine multiple payments.
// By adding "manually," it will not execute immediately but rather return the built payload.
// With the returned payload, we can combine it with the next payment.

$invoice = $buckaroo->payment('credit_management')->manually()->createCombinedInvoice([
'invoice' => str_random(),
'applyStartRecurrent' => 'False',
Expand Down Expand Up @@ -51,6 +55,8 @@
]
]);

// In this case, we have the payload stored in the $invoice variable. We can now combine it with the next payment using the combine method

$response = $buckaroo->payment('sepadirectdebit')->combine($invoice)->pay([
'invoice' => uniqid(),
'amountDebit' => 10.10,
Expand Down

0 comments on commit 6e9baa2

Please sign in to comment.