Skip to content

Commit

Permalink
Merge pull request #282 from blockchyp/feature/CHYP-3620
Browse files Browse the repository at this point in the history
Added merchant application submission
  • Loading branch information
devops-blockchyp committed Sep 17, 2024
1 parent d99ef45 commit 35bd131
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4410,6 +4410,7 @@ client = blockchyp.Client(

# populate request parameters.
request = {
"merchantId": "<MERCHANT ID>",
}

# run the transaction.
Expand All @@ -4420,6 +4421,55 @@ print("Response: %r" % response)

```

#### Submit Application



* **API Credential Types:** Partner
* **Required Role:** INVITE MERCHANT

This is a partner level API that can be used to submit applications to add new merchant accounts. The application requires a significant amount of detailed information about the merchant and their business. Rather than providing an exhaustive list of required fields, we recommend submitting as much information as possible in your initial request.

If any required fields are missing or if there are any validation errors, the API will return specific error messages indicating which fields need to be addressed. Simply review these validation errors, fill in the missing information or correct any errors, and resubmit the application.

Key areas of information include:
- Business details (name, type, tax information)
- Contact information
- Address information (physical and mailing)
- Owner details
- Bank account information
- Transaction volume estimates
- Operational settings (timezone, batch close time, etc.)

**Note:** Some fields may be conditionally required based on the values of other fields. The validation process will guide you through ensuring all necessary information is provided.




```python
import os

import blockchyp

# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)

# populate request parameters.
request = {
}

# run the transaction.
response = client.submit_application(request)

print("Response: %r" % response)


```




Expand Down
10 changes: 10 additions & 0 deletions blockchyp/blockchyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,16 @@ def merchant_credential_generation(self, request):
body=request,
)

def submit_application(self, request):
# type: (dict) -> dict
"""Submits and application to add a new merchant account."""

return self._dashboard_request(
method="POST",
path="/api/submit-application",
body=request,
)

def get_merchants(self, request):
# type: (dict) -> dict
"""Adds a test merchant account."""
Expand Down
1 change: 1 addition & 0 deletions examples/merchant_credential_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# populate request parameters.
request = {
"merchantId": "<MERCHANT ID>",
}

# run the transaction.
Expand Down
19 changes: 19 additions & 0 deletions examples/submit_application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os

import blockchyp

# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)

# populate request parameters.
request = {
}

# run the transaction.
response = client.submit_application(request)

print("Response: %r" % response)
123 changes: 123 additions & 0 deletions tests/integration/submit_application_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is
# governed by a license that can be found in the LICENSE file.
#
# This file was generated automatically by the BlockChyp SDK Generator. Changes
# to this file will be lost every time the code is regenerated.
import os
import os.path
import time
import uuid
import pkg_resources

import pytest

import blockchyp

from .util import _get_test_client, _get_test_config


@pytest.mark.itest
def test_submit_application():
"""Can submit an application to add a new merchant."""


terminal = _get_test_config().get("defaultTerminalName")


client = _get_test_client("partner")

request = {
"test": True,
"inviteCode": "asdf",
"dbaName": "BlockChyp",
"corporateName": "BlockChyp Inc.",
"webSite": "https://www.blockchyp.com",
"taxIdNumber": "123456789",
"entityType": "CORPORATION",
"stateOfIncorporation": "UT",
"merchantType": "RETAIL",
"businessDescription": "Payment processing solutions",
"yearsInBusiness": "5",
"businessPhoneNumber": "5555551234",
"physicalAddress": {
"address1": "355 S 520 W",
"city": "Lindon",
"stateOrProvince": "UT",
"postalCode": "84042",
"countryCode": "US",
},
"mailingAddress": {
"address1": "355 S 520 W",
"city": "Lindon",
"stateOrProvince": "UT",
"postalCode": "84042",
"countryCode": "US",
},
"contactFirstName": "John",
"contactLastName": "Doe",
"contactPhoneNumber": "5555555678",
"contactEmail": "john.doe@example.com",
"contactTitle": "CEO",
"contactTaxIdNumber": "987654321",
"contactDOB": "1980-01-01",
"contactDlNumber": "D1234567",
"contactDlStateOrProvince": "NY",
"contactDlExpiration": "2025-12-31",
"contactHomeAddress": {
"address1": "355 S 520 W",
"city": "Lindon",
"stateOrProvince": "UT",
"postalCode": "84042",
"countryCode": "US",
},
"contactRole": "OWNER",
"owners": [
{
"firstName": "John",
"lastName": "Doe",
"jobTitle": "CEO",
"taxIdNumber": "876543210",
"phoneNumber": "5555559876",
"dob": "1981-02-02",
"ownership": "50",
"email": "john.doe@example.com",
"dlNumber": "D7654321",
"dlStateOrProvince": "UT",
"dlExpiration": "2024-12-31",
"address": {
"address1": "355 S 520 W",
"city": "Lindon",
"stateOrProvince": "UT",
"postalCode": "84042",
"countryCode": "US",
},
},
],
"manualAccount": {
"name": "Business Checking",
"bank": "Test Bank",
"accountHolderName": "BlockChyp Inc.",
"routingNumber": "124001545",
"accountNumber": "987654321",
},
"averageTransaction": "100.00",
"highTransaction": "1000.00",
"averageMonth": "10000.00",
"highMonth": "20000.00",
"refundPolicy": "30_DAYS",
"refundDays": "30",
"timeZone": "America/Denver",
"batchCloseTime": "23:59",
"multipleLocations": "false",
"ebtRequested": "false",
"ecommerce": "true",
"cardPresentPercentage": "70",
"phoneOrderPercentage": "10",
"ecomPercentage": "20",
"signerName": "John Doe",
}

response = client.submit_application(request)
print("Response: %r" % response)

assert response.get("success") is True

0 comments on commit 35bd131

Please sign in to comment.