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
- Shoppers select GiroPay as a payment option in the checkout interface you provide to them.
- Create the order object. Use “GIROPAY” as the type of the PaymentDetails object.
- Use the placeOrder method to send the data to 2Checkout.
- 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 GET request) and add the parameters (located in the Params object) as key-value pairs to the URL of the request.
- 2Checkout returns an Order object as the output of the placeOrder method.
- Once you place the order, 2Checkout logs it into the system. At this point in time, the status of the order is PENDING.
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. |
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 require ('PATH_TO_AUTH'); $Order = new stdClass(); $Order->RefNo = NULL; $Order->Currency = "EUR" ; $Order->Country = "DE"; $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 = "DE"; $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 = "EUR" ; $Order->PaymentDetails->HadPayPalToken = false; $Order->PaymentDetails->CustomerIP = '10.5.22.197'; $Order->PaymentDetails->PaymentMethod = new stdClass (); $jsonRpcRequest = array ( 'method' => 'placeOrder', 'params' => array($sessionID, $Order), 'id' => $i++, 'jsonrpc' => '2.0' ); $output = callRPC($jsonRpcRequest, $host); var_dump($output);
Response Parameters
Parameter | Type/Description |
---|---|
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>