Create a subcontract

Before a new project goes into the financing round it's necessary that the project owner (company or private individual) was previously created in secupay system and was identified.

For this purpose, it's necessary to transfer the general contact details of the project owner and the bank account to which the money will be transferred after the successful financing round.

In addition, it's possible to customize the the Payment-IFrame (the web page where the supporter enters his payment data) at this point.

PHP-SDK

Request
// Create Project
/**
 * @var \SecucardConnect\Product\Payment\ContractsService $service
 */
$service = $secucard->payment->contracts;
 
$project = new \SecucardConnect\Product\Payment\Model\CreateSubContractRequest();
$project->project = 'Project-Name #' . time(); // must be unique
$project->payin_account = true;
 
$project->contact = new \SecucardConnect\Product\Common\Model\Contact();
$project->contact->gender = 'm';
$project->contact->salutation = 'Mr.';
$project->contact->title = 'Dr.';
$project->contact->forename = 'John';
$project->contact->surname = 'Doe';
$project->contact->companyname = 'Example Inc.';
$project->contact->nationality = 'DE';
$project->contact->dob = '1901-02-03';
$project->contact->phone = '0049123456789';
$project->contact->email = 'mail@example.com';
$project->contact->address = new \SecucardConnect\Product\Common\Model\Address();
$project->contact->address->street = 'Example Street';
$project->contact->address->atreet_number = '6a';
$project->contact->address->postal_code = '01234';
$project->contact->address->city = 'Examplecity';
$project->contact->address->country = 'DE';
$project->contact->birthplace = 'Examplecity';
$project->contact->url_website = 'example.com';
 
$project->payout_account = new \SecucardConnect\Product\Payment\Model\Data();
$project->payout_account->iban = 'DE37503240001000000524';
$project->payout_account->owner = 'Joe Black';
 
$project->iframe_opts = new \SecucardConnect\Product\Payment\Model\IframeOptData();
$project->iframe_opts->show_basket = true;
$project->iframe_opts->basket_title = 'Projext XY unterstützen';
$project->iframe_opts->submit_button_title = 'Zahlungspflichtig unterstützen';
 
$project_response = $service->createSubContract($project);
parameters
  • contact - Contract data of the project owner
    • gender - Gender (m, f)
    • salutation - Salutation, such as "Mr." / "Ms."
    • title - Title (academic), eg: "Dr.", "Dr. med.", "Dipl.-Ing.", "Dipl.-Inf.", "Dipl.-Kauf", "e. Kfm", "Prof."
    • nationality - Nationality → format according to standard: ISO 3166-1 alpha-2 code, for example: "DE"
    • dob - Date of birth → format: YYYY-MM-DD, eg 1980-05-26
    • phone - Phone number → format according to standard: ITU-T E.123, eg: +49123456789
    • companyname - Company name (Optional for private individuals)
  • address - Contract Address
    • street - Street
    • street_number - Number (Optional, this can be alternatively served by the street parameter)
    • country - Country → format according to standard: ISO 3166-1 alpha-2 code, for example: "DE"
  • payout_account - Bank account to which the transactions will be transferred
  • project - Project name (must be unique)
  • iframe_opts - Defines a list of parameters to customize the Payment-IFrame (If not transmitted, the parameters will be coppied from the parent contract)
    • show_basket - Should th basket be shown in the iframe? true / false
    • basket_title - The title of the basket
    • submitbuttontitle - The text of the Submit button
    • logo_base64 - A customized logo for the Iframe (as base64 representation)
    • cession - Address of the customer. 'personal' or 'formal'
  • payin_account - Create a virtual bank account for pay-in operations? (Requires a corresponding activation of this option of the contract.)
Response
SecucardConnect\Product\Payment\Model\CreateSubContractResponse Object
(
    [apikey] => 63f2de47a7ca32e5de8f72d7f8d72ebd003eb069
    [contract] => SecucardConnect\Product\Payment\Model\Contract Object
        (
            [created] => DateTime Object
                (
                    [date] => 2017-04-28 11:46:19.000000
                    [timezone_type] => 1
                    [timezone] => +02:00
                )
 
            [updated] =>
            [parent] => SecucardConnect\Product\Payment\Model\Contract Object
                (
                    [created] =>
                    [updated] =>
                    [parent] =>
                    [allow_cloning] =>
                    [id] => PCR_2BKJSSECG2M80HUB875XUPXV7M8UA6
                    [object] => payment.contracts
                )
 
            [allow_cloning] =>
            [id] => PCR_3AYQR6T272M83WTYX75XU8CZNM8UA7
            [object] => payment.contracts
        )
 
    [payin_account] =>
)

Note: The generated API-Key is only needed for the use in the old "flex.API".

In the response object there is a so-called "Contract-ID". This is will be needed for the specification of the stakeholders in the payment transaction and have to be stored in your system after creation. By specifying the stakeholders the secupay system knows to which accounts the interests needs to be pay-out.