Skip to main content
knowledgecenter.2checkout.com

Use GiroPay

Overview

GiroPay is an online banking-based payment method for users in Germany. GiroPay supports online payments via secure online transfers directly between bank accounts. GiroPay accounted for a share of 2% of online payments in Germany in 2019.

Supported currencies

GiroPay is restricted to Germany and supports transactions in EUR.

Workflow

  1. Shoppers select GiroPay as a payment option in the checkout interface you provide to them.
  2. Create the order object. Use “GIROPAY” as the type of the PaymentDetails object.
  3. Use the placeOrder method to send the data to 2Checkout.
  4. Once you place the order, 2Checkout logs it into the system. At this point in time, the status of the order is PENDING.
  5. 2Checkout returns an Order object as the output of the placeOrder method. 
  6. Use the PaymentMethod object to create a redirect URL for the shoppers. Using the provided URL, make a request using the provided method (usually a POST request) and add the parameters (located in the Params object) as key-value pairs to the body of the request. 

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Order

Required (Object)

 

Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

See code sample for more details. 

Request Example 

 <?php
// Api Name & Method
$apiName = ' '.'placeOrderwithGiropay';

include('Config.php');
// Grab Config Values
$config = new ConfigScripts();
$apiVersion = '6.0';
// $host = 'http://api.sandbox' . $config->SandboxNr . '.avangate.local/soap/' . $apiVersion . "/";
$host = "http://api.wwwtest34.dev.corp.2co.com:8081/soap/$apiVersion/";

$client = $config->soapClient($host);
$sessionID = $config->soapLogin($host);


print_r("session: ". $sessionID . "\n");
print_r($host);


    print "\n\n**********************";
    print "\nAPI:".$apiName;
    print "\nAPI Version:"."$apiVersion";
    print "\nProtocol: SOAP";
    print "\n\n**********************\n";


$defaultCountry = "DE";
$Currency = "EUR";

$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = $Currency ;
$Order->Country = $defaultCountry;
$Order->Language = 'EN';
$Order->CustomerIP = '10.5.22.197';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->AffiliateId = NULL;
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = '67B4EDC822';
$Order->Items[0]->Quantity = 1;
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false;
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->SubscriptionStartDate = NULL; //If empty or null, subscriptions become active when purchase is made.
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'John';
$Order->BillingDetails->LastName = 'Doe';
$Order->BillingDetails->CountryCode = $defaultCountry;
$Order->BillingDetails->State = 'Espírito Santo';
$Order->BillingDetails->City = 'City';
$Order->BillingDetails->Address1 = '-';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '1111111';
$Order->BillingDetails->Email = 'brazil1@2checkout.com';
$Order->BillingDetails->Phone = '123432323212';
$Order->BillingDetails->Company = 'blank';






$Order->DeliveryDetails = new stdClass();
$Order->DeliveryDetails->FirstName = 'John';
$Order->DeliveryDetails->LastName = 'Doe';
$Order->DeliveryDetails->CountryCode = 'NZ';
$Order->DeliveryDetails->State = 'Espírito Santo';
$Order->DeliveryDetails->City = 'City';
$Order->DeliveryDetails->Address1 = '-';
$Order->DeliveryDetails->Address2 = NULL;
$Order->DeliveryDetails->Zip = '1111111';
$Order->DeliveryDetails->Email = 'brazil1@2checkout.com';
$Order->DeliveryDetails->Phone = '123432323212';
$Order->DeliveryDetails->Company = NULL;
$Order->PaymentDetails = new stdClass ();

$Order->PaymentDetails->Type = 'GIROPAY';
$Order->PaymentDetails->Currency = $Currency ;
$Order->PaymentDetails->HadPayPalToken = false;
$Order->PaymentDetails->CustomerIP = '10.5.22.197';

$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;
// $CartObj->PaymentDetails->PaymentMethod->CardNumberTime = 1;
/**/

if ($Order->PaymentDetails->Type == 'PREVIOUS_ORDER') {
    $Order->ExternalReference ='orderbyref_exteranalref' . $Order->PaymentDetails->PaymentMethod->RefNo;
} else if ($Order->PaymentDetails->Type == 'PAYPAL') {
    $Order->ExternalReference ='orderbyref_exteranalref_PAYPAL';
}
/**/ // end building $CartObj

try {
    $order = $client->placeOrder($sessionID, $Order);
    var_dump(json_encode($order, JSON_PRETTY_PRINT));

} catch (SoapFault $e) {
    echo  $e->getMessage();
}
// var_dump(json_encode($order, JSON_PRETTY_PRINT));

Response Parameters

Parameter Type/Description

Order information

Object

  Object containing order information.

Response Example


class stdClass#9 (51) {
public $RefNo =>
string(8) "11796010"
public $OrderNo =>
int(0)
public $ExternalReference =>
NULL
public $ShopperRefNo =>
NULL
public $Status =>
string(7) "PENDING"
public $ApproveStatus =>
string(7) "WAITING"
public $VendorApproveStatus =>
string(2) "OK"
public $MerchantCode =>
string(7) "NCR_MCD"
public $Language =>
string(2) "en"
public $OrderDate =>
string(19) "2019-11-21 17:38:55"
public $FinishDate =>
NULL
public $Source =>
string(13) "sourceAPI.net"
public $Affiliate =>
class stdClass#10 (4) {
public $AffiliateCode =>
NULL
public $AffiliateSource =>
NULL
public $AffiliateName =>
NULL
public $AffiliateUrl =>
NULL
}
public $HasShipping =>
bool(false)
public $BillingDetails =>
class stdClass#11 (13) {
public $FiscalCode =>
NULL
public $TaxOffice =>
NULL
public $Phone =>
string(5) "12345"
public $FirstName =>
string(18) "Api First Name Bil"
public $LastName =>
string(17) "Api Last Name Bil"
public $Company =>
NULL
public $Email =>
string(20) "shopper@avangate.com"
public $Address1 =>
string(13) "Acasa Api Bil"
public $Address2 =>
string(14) "Acasa Api Bil2"
public $City =>
string(4) "Acre"
public $Zip =>
string(5) "12345"
public $CountryCode =>
string(2) "de"
public $State =>
string(4) "Acre"
}
public $DeliveryDetails =>
class stdClass#12 (11) {
public $Phone =>
string(5) "12345"
public $FirstName =>
string(18) "Api First Name Bil"
public $LastName =>
string(17) "Api Last Name Bil"
public $Company =>
NULL
public $Email =>
string(20) "shopper@avangate.com"
public $Address1 =>
string(13) "Acasa Api Bil"
public $Address2 =>
string(14) "Acasa Api Bil2"
public $City =>
string(4) "Acre"
public $Zip =>
string(5) "12345"
public $CountryCode =>
string(2) "de"
public $State =>
string(4) "Acre"
}
public $PaymentDetails =>
class stdClass#13 (4) {
public $Type =>
string(5) "OTHER"
public $Currency =>
string(3) "eur"
public $PaymentMethod =>
class stdClass#14 (6) {
public $Amount =>
string(3) "0.1"
public $Currency =>
string(3) "eur"
public $Redirect =>
class stdClass#15 (4) {
public $Url =>
string(37) "https://www.skrill.com/app/payment.pl"
public $Method =>
string(3) "GET"
public $Params =>
class stdClass#16 (1) {
public $sid =>
string(32) "c8cabebe0db1c280864e9ae294d956e2"
}
public $FullHtml =>
string(288) "<!DOCTYPE html><html><body><form action="https://www.skrill.com/app/payment.pl" method="GET" id="postform"><input type="hidden" name="sid" value="c8cabebe0db1c280864e9ae294d956e2" /></form><script type="text/javascript">document.getElementById(
        "postform").submit();</script></body></html>
  • Was this article helpful?