-
Notifications
You must be signed in to change notification settings - Fork 64
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
Bulk credits sweep account #707
Conversation
"format": "uri", | ||
"pattern": "/accounts/{accounts.id}/debits" | ||
}, | ||
"accounts.transfers": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean to keep transfers in the spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Copied from the original PR.
|
||
Scenario: Bulk credit to sweep account | ||
Given I have a merchant with 2 orders with debits | ||
When I POST to /bank_accounts/:bank_account_id/sweep_account with the body: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does every bank account get a sweep_account
associated with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do debits work from a bank account that has a sweep_account
associated with it?
i think the reason we went with transfers as opposed to credit/debits for these transactions is this: you created a credit to the sweep account from order /orders/123123. with a transfer all you see is a transfer, it's omnidirectional it had a source of the order balance and a destination of the sweep account. |
}] | ||
} | ||
""" | ||
Then I should get a 409 status code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently this is a 400
curl https://api.balancedpayments.com/debits -H "Accept: application/vnd.api+json;revision=1.1" -u ak-test-D4i8c5COSld5I3XkSkXIUBLtGhpN6X67: -d "appears_on_statement_as=Statement text" -d "amount=5000" -d "description=Some descriptive text for the debit in the dashboard"
{
"errors": [
{
"status": "Bad Request",
"category_code": "request",
"additional": null,
"status_code": 400,
"category_type": "request",
"extras": {
"source": "Missing required field [source]"
},
"request_id": "OHM61d85cea597611e4bc0006429171ffad",
"description": "Missing required field [source] Your request id is OHM61d85cea597611e4bc0006429171ffad."
}
]
}
looking 👍 @remear. |
@remear is
it sounds very generic and the same term could apply to several of the funding instruments within the Balanced API. |
Let's refer to it as |
I had a bit of a deeper think about this spec, here's what I think we need to flesh out:
@remear can you please implement the reversal and debit settlement scenarios in this pull-request? thanks! :) |
@mjallday We may be using different words to describe the same thing ... I suggest reversal should still happen against the account even if it means that the balance of the account becomes negative. That allows the marketplace to net the reversal against future credits or perform a settlement of a negative amount. on retrying ... keep it explicit—no automatic retry. Why does a settlement have to be treated like a transaction to work? |
@@ -84,6 +84,14 @@ | |||
"string" | |||
], | |||
"pattern": "BZ[a-zA-Z0-9]{16,32}" | |||
}, | |||
"sweep_account": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here/necessary?
needs the following on the marketplaces. diff --git a/fixtures/marketplaces.json b/fixtures/marketplaces.json
index 79cc9cf..8ced423 100644
--- a/fixtures/marketplaces.json
+++ b/fixtures/marketplaces.json
@@ -70,6 +70,16 @@
"type": "string",
"format": "uri",
"pattern": "/disputes"
+ },
+ "marketplaces.settlements": {
+ "type": "string",
+ "format": "uri",
+ "pattern": "/settlements"
+ },
+ "marketplaces.accounts": {
+ "type": "string",
+ "format": "uri",
+ "pattern": "/accounts"
}
},
"required": [
@@ -84,6 +94,8 @@
"marketplaces.callbacks",
"marketplaces.card_holds",
"marketplaces.orders",
+ "marketplaces.settlements",
+ "marketplaces.accounts",
"marketplaces.disputes"
]
}, |
…nced-api into bulk-credits-sweep-account
…ersals and settlements features
…o allow destinatin and source to be either bank account or account
Missing scenarios
#707 (comment)
Missing features