Documentation
Code

Introduction

This documentation is designed to be a guideline for implementing the PayCheckout API in your application. Currently we support C# and PHP for implementing our API. For testing we offer a sandbox environment that is functionally identical with the live environment. By specifying a true or false in the API execution call you can select the environment you want to use.

Got a question? Send us an email at support@paycheckout.com

Setup step 1

  • Register a free account at https://portal.paycheckout.com.
  • Confirm your new account
  • From the "Main menu" select "Settings" and then "Apps"
  • Add an App (Note: your App will have an App Id and an App Password created)
  • Add a payment method, start easy and add iDEAL

Setup step 2

  • Download and install the demo application (windows platforms only!).
    Download Api Demo (windows)
    (This application is signed with PayCheckout B.V. and you can "trust" it's content)
  • Start the freshly installed program "Api Demo".
  • Enter the App Id and App password for the webshop you just created in Step 1, under "Connection data"
  • Enter a payment amount in the "Generic payment info" for example 10 Euro
  • Press the iDEAL button. If everything is working you should get redirected to the emulated iDEAL payment page.
    If the "API payment result" (blue) clickable links appear, feel free to click and view results, click the trace reference for example.
    When you check "Show source view" you can see what source code would be needed to accomplish the selected action!

Setup step 3

  • If you plan to work in C#, download the PayCheckout API using the NuGet package manager, search for "PayCheckoutApi". If you need a .NET version other than 4.0 use the source to create your own class library. The source is in the PayCheckoutApi.zip file in your package under the "source" folder.
  • If you plan to work in PHP, download the PayCheckout API PHP package here and you can find the PHP source code here.

Release notes

Date modified Version Notes
8 Nov 2017 1.2.0.3
  • The data GetAvailablePayments is returning is enriched with user preferred choices thru BigData techniques being applied.
  • Hosted payment pages behaviour is controlled by users history, meaning preferred paymentmethods are sorted in the most likely way the user will use it. This includes the bankselection when using iDEAL payments
  • Now hosted payments can be cancelled by the user by clicking the link at the bottom of the hosted paymentpage. This also introduces a new state hostedpages can end up with, namely "Cancelled" also a paymentstatus change notification will be send. This new state will be entered only from libversions 1.2.0.3 and upwards. This means that implementations that are not upgraded will not enter the new Cancelled state and are not affected.
  • Hosted pages that are started with a single paymentmethod and do not need user input will be redirected to the paymentmethod without the user having to press a "Pay" button. For example if you supply the "IssuingBank" parameter and start a hosted payment with only iDEAL in it, the customer will be redirected to the bank instantly.
2 Nov 2017 1.2.0.2
  • The data GetAvailablePayments is returning is expanded, it now can show iDEAL issuers and preferred methods.
  • CCV shop implementation now support fractional amounts and paymentmethod AfterPay.
  • Performing a deposit payment with iDEAL or SEPAbanktransfer is possible even when the method is not configured for live payments
11 Okt 2017 1.2.0.1
  • Bugfix when surcharge was added for PayPal and that payment failed and iDEAL was used as an alternative payment the surcharge was not removed.
  • Introduced new paymentstatuses: PaidUnexpectedAmount, PaidCancelledPayment, PaidExpiredPayment. See chapter statuses for more information.
  • Introduced payment method AfterPay.
21 Sept 2017 1.1.0.34
  • Added method GetAll to Customer Api.
  • Added fields WebshopId and CreateTimeUTC to PayCheckout.Api.Customer.Json.Get.
13 Sept 2017 1.1.0.33
  • SEPAdirectDebit now fills MerchantOrderReference with supplied description.
  • Added PaymentReference to SEPAdirectDebit result classes (C# and PHP).
  • Bugfix PHP lib: Fixed a bug (typo) in Json/Parameter/RefundCost.PHP (method getCostExclusiveVat()).
  • Introduced new branding logo/favicon in hostedpage
30 Aug 2017 1.1.0.32
  • Rebranding of sofort/klarna implemented
  • Bugfix PHP lib: Fixed a bug where Json/Parameter/RefundCost.PHP was not returing correct values for getCostInclusiveVat and getCostExclusiveVat.
  • Beta implementations of new Api's in transaction system
14 Aug 2017 1.1.0.31
  • Bugfix PHP lib: Bancontact could not be used as a paymentmethod for hosted payments (validation failed).
  • Change: New PHP lib released.
2 Aug 2017 1.1.0.31
  • Change: Bancontact live.
  • Change: Allowed orderdifference is now dynamicly related to ordered quantities instead of fixed 3 Eurocent, large difference do not fail payments only result in warnings.
  • Change: For bancontact information transactionInfo has a specific bancontact class.
  • Change: TransactionInfo expanded with attribute StatisticsSpecifier
5 July 2017 1.1.0.30
  • Libraries: Added SplitoutpaymentInfo and subclasses to PaymentInfo class to show detailed splitoutpayment information.
  • Change: Splitoutpayment->AddOutpayment has a parameter "TextOnBankStatement" added to specify what should be seen on the bankstatement in case no bundlekey is specified.
28 June 2017 1.1.0.29
  • Libraries: Added fields PamentReference,PaymentFlag to PaymentInfo, iDEALTxn in iDEAL specific info and intruduced CreditCard info.
  • Change: Payments can be executed without a notification url configured.
  • Change: Security for xss-improved.
  • Change: Sandbox now emulates bank for SEPAdirectdebit (incasso's)
8 June 2017 1.1.0.28
  • Change: Billingidentity has field SEPAdirectDebitIBAN for future Afterpay use.
  • Change: Notification certificates don't have to be fully trusted anymore, for example selfsigned certificates are allowed.
17 May 2017 1.1.0.27
  • Bugfix: PayPal payment fails if non integer quantity is specified for an order item.
  • Bugfix: Updateorder with non integer quantity fails on validation in library.
  • Change: Creditcard shows more information to user on what went wrong if payment fails.
  • Change: When iDEAL has no final status a more informative message is shown to the payer.
  • Change: Reversed change, Sofort paymentscreen now only shows merchantreference instead of PayCheckout specific reference and merchantreference.
  • Change: Customer API and SplitOutpayment API are public now
17 May 2017 1.1.0.27
  • Bugfix: PayPal payment fails if non integer quantity is specified for an order item.
  • Bugfix: Updateorder with non integer quantity fails on validation in library.
  • Change: Creditcard shows more information to user on what went wrong if payment fails.
  • Change: When iDEAL has no final status a more informative message is shown to the payer.
  • Change: Reversed change, Sofort paymentscreen now only shows merchantreference instead of PayCheckout specific reference and merchantreference.
  • Change: Customer API and SplitOutpayment API are public now
03 May 2017 1.1.0.26
  • Bugfix 4673: For ccvshops when no articlenumber is set for an article the payment would fail.
  • Change: When pending iDEAL payment no buttons are displayed anymore and text is better explaining the situation.
  • Change: Sending description or merchantreference with a stringlength longer then the selected paymentmethods support no longer generate an error but warning only.
  • Change: Sofort paymentscreen now only shows merchantreference instead of PayCheckout specific reference and merchantreference.
19 Apr 2017 1.1.0.26
  • Adapted text in hosted payment page for SEPAbanktransfer.
5 Apr 2017 1.1.0.26
  • Bugfix: E-mandate - in sandbox a real iDEAL transaction was initiated.
  • BugFix: E-mandate - retry button for a failed iDEAL verification (bunq/van lanschot) had incorrect retry query parameters.
  • BugFix: iDEAL directory country name now restricted to dutch name only, to be compabitle with e-mandate directory.
  • BugFix: PayPal - when a payment was received on an expired or cancelled paypal payment this was not detected nor handled, now an e-mail is send this happened.
  • Now ability to perform SEPAdirectDebit (Incasso) using the customer api.
22 Mrt 2017 1.1.0.25
  • New errorcode "RequestProcessingEncounteredDatabaseProblem" (2004) errorcode introduced
  • E-Mandates re-introduced into customer Api (ßeta)
22 Feb 2017 1.1.0.24
  • Url validation is more relaxed so that for example http://localhost:1223/return is allowed as a return url.
  • Added GetAvailablePaymentMethods and PaymentHosted to SplitOutpaymentApi.
  • Fixed a bug in PayPal handling were authorisation with status "Failed" was not processed. It now results in a "Rejected" status.
  • Introduced full bank emulation/simulation in sandbox environment.
  • E-mandates API removed, it will be re-introduced in the customer api.
  • Bugfix: Klarna for German customers did not show terms checkbox label correctly (was cutoff)
03 Feb 2017 1.1.0.23
  • ßeta of Customer Api and SplitOutpayment Api to closed group of customers.
    Bugfix in CustomerApi and VerifyBankAccount notification implementation (replaces intermediate release of PHP 1.1.0.22).
29 Dec 2016 1.1.0.21
  • (PHP only) On shared hosting systems it appeared that the 2 second connect timeout was too short in some cases, it has been increased to 20 seconds.
07 Dec 2016 1.1.0.20
  • Bancontact with full app support implemented. Unfortunately due to legal limitations you can not go live with this paymentmethod yet. Refunding only offline possible for now.
  • Google analytics changes:
    • PaymentStatus value removed (as this value may conflict with other measurements)
    • Category: PaymentComplete added, with transaction information
23 Nov 2016 1.1.0.20
  • When an invalid or unssupported "configuredCultureOverride" is passed, only a warning is returned instead of a fatal error.
  • Added ApiMessage method "Payment_OverrideConfiguredNotificationUrl". Whith this method a programmer can set (override) the notificationUrl programmatically for each individual payment.
  • Reorganized documentation so that ApiMessage methods are more easy to find.
  • Bugfix: GoogleAnalytics, allowlinker value on hosted pages has value 'true' (string) instead of true (boolean)
  • GoogleAnalytics: event "checkout" is replaced with "PayCheckout" to be more consistent.
  • E-Mandates ßeta
09 Nov 2016 1.1.0.19
  • Fixed a bug that when an unsupported culture was supplied the GetAvailablePaymentMethods returned an error instead of a warning.
  • Fixed a bug that statuscode of creditcard was not handled correctly.
  • Fixed a bug that paypal status of paid but held funds was not recognized as a valid payment.
26 Okt 2016 1.1.0.19
  • Fixed a bug where a suplied "ExpiryTimeInMinutesOverride" in a generic payment when specifying paymentMethod "Hosted" did not have any effect.
19 Okt 2016 1.1.0.19
  • Fixed a bug where an emulated creditcard transaction did not handle balancedifferences and surcharges correctly.
  • Fixed a bug when a failed creditcard is emulated and creditcard is retried and then "Live emulation" is pressed, screen remains "loading" and shows nothing.
  • Fixed a bug when a a creditcard failed and the user returns to the webshop, the failed url was used instead of the cancelled url.
  • SEPA banktransfer information screen button now shows "Back to webshop" instead of "Cancel payment" which is a more logic approach.
12 Okt 2016 1.1.0.19
  • Completely revised creditcard handling and enhanced sandbox testing capabilities. See Sandboxtesting creditcard
  • Fixed a bug where a Klarna invoice reservation could not be invoiced.
  • Fixed a bug where PayPal payments that were not authorized after a logon from the user where not recognized as such.
  • Fixed a bug where iDEAL payments that remained in status "Open" for a long period where not queried long enough.
  • SEPA refund payments now show only balance when the refund has been completed.
14 Sept 2016 1.1.0.19
  • Sofort payments now have substatus of "SettlementPending" and "Settled" so that merchants are able to see when the payment is received at the bankaccount of PayCheckout.
  • SofortSpecific class expanded with Bankreference attribute
31 Aug 2016 1.1.0.18
  • Bugfix: Fixed duplicate value in Currency enum.
  • Bugfix: API refund excl VAT was not possible in PHP.
  • Bugfix: When an attempt was made to pay an order with iDEAL the order items where always marked as paid even in the case that the iDEAL payment was cancelled.
  • Bugfix: When only CustomerOrderNr and CustomerNote where set for an order (using "payment_setOrderInfo(xxx,xxx)) then creditcard payment method was unintended removed from the available paymentmethods.
  • Now API refund supports specifying AmountExclVAT equal to AmountInclVAT and specifying VATdisplayPercentage of 0.
  • Now GoogleAnalytics shows tax and shipment amounts. It now also shows product information if order is supplied.
  • iDEAL restriction that it was only allowed for Country "NL" has been removed.
3 Aug 2016 1.1.0.17
13 Jul 2016 1.1.0.16
  • Limit of iDEAL increased from Eur 10.000,-- to the technical maximum of Eur 50.000,--.
  • C-Sharp-lib, renamed enum iDeal into iDEAL.
  • Added preparations for introducing payment method SEPAbanktransfer.Libraries have support for the paymentmethod included however method is not operational in this release.
  • If you enter a string filled with only one or more spaces for Description in a hosted payment the field will not be shown in the "Transaction summary"
  • Restored the possibility to simulate a pending iDEAL transaction (option was previously removed while introducing new emulation screen).
  • Altered text in transaction summary screen to be less webshop oriented and have a more generic payment approach.
  • Bugfix: Due to the javascript validator displaying an error message under an input field one could fail pressing "Cancel payment" in hosted pages because the link moved downwards to show the error.
29 Jun 2016 1.1.0.15
  • Bug fix APIdemo: When a user has not "en-us" local decimal settings, payment amount was not handled correctly. Resulting in not being able to start any payment because of amount mismatches.
  • Completely redesigned hosted page. A new clean design which is better responsive than previous hosted page.
  • Completely new google analytics implementation. To support this feature Json.ApiMessage has new function Payment_AddParameter
  • Portal: Searching for payments. Search is now possible on City and First/Lastnames too. (for new payments as of to date).
  • iDEAL emulator: New design and now possibility of emulating user paying without returning to webshop.
01 Jun 2016 1.1.0.14
  • Introduced second chance Email capability.
  • PaymentInfo class now has boolean if a second chance Email has been send.
  • WebshopId has been removed from return urls query for security reasons.
18 May 2016 1.1.0.13
  • Bugfix: Klarna invoiceterms were showing orderamount in webshopcost instead of showing surcharge amount.
  • PHP library now supports up to PHP version 7.0.
  • It was not possible to call payment_overrideReturnUrls before calling GetAvailablePaymentMethods.
4 May 2016 1.1.0.12
  • It is now possible to cancel all order items (UpdateOrder) or the whole order (CancelOrder) when no payment has been made. Partial cancellation of order items is not allowed. Previously this resulted in an error being displayed instead of succesfull execution. This also introduces new possible states of a hosted payment. A hosted payment can have the state Cancelled now See statuses. In rare cases it is possible that you still receive a payment on a cancelled order so that the state changes to Paid. When this happens we will send an e-mail to the registered e-mail address to notify this happens, so that you can contact the customer on the matter or decide to refund the received funds.
  • Validation was expanded so that "ProcessOffline" is detected as not allowed for Klarna payments.
  • When for an orderline a UnitPriceMultiplyFactor is specified which is the default for the currency of the order the parameter is ignored for payment methods where it alters the orderline into a single quantity. For example Klarna
  • When trying to start a PayPal payment with UnitPriceMultiplyFactor items a paypal error was returned that itemvalues where incorrect. Now this is translated into a single quantity orderline so that the order amounts are correct.
20 Apr 2016 1.1.0.12
  • When a consumer retries a payment, all available paymentmethods are offered instead of the initial selected paymentmethod(s).
  • Bugfix : IpAddress was not correctly registered when running hosted payments.
  • Bugfix : When a servicecall, for example an updateorder, failed, the dashboard showed the related payment as a failed payment instead of leaving the status as paid.
  • Bugfix : When the service call "CancelOrder" was called on a payment that had no payment activity an incorrect error was shown.
5 Apr 2016 1.1.0.12
  • Bugfix PHP: Can not connect to transaction system. (Status: Peer's Certificate issuer is not recognized) Due to certificate updates, when connecting thru (PHP) cURL, connections were rejected due to missing intermediate certificates in cacert.pem file.
30 Mar 2016 1.1.0.11
  • We changed configuration of SurCharges, instead of configuring on currency it is now configured based on country. We have converted your current settings to country where possible. In cases where you have specified EUR we have converted this to country "NL". If you use EUR in other countries you have to add those countries country by country now.
  • Due to the previous change the service call GetCurrentConfiguration now returns different surchargecollectionv2 and surchargeV2 data.
  • PHP: Bug fix in getting min/max values (assosiative array was not correctly indexed on paymentmethod)
  • Bug fix: When a payment failed the paymentamount was zero instead of showing the paymentamount requested.
  • Bug fix: Countrycode 'BQ' representing 'Bonaire' was missing and not recognized by the transaction system.
3 Mar 2016 1.1.0.10
  • When iDEAL did not return a result after the user returned from the bank, payment flow failed instead of going into pending state. Also, the message that the payment failed was confusing for users, resulting in double payments. Now correct status and message are shown.
  • When an iDEAL status request returned "failed" the trace showed all was "green". Now trace shows a red arrow beyond the area where StatusRequest reported a failed status. So now the trace shows more clearly what went wrong.
  • When an item was refunded and the RefundCost class was used to either refund an amount or apply refund cost and amount involved came close to the amount available for refunding calculation, errors where discovered. Calculation is reviewed and corrected for this situation.
  • Item amounts of zero where not allowed. Now you can enter items free of charge.
  • Added ability to identify the used webshop module. This is done by sending an optional string indentifying the shop module used when calling "Execute". See implementing
17 Feb 2016 1.1.0.9
  • On Safari browsers, the Dutch hosted page did not show the column "webwinkel ordernumber" correctly, this has been corrected.
  • iDEAL now supports the new dutch "Bunq bank".
  • When an order was invoiced and contained items of type "Discount", those itemtypes could not be refunded because the validator prevented refunding this itemtype, this is now possible. Of course refunding discounts is limited to the amount that has been paid at all cases, in other words you cannot refund more than has been paid.
  • To be able to refund an additional amount when refunding items, we allow negative RefundCost values to be applied. Specifying a negative refundcost turns the refundcost into a pure refund.
3 Feb 2016 1.1.0.9
  • Order validation is loosened, so that paymentmethods that are not depended on certain field values do a less extensive validation. Previously all order fields that where supplied where extensively validated, now extensive validation is only done when problems are expected when supplying it to a payment method. See Payment_SetOrderBillingAddress and Payment_SetOrderShippingAddress
  • GetCurrentConfiguration - When no paymentmethods are configured in the portal, an empy configuration class is returned instead of an error that no payments are configured.
  • Added parameter "ExpectedMutationAmount" to UpdateOrder, to compensate for roundingerrors that are introduced in shopmodules. See section "Parameter ExpectedMutationAmount" under UpdateOrder.
  • Bugfix for: When an invoice was refunded with a fixed amount, notification returned was of type "updateorder" instead of the expected "refund" type with refunddata filled.
  • Bugfix for: When a (hosted) payment expired, the notification with paymentstatus "HostedExpired" did not contain order data, even in cases where order data was supplied when the payment was initiated.
18 Jan 2016 1.1.0.9
  • (version 1.1.0.8 was used for updating c# lib as 1.1.0.7a was not possible)
  • Revised ordervalidation, it is now payment method specific.
  • Bugfix for: When Payment_SetQuantityMultiplyFactor is called when calling GetAvailablePaymentMethods an error occurs
  • Bugfix for: When a (hosted) payment with Klarna is performed and updateorder is called an error occurs when birthday or gender is removed from billingaddress.
06 Jan 2016 1.1.0.7a PHP
  • Patched autoloader to spl_autoload_register('PayCheckout_autoloader',true,true);
  • Added validation for webshopId and encryptionPassword.
16 Dec 2015 1.1.0.7
15 Oct 2015 1.1.0.6
  • Changed type of attribute OrderLineNumber in PayCheckout.Json.Generic.Order.Item.Item class from Int32 to Int64 for supporting modules like magento.
  • Validator now rejects orders with more then one orderline with itemtype "paymentcost" set.
  • ConsumerMessage is now generic in case a payment start fails validation.
  • You can now fully customize the text that is shown with the payment method.
  • You can now alter the order the paymentmethods are presented on the hostedpage and in the "GetAvailablePaymentMethods" call in the portal.
  • Notification timing altered to be more aggressive first minute (See retry mechanism).
7 Oct 2015 1.1.0.5
2 Oct 2015 1.1.0.4
  • Fixes in documentation. Expanded documentation about notifications and added more detail in samples.
16 Sep 2015 1.1.0.4
  • BUGFIX: Sns logo not showing in iDEAL emulator.
  • PayCheckout.Json.PaymentInfo.TransactionInfo json class expanded to contain field 'PaymentMethodDescription'.
  • PayCheckout.Json.Response json class expanded to contain field 'TransactionReference'.
  • C# classes: newtonsoft attributes revised and getters/setters sanitized with correct restrictions
  • BUGFIX: PHP classes: PayCheckout\Api\HelpFunction getCurrencyMultiplyFactor and getCurrencyMultiplyConstant returned incorrect values for SEK and NOK.
  • ServiceCall Get Last Notification Content added as a programmer aid for coding notification handlers.
11 Sep 2015 1.1.0.3
  • Bugfix: PHP library (1.1.0.3a) has better validation information when classes of parameters are incorrect.
9 Sep 2015 1.1.0.3
  • Bugfix: If CancelOrder/Refund or Update order failed validation, no failed transaction was added to the payment, depending on what field failed validation. Now failed transactions are inserted in the payment in all cases where validation failed.
3 Sep 2015 1.1.0.3
  • CancelOrder functionality expanded from supporting reservation payment methods only to supporting pre-paid methods too.
  • CancelOrder parameter added "ProcessOffline" to support offline processing of CancelOrder
18 Aug 2015 1.1.0.2
  • Feature enforceNoVAT added
  • UpdateOrder now has parameter array like generic payment for flexible parameter passing
  • UpdateOrder feature "ProcessOffline","True" parameter added
  • Now flexible parameters in UpdateOrder method
  • New parameter "ProcessOffline","True" in UpdateOrder for offline processing of orders
  • New parameter "ProcessOffline in servicecall Refund
  • Following classes have flag ProcessedOffline added: Json.Invoice.Discount, Json.Invoice.Invoice, Json.Invoice.Refund, Json.Notification.Notification, Json.PaymentInfo.TransactionInfo
  • PHP library responds quicker in case of internet problems reaching transaction system
8 Aug 2015 1.1.0.1
  • Article descriptions are not mandatory anymore
  • Paymentstatus state diagrams added
  • Portal bugfixes
27 Jul 2015 1.1.0.1
  • Added new currencies
  • Removed transactionstatus Queued and QueuedInsufficientFunds
  • Removed paymentstatus RefundPending
  • Added topic "Statuses"
  • Added PaymentCostExclVat, PaymentCostInclVat, PaymentCostVatDisplayPercentage in response from GetAvailablePaymentMethods
  • Added capability to supply trackAndTraceInfo when performing billing (see UpdateOrder)
  • Returned Invoice now also contains supplied TrackAndTrace information if supplied during the billing process
  • Added capability to compute fractional quantities like 2.5. Method payment_setQuantityMultiplyFactor added. Order and invoice classes now contain the attribute QuantityMultiplyFactor as supplied by the method. Fractional quantities are not supported by all paymentmethods for example Klarna can not handle this.
  • New payment method Generic added for maximum flexibility and minimal to no code changes when paymentmethods are added.
  • Portal: Klarna, you can configure if you have received credentials for the test system (only for the happy few)
  • Portal: Portal is translated to Dutch
  • Portal: You can now view fractional quanties
  • Portal: You can now go through the client acceptance process
  • Portal: Userrights can now be set and revoked
  • Portal: You can now fully customize hosted payment and notification pages
2 Jul 2015 1.0.12.8
  • Added transactionstatus Queued and QueuedInsufficientFunds
  • Added paymentstatus RefundPending
21 Apr 2015 1.0.12.7
  • Added errorcode RemotePartyReportsUnspecified
  • iDEAL emulator can now emulate failed status
17 Apr 2015 1.0.12.6
  • Added new service call SendManualNotification
  • ApiDemo updated with new service call
  • Portal changed to support new service call
  • Some small bug fixes
16 Apr 2015 1.0.12.5
  • Hosted payments now can have status HostedInitiated/HostedExpired. Now the dashboard can give better information about abandoned hosted payment actions.
  • When a hosted payment fails now additional entered fields like gender/birthdate etc. can be altered/re-entered before retrying
  • Limitation for Klarna payments that for small unitprices the reservation could not be altered is removed now. Limitation that partly invoicing small unitprices with Klarna (for example EUR 0,005) remains. So QuantityOrdered must be QuantityInvoiced when updating order items with small unitprices.
  • Some small bug fixes
13 Apr 2015 1.0.12.4
  • Added method payment_overrideConfiguredReturnUrls
  • All highlevel API calls have typechecking/validation added
  • iDEAL, KlarnaAccount and KlarnaInvoice have the required parameter customerIpAddress added
  • API service call GetAvailablePaymentMethods has the required parameter customerIpAddress added
  • ApiMessage.addOrderItem has the optional parameter unitPriceMultiplyFactorOverride added, so that prices with other numbers of decimal places can be handled. Range is (currency factor)..8
  • GetConfiguration class Klarna has two methods added isSendKlarnaEmailWhenInvoiceIsCreated and isSendKlarnaEmailWhenInvoiceIsAltered
  • GetCurrencyMultiplyFactor(currency) method added to aid in determining the scale factor
  • GetCurrencyMultiplyConstant(currency) method added to aid in determining the multiplication constant
  • GetMultiplyConstant(factor) method added to aid in determining the multiplication constant
  • Json.Generic.Invoice.RefundItem class added, this class helps in displaying refund items and now includes the Amount
7 Apr 2015 1.0.12.3
  • (Internal, not released)
19 Mar 2015 1.0.12.2
  • PHP lib bug fixed
  • Documentation updated.
  • Sample code in PHP was not always correct
11 Mar 2015 1.0.12.1
  • Service calls GetAvailablePaymentMethods and GetModuleVersion added with there respective result classes.
  • ErrorCode RequestNoSuitablePaymentMethodsFound added/introduced.
  • Removed https restriction for return urls, introduced in 1.01.12.0. Notification url https restriction removed for sandbox use.
  • Hosted payment page can show disturbances and maintenance info per paymentmethod when applicable.
  • Sandbox iDEAL emulator now only accepts BIC code of banks that are available according to the IDeal directory request.
3 Mar 2015 1.0.12.0
  • Notification classes OrderChange,PaymentStatusChange and RefundInformation now contain MerchantOrderRef if available.
  • Json.PaymentInfo.TransactionInfo now contains field RelatedTransactionIndex attribute to show relationship between statusrequest/payments for example and the attribute HostedExpirationTime.
  • Api.Payment.Hosted function call has additional parameter "expiryTimeInMinutesOverride" to be able to override portal configured expiry.
  • Return and notification urls require https.
18 Feb 2015 1.0.11.1
  • Documented notifications in more detail with samples. Fixed bug in c# where Notification class could not be extracted correctly.
13 Feb 2015 1.0.11.0
  • Introduced new classes that supply more information when notifications are send.

API General

All communication with the PayCheckout transaction system is done by using Json messages. If you view trace output of what is transmitted and received from the transaction system you will recognize three classes. The ApiSigned class is a class that always contains two classes: ApiMessage and a string called "SecuritySha256Hash". Just before a message is transmitted a Sha256 hash is computed from the complete JsonString of the ApiMessage and the encryption password. This encoding enables the receiver of the message to verify that the message content is not compromised. This is true for clients sending messages to the PayCheckout transaction system as well as clients receiving messages from the PayCheckout transaction system. This way we can guarantee that messages are not compromised by "man in the middle" attacks. Also the Sha256 algorithm is known to be more secure than Sha1 or MD5 hashes. Together with TLS encryption enforced by using https operation we offer one of the best secure communications in the industry. To be completely on the safe side, keep your encryption password secure and change it at regular intervals. This way you will experience the best possible security technically possible. The libraries take care of all logic required to achieve this security.

Changing encryption passwords

We also provide good support for changing passwords: with most of our competitors, changing a password introduces downtime or at least a bunch of hassle. In our system this is not the case. The change procedure involves generating a new encryption password. This can be done on a per webshop basis in the (sandbox)portal. Update each production webserver one by one with the new password. During this transition two passwords will be recognized by our transaction system. When you are finished with updating all the production websites you can delete the old encryption password from the configuration. You may ask yourself but how about notifications? Well just keep ignoring notifications that fail security verification, they will be retried automatically. At a later point in time the notifications will be accepted/recognized if they arrive at an upgraded webserver that knows the new encryption password.

C# communication layer

The C# API has the communication layer defined by an interface which you may decide to alter or even replace with code of your own, if you have some special requirement regarding the communication layer. As long as you create an interface class that behaves similar as the interface implementation in the API, you are on the safe side. You can experiment freely with our sandbox system to verify API operation. Do realize that altering might involve some additional work when new versions are introduced. Although we will try hard not to change the communication layer there is no guarantee.

Payment and transaction references

In response to an API call that tries to accomplish a payment the system generates a "PaymentReference". This reference has the format YYYYMMpppNNNNNNNNN where YYYY is the four digit year representation. MM month range 01-12 and ppp identifies the payment method for example iDEAL is 001. NNNNNNNNN represents a 9 digit unique sequence number. A transaction reference has the same layout. The "PaymentReference" is created at the start of a payment, also one "TransactionReference" is created which is identical to the payment reference. If more actions are applied with regard to a payment new transaction references will be created. For example a refund action will generate its own unique "TransactionReference". So keep in mind that a "TransactionReference" identifies a specific action on a payment and a "PaymentReference" identifies the original start of the payment and acts as a "container" for all actions that might be applied to a payment. Payment references and transaction references both have a status, where the PaymentReference.Status refers to the general state the whole payment is in and the TransactionReference.Status to the status of an individual action on the payment.

Sandbox and Live system

Our transaction system is comprised of a test environment which we call "Sandbox" and the "Live" system which deals with the real payments. The sandbox system is technically identical to the live system which includes the software that is running on it. It has fewer redundancy features regarding internet connectivity and also is not geographically redundant as opposed to our live system. Contrary to what is common, the sandbox and live system share user accounts. So once you have made an account on the sandbox you don't have to use different credentials to do transactions on the live system after you have finished your development. The process of going from sandbox to live involves setting the third parameter in the PayCheckout.ApiExecutor call from true (=sandbox) to false (=live) and transfering the sandbox configuration to the live system using the button "go live" in the sandbox portal. This assures a clean development cycle and because the software that is running on the sandbox is identical to the live system you may truly assume that if your webshop runs fine in the sandbox it will run fine live too! Both environments have their own portals where you can either view your sandbox payments or live payments.

Sandbox login: https://portalsandbox.paycheckout.com
Live login: https://portal.paycheckout.com

Implementing

When integrating the API in your webshop you always do 3 basic things:

  • Prepare an ApiMessage with the wanted action
  • Send the request to the PayCheckout transaction system using the PayCheckout.ApiExecutor class. With parameters as in beneath table
  • Analyse the Response and act on it
Parameter Required Description
WebshopId Yes Each webshop has an unique id which is generated when the webshop is created in the portal.
Encryption password Yes Each webshop has an unique encryption-password in the form of an UID. Generated when the webshop is created in the portal, can be renewed to enhance security.
Use Sandbox (default=false) No When true transaction is executed in the sandbox environment, when false execution takes place in live environment.
ModuleInfo (default=null) No Specify the webshop modulename if applicable. Contact paycheckout support if you need assistance on this matter.

In this documentation you will find plenty of examples of these actions.

Number conversion

To avoid rounding problems that may occur in some programming languages, all numbers are passed as integers to the API.

Percentages

Percentages are always multiplied by 100. So for example 19,5% is translated to 1950.

Currency conversion

When supplying amounts in various currencies use the table below.

Currency MultiplyConstant Amount Converted integer amount
EUR 100 1.200,34 120034
GBP 100 2.100,68 210068
SEK 1 201 201

All supported currencies/multiplyfactors

All supported currencies/multiply factor

Flag Country Currency ISO4217 code Multiply constant
UAE United Arab Emirates Emirati Dirham AED 100
Afghanistan flag Afghanistan Afghani AFN 100
Albania flag Albania Albanian Lek ALL 100
Armenia flag Armenia Armenian Dram AMD 100
Netherlands Antilles Netherlands Antilles Dutch Guilder ANG 100
Argentina flag Argentina Argentine Peso ARS 100
Australia flag Australia Australian Dollar AUD 100
Aruba flag Aruba Aruban Guilder AWG 100
Azerbaijan flag Azerbaijan Azerbaijani New Manat AZN 100
Bosnia and Herzegovina flag Bosnia and Herzegovina Bosnian Convertible Marka BAM 100
Barbados flag Barbados Bajan Dollar BBD 100
Bangladesh flag Bangladesh Bangladeshi Taka BDT 100
Bulgaria flag Bulgaria Bulgarian Lev BGN 100
Bahrain flag Bahrain Bahraini Dinar BHD 1000
Bermuda flag Bermuda Bermudian Dollar BMD 100
Brunei flag Brunei Bruneian Dollar BND 100
Bolivia flag Bolivia Bolivian Boliviano BOB 100
Brazil flag Brazil Brazillian Real BRL 100
Bahamas flag Bahamas Bahamian Dollar BSD 100
Botswana flag Botswana Botswana Pula BWP 100
Belarus flag Belarus Belarusian Ruble BYR 1
Belize flag Belize Belizean Dollar BZD 100
Canada flag Canada Canadian Dollar CAD 100
Switzerland flag Switzerland Swiss Franc CHF 100
Chile flag Chile Chilean Peso CLP 100
China flag China China Yuan Renminbi CNY 100
Colombia flag Colombia Colombian Peso COP 100
Costa Rica flag Costa Rica Costa Rica Colon CRC 100
Cape Verde flag Cape Verde Cape Verdean Escudo CVE 1
Czech Republic flag Czech Republic Czech Koruna CZK 100
Djiboutian flag Djiboutian Djiboutian Franc DJF 1
Denmark flag Denmark Danish Krone DKK 100
Dominican Republic flag Dominican Republic Dominican Peso DOP 100
Algeria flag Algeria Algerian Dinar DZD 100
Egypt flag Egypt Egyptian Pound EGP 100
Ethiopia flag Ethiopia Ethiopian Birr ETB 100
Euro flag Euro Member Euro EUR 100
Fiji flag Fiji Fijian Dollar FJD 100
Falkland Islands flag Falkland Islands Falkland Island Pound FKP 100
United Kingdom flag United Kingdom Britisch Pound GBP 100
Georgia flag Georgia Georgian Lari GEL 100
Guernsey flag Guernsey Guernsey Pound GGP 100
Ghana flag Ghana Ghanaian Cedi GHS 100
Gibraltar flag Gibraltar Gibraltar Pound GIP 100
Gambia flag Gambia Gambian Dalasi GMD 100
Guinea Franc flag Guinea Guinean Franc GNF 1
Guatemala flag Guatemala Guatemalan Quetzal GTQ 100
Guyana flag Guyana Guyanese Dollar GYD 100
Hong Kong flag Hong Kong Hong Kong Dollar HKD 100
Honduras flag Honduras Hondurian Lempira HNL 100
Croatia flag Croatia Croatian Kuna HRK 100
Haiti flag Haiti Haitian Gourde HTG 100
Hungary flag Hungary Hungarian Forint HUF 100
Indonesia flag Indonesia Indonesian Rupiah IDR 1
Israel flag Israel Israeli Shekel ILS 100
Isle of Man flag Isle of Man Isle of Man Pound IMP 100
India flag India Indian Rupee INR 100
Iceland flag Iceland Icelandic Krona ISK 100
Jersey flag Jersey Jersey Pound JEP 100
Jamaica flag Jamaica Jamaican Dollar JMD 100
Jordan flag Jordan Jordanian Dinar JOD 1000
Japan flag Japan Japanese Yen JPY 1
Kenyan flag Kenya Kenyan Shilling KES 100
Kyrgyzstan flag Kyrgyzstan Kyrgyzstani Som KGS 100
Cambodia flag Cambodia Cambodian Riel KHR 100
Comoran flag Comoran Camoran Franc KMF 1
Korea (South) flag Korea (South) South Korean Won KRW 1
Korea (South) flag Kuwait Kuwaiti Dinar KWD 1000
Cayman Island flag Cayman Caymanian Dollar KYD 100
Kazakhstan flag Kazakhstan Kazakhstani Tenge KZT 100
Laos flag Laos Laotian Kip LAK 100
Lebanon flag Lebanon Lebanese Pound LBP 100
Sri Lanka flag Sri Lanka Sri Lankan Rupee LKR 100
Libya flag Libya Libyan Dinar LYD 1000
Morocco flag Morocco Moroccan Dirham MAD 100
Moldova flag Moldova Moldovan Leu MDL 100
Macedonia flag Macedonia Macedonian Denar MKD 100
Myanmar flag Myanmar (Burma) Burmese Kyat MMK 100
Mongolia flag Mongolia Mongolian Tughrik MNT 100
Macau flag Macau Macau Pataca MOP 100
Mauritania flag Mauritania Mauritanian Ouguiya MRO 10
Mauritius flag Mauritius Mauritian Rupee MUR 100
Maldives flag Maldives Maldivian Rufiyaa MVR 100
Malawi flag Malawi Malawian Kwacha MWK 100
Mexico flag Mexico Mexican Peso MXN 100
Malaysia flag Malaysia Malaysian Ringgit MYR 100
Mozambique flag Mozambique Mozambican Metical MZN 100
Namibia flag Namibia Namibian Dollar NAD 100
Nigeria flag Nigeria Nigerian Naira NGN 100
Nicaragua flag Nicaragua Nicaraguan Cordoba NIO 100
Norway flag Norway Norwegian Krone NOK 100
Nepal flag Nepal Nepalese Rupee NPR 100
New Zealand flag New Zealand Dollar NZD 100
Oman flag Oman Omani Rial OMR 1000
Panama flag Panama Panamanian Balboa PAB 100
Peru flag Peru Peruvian Nuevo Sol PEN 100
Papua New Guinean flag Papua New Guinean Papua New Guinean Kina PGK 100
Philippines flag Philippines Philippine Peso PHP 100
Pakistan flag Pakistan Pakistani Rupee PKR 100
Poland flag Poland Polish Zloty PLN 100
Paraguay flag Paraguay Paraguayan Guarani PYG 1
Qatar flag Qatar Qatari Riyal QAR 100
Romania flag Romania Romanian New Leu RON 100
Serbia flag Serbia Serbian Dinar RSD 100
Russia flag Russia Russian Ruble RUB 100
Rwanda flag Rwanda Rwandan Franc RWF 1
Saudi Arabia flag Saudi Arabia Saudi Arabian Riyal SAR 100
Solomon Islands flag Solomon Islands Solomon Islander Dollar SBD 100
Seychelles flag Seychelles Seychellois Rupee SCR 100
Sweden flag Sweden Swedish Krona SEK 1
Singapore flag Singapore Singapore Dollar SGD 100
Saint Helena flag Saint Helena Saint Helenian Pound SHP 100
Sierra Leone flag Sierra Leone Sierra Leonean Leone SLL 100
Somalia flag Somalia Somali Shilling SOS 100
Suriname flag Suriname Dollar SRD 100
São Tomé and Príncipe flag São Tomé and Príncipe Sao Tomean Dobra STD 100
El Salvador flag El Salvador Salvadoran Colon SVC 100
Swaziland flag Swaziland Swazi Lilangeni SZL 100
Thailand flag Thailand Thai Baht THB 100
Tunisia flag Tunisia Tunisian Dinar TND 1000
Tonga flag Tonga Tongan Pa'anga TOP 100
Turkey flag Turkey Turkish Lira TRY 100
Trinidad and Tobago flag Trinidad and Tobago Trinidadian Dollar TTD 100
Tuvalu flag Tuvalu Tuvaluan Dollar TVD 100
Taiwan flag Taiwan Taiwan New Dollar TWD 100
Tanzania flag Tanzania Tanzanian Shilling TZS 100
Ukraine flag Ukraine Ukrainian Hryvnia UAH 100
Uganda flag Uganda Ugandan Shilling UGX 1
United States flag United States US Dollar USD 100
Uruguay flag Uruguay Uruguayan Peso UYU 100
Uzbekistan flag Uzbekistan Uzbekistani Som UZS 100
Venezuela flag Venezuela Venezuelan Bolivar VEF 100
Viet Nam flag Viet Nam Vietnamese Dong VND 1
Vanuatu flag Vanuatu Ni-Vanuatu Vatu VUV 1
Samoa flag Samoa Samoan Tala WST 100
Central African flag Central African CFA Central African CFA Franc XAF 1
East Caribbean flag East Caribbean East Caribbean Dollar XCD 100
CFA flag Communauté Financière Africaine CFA Franc XOF 1
CFA flag Comptoirs Français du Pacifique CFP Franc XPF 1
Yemen flag Yemen Yemeni Rial YER 100
South Africa flag South Africa South African Rand ZAR 100
Zambia flag Zambia Zambian Kwacha ZMW 100

String handling

All strings are transferred to and from the transaction system UTF-8 encoded, so special characters are handled transparently. However be aware that the underlying payment systems do not support handling of special characters or languages in all cases.

SEPA refund

SEPA refund information strings, because of the underlying bank system, only support characters 'A' till 'Z', 'a' till 'z', '0' till '9' and characters "/\-?:().,'+ ]". Diacritics like 'é', 'á', 'ë', etc. will get translated to there "simplest" character. For example 'é' will become 'e'. Any other/unrecognized character will be replaced by a '?'.

Payments

In the next part we describe how to make payments. Each payment is identified with a unique PaymentReference and all actions that are related to the payment will be registered against this PaymentReference.

It is possible to override the return URLs specified in the portal. You can do this for each payment, by calling the Payment_OverrideConfiguredReturnUrls method.

Hosted

We advise to use Hosted payment for all your payments, as hosted payments show the best conversion as the user is guided smoothly thru the paymentprocess and is offered alternative paymentmethods if one fails.

Scenario: We have a website and the website is using an order system. You want to offer your customer several payment methods and don't want to go in all the legal matters, error handling etc. to show a payment page in your webshop.

In this scenario you choose to go for hosted payments. The principle is that you redirect the user to the secure transaction environment of PayCheckout and let that system take care of the payment completion. Using the portal you are able to customize the look and feel of the hosted payment page. For example to show your logo, payoff etc. You specifiy the order and payment methods that are offered to the user. You also have the possibility to configure and apply a surcharge to let the user contribute to the more expensive payment methods for example.

If you apply a set of payment methods, before being shown to the user, payment methods are validated to see if they can be used. Payment methods that are excluded are mentioned in the warnings section and as long as at least one payment method can be activated the hosted payment can execute and will return a redirect link. The warning section will show payment methods that have been excluded, for example if they did not match min/max criteria.

Klarna: If required, country specific info like gender or birthdate values are missing the user is prompted for the required values. For Klarna account, installments will be shown. If more than one installment is offered a radiobutton style selection can be made by the user if he/she opts for Klarna Account.

If you supply a single paymentmethod and no further userinput is required, the user will be redirected to the paymentmethod instantly. For example if you supply iDEAL as a paymentmethod and add the parameter "IssuingBank" with the correct Bank the user will be redirected to that bank immediately.

Use the API function:

PayCheckout. Api. Payment. Hosted

Create an ApiMessage with the following parameters:

Name Required Type Description Limits
merchantOrderReference Yes String Corresponding order in merchants system Depending on selected method (See individual payment methods) a good length limit is 35.
description Yes String Description of order Depending on selected method (See individual payment methods) a good length limit is 35. If you enter a string containing one or more spaces only, the description will be excluded from the Transaction summary.
amount Yes Integer Amount converted to an integer value () Allowed 1 - 2147483647. (Maximum order amounts are limited by the choosen payment method)
currency Yes Currency (class) Currency used in the order. Limited by the payment methods selected
configuredCultureOverride No String If you want to use a different culture than configured for the webshop, specify it here. When null use the Culture that has been configured for the webshop. In case the specified culture is not supported it is defaulted to value configured for the webshop.
expiryTimeInMinutesOverride No Integer (nullable) Specify the expiry time of the hosted payment in minutes if you want to override the webshop configured value. When null, zero or less than zero the value has no effect and the value configured for the webshop will be used. Range 1..259200 minutes (180 days)
paymentMethod array(1..n) No PaymentMethods (array/class) Payment method(s) to present Must be one of the PaymentMethod enumerations. When 'null' use all configured and applicable paymentmethods available.
enforceNoVat No Bool (C#) String (other) Can only be true or false (null in PHP is allowed too) When set to true enforces configured surcharges to be calculated without VAT and validates order items do not have VAT applied.

After the payment is created you may execute the message. If no errors are reported you can now redirect the user of your webshop to the "RedirectInfo" returned in the ApiResponse message. This will bring up the hosted payment page and the user may select a payment method and finalize the payment. If an error occurs check the ApiResponse errors to analyse what went wrong.

You can override the configured expiration time of the hosted payment by specifying a value for the parameter "expiryTimeInMinutesOverride". For example, when you create a "PaymentLink" you want to send by E-mail, you probably want a longer expiration time then for a webshop initiated payment.

If no expiration time is configured in the portal for hosted payments, hosted payments never expire. When an expiration time is set by an override or configured in the portal the hosted payment is set to expire. Expiration is examined the first time 10 seconds after the expected expiration time. Further examination is done with progressive intervals. When polled for expiry and no payments are pending the hosted payment will expire at that point and a notification will be send to the webshop. When payments are pending the hosted payment will not expire until all pending payments have reached a final state. When all pending payments are cancelled or have expired by their own when being polled and the expiration period of the hosted payment has been reached the hosted payment will become expired. If there were no pending payments and none of the payments were succesfull the hosted payment will expire at that point when polled for expiry.

When the user finishes the payment or decides to return to the webshop to change the order, the user is redirected from our transaction system to the appropiate redirect url of the webshop, with the following query parameters added to the url.

Name Description
MerchantReference Reference supplied at the start of the payment.
PayCheckoutReference The payment reference that has been assigned to this payment. Value can be used to retrieve all relevant data about this payment.
PayCheckoutTrace The trace reference that can be used to view in detail what has happened with this payment.
PaymentStatus A string representing one of the posibble paymentstatuses as defined in the PaymentStatus enumeration.

A lot of users don't make the effort to return to the webshop, although they have paid the order. Don't worry, this is handled too.

If the selected payment is an iDEAL transaction then the transaction system will query the iDEAL system for status changes on a schedule as defined by the iDEAL specification. When the transaction system discovers a state as Paid, Expired or Cancelled it will send a Notification message with a "PaymentStatus" to the webshop to inform the webshop of this status change. A notification will always be sent if the payment results in a finalized state.


using System;
using PayCheckout;

using System.Collections.Generic;
{
	// Prepare the Hosted payment with iDEAL, KlarnaInvoice and KlarnaAccount (do not override configured webshop values for expiration and culture)
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.Hosted.Create("Order-66092",
		"PayCheckout inzake WebShop",
		85000,
		EUR,
		null,
		null,
		PaymentMethod.iDEAL,
		PaymentMethod.KlarnaInvoice,
		PaymentMethod.KlarnaAccount);

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		emailAddress:"youremail@email.com",
		phoneNumber:"0612345678");

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		phoneNumber:"0612345678");

	// Set CustomerOrderNumber and/or CustomerNote
	apiMessage.Payment_SetOrderInfo("Inkoop order:20150101","Graag met spoed");

	// Add order item info
	apiMessage.Payment_AddOrderItem(
		0,
		"fiets",
		"luxe fiets",
		1,0,0,0,
		70248,
		85000,
		2100,
		Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(
		8,
		"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",
		true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, test if we should redirect etc..
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare the Hosted iDEAL/KlarnaInvoice/KlarnaAccount payment (no override of webshop configured values)
$apiMessage = PayCheckout\Api\Payment\Hosted::create('Order-5826','PayCheckout inzake WebShop',85000,PayCheckout\Currency::EUR,array(PayCheckout\PaymentMethod::IDEAL, PayCheckout\PaymentMethod::KLARNAINVOICE, PayCheckout\PaymentMethod::KLARNAACCOUNT),null,null);

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null);

// Set CustomerOrderNumber and/or CustomerNote
$apiMessage->payment_setOrderInfo('Inkoop order:20150102','Graag met spoed leveren');

// Add order item info
$apiMessage->payment_addOrderItem(0,"Fiets","Luxe fiets",1,0,0,0,70248,85000,2100,PayCheckout\ItemType::ARTICLE,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, test if we should redirect etc..
}
else
{
	// Analyze why it failed
}
 

ApiMessage Methods

De ApiMessage is a class that is always constructed with a "Create" method from an API call to start a payment. To enrich the payment with additional data like order information, override configured urls or add a parameter several methods exist to assist in this proces.

Payment_SetOrderBillingAddress

With this method you supply the billing address of an order. Dependending on the payment method used the fields are extensively validated. If extensive validation is applied the rules are described in the last column. All string fields are checked if they don't contain tags at all times (<...>).

Name Required Type Description Extensive validation rules
countryIso3166Alpha2 No String 2 Character countrycode corresponding to the ISO3166-1 alpha 2 table Max length 2 characters, upper or lower case, must match a valid country abbreviation.
firstName No String First name of billing target May not contain control characters, digits or other characters except {.-&}.
lastName No String Last name of billing target May not contain control characters, digits or other characters except {-.'&}.
addressLine1 No String Typically contains street and house number May not contain control characters.
zipCode No String Contains zip-code of applicable address May not contain control or other characters. Must comply with country-specific formats.
city No String City of applicable address May not contain control characters, digits or other characters except {'-}.
title No String Title of person referred to in billing name, for example "Prof. Dr." May not contain control characters, digits or other characters except {.}.
addressLine2 No String Additional address line typically used in the UK and US May not contain control characters.
stateProvince No String State or Province if known May not contain control characters, other characters or digits
dateOfBirth No DateTime (class) Birthdate of person refered to in billing Additional time info like Hour, Minute, Second etc is ignored. Supplied value may not reference a date in the future.
emailAddress No String E-mail address as entered by the user May not contain control characters and must be a valid e-mail address.
gender No Gender Male or Female
phoneNumber No String Phone number as entered by the user May not contain control characters, letters or other characters except {+-}. Must look like a valid phone number.
phoneNumber2 No String Extra phone number as entered by the user May not contain control characters, letters or other characters except {+-}. Must look like a valid phone number.
cellPhoneNumber No String Cell phone number as entered by the user May not contain control characters, letters or other characters except {+-}. Must look like a valid phone number.
socialSecurityNumber No String Social security number as entered by the user May not contain letters, spaces, control characters or other characters except {-}. Must adhere to country specific formats.
organisation No String Name of organisation as entered by the user May not contain control characters.
department No String Department of organisation as entered by the user May not contain control characters.
chamberOfCommerceNumber No String Chamber of commerce number as entered by the user May not contain spaces, control characters or other characters except {-}.
vatNumber No String VAT number as entered by the user May not contain control characters or other characters and must comply with country specific format. Formats specifying with or without inclusion of 2 letter-country code are allowed.

Orderfields in relation to payment methods regarding validation

  • Required (Req.) => "Yes" then this field is mandatory. "No" then this field may optional be supplied and will be passed to the paymentmethod. "Dc" then don't care, value stored in order if supplied, but not passed to payment method
  • Extensively validated (Ext.). => Yes then this field is extensively validated when supplied. No then field is not extensively validated.
OrderField iDEAL Creditcard PayPal Sofortbanking Klarna
Req. Ext. Req. Ext. Req. Ext. Req. Ext. Req. Ext.
countryIso3166Alpha2 Dc Yes No No Dc No Yes Yes Yes Yes
firstName Dc No No No Dc No Dc No Yes Yes
Klarna: Must always be supplied with the exception that for company orders in SE, NO, DK or FI, firstName is allowed to be "null".
lastName Dc No No No Dc No Dc No Yes Yes
Klarna: Must always be supplied with the exception that for company orders in SE, NO, DK or FI, lastName is allowed to be "null".
addressLine1 Dc No No No Dc No Dc No Yes Yes
Klarna: In DE,AT and NL assure a house number is present. In NL the house number extension should be present in the string as well if applicable.
zipCode Dc No No No Dc No Dc No Yes Yes
city Dc No No No Dc No Dc No Yes Yes
title Dc No Dc No Dc No Dc No Dc No
addressLine2 Dc No No No Dc No Dc No Dc No
stateProvince Dc No No No Dc No Dc No Dc No
dateOfBirth Dc No No No Dc No Dc No Yes Yes
Klarna: Required in Germany (DE), Austria (AT) and the Netherlands (NL). When Klarna is hosted the user is prompted for this information if it is not supplied.
emailAddress Dc No No No No No Dc No Yes Yes
gender Dc No No No Dc No Dc No Yes Yes
Klarna: Required in Germany (DE), Austria (AT) and the Netherlands (NL). When Klarna is hosted the user is prompted for this information if it is not supplied.
phoneNumber Dc No No No Dc No Dc No Yes Yes
Klarna: PhoneNumber or CellPhoneNumber is required for Klarna. If PhoneNumber is not set then CellPhoneNumber must have a value.
phoneNumber2 Dc No Dc No Dc No Dc No Dc No
cellPhoneNumber Dc No No No Dc No Dc No Yes Yes
Klarna: PhoneNumber or CellPhoneNumber is required for Klarna. If CellPhoneNumber is not set then PhoneNumber must have a value.
socialSecurityNumber Dc No Dc No Dc No Dc No Yes Yes
Required for Klarna in Sweden (SE), Finland (FI) and Norway (NO). When Klarna is hosted the user is prompted for this information if it is not supplied.
organisation Dc No No No Dc No Dc No Yes Yes
Klarna: Company orders are allowed in Sweden (SE), Norway (NO), Denmark (DK) and Finland (FI) only. For other countries value must not be set.
department Dc No Dc No Dc No Dc No Dc No
chamberOfCommerceNumber Dc No Dc No Dc No Dc No Yes Yes
Klarna: Required for company orders in Sweden (SE), Norway (NO), Denmark (DK) and Finland (FI) only. In other countries the value must not be set.
vatNumber Dc No Dc No Dc No Dc No Dc No

using System;
using System.Collections.Generic;
{
	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005042080338);

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		emailAddress:"youremail@email.com",
		phoneNumber:"0612345678");
}

<?php
require_once('autoloader.php');

// Prepare an update order message
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005042080338',null,null,null,null);

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Piet','Janssen','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,null,'youremail@email.com',null,'0612345678');
			

Payment_SetOrderShippingAddress

With this method you supply the shipping address of an order. Dependending on the payment method used the fields are extensively validated. If extensive validation is applied the rules are described in the last column. All string fields are checked if they don't contain tags at all times (<...>).

Name Required Type Description Extensive validation rules
countryIso3166Alpha2 No String 2 Character countrycode corresponding to the ISO3166-1 alpha 2 table Max length 2 characters, upper or lower case, must match a valid country abbreviation.
firstName No String First name of billing target May not contain control characters, digits or other characters except {.-&}.
lastName No String Last name of billing target May not contain control characters, digits or other characters except {-.'&}.
addressLine1 No String Typically contains street and house number May not contain control characters.
zipCode No String Contains zip-code of applicable address May not contain control or other characters. Must comply with country-specific formats.
city No String City of applicable address May not contain control characters, digits or other characters except {'-}.
title No String Title of person referred to in billing name, for example "Prof. Dr." May not contain control characters, digits or other characters except {.}.
addressLine2 No String Additional address line typically used in the UK and US May not contain control characters.
stateProvince No String State or Province if known May not contain control characters, other characters or digits
phoneNumber No String Phone number as entered by the user May not contain control characters, letters or other characters except {+-}. Must look like a valid phone number.
cellPhoneNumber No String Cell phone number as entered by the user May not contain control characters, letters or other characters except {+-}. Must look like a valid phone number.
organisation No String Name of organisation as entered by the user May not contain control characters.
department No String Department of organisation as entered by the user May not contain control characters.

Orderfields in relation to payment methods regarding validation

  • Required (Req.) => "Yes" then this field is mandatory. "No" then this field may optional be supplied and will be passed to the paymentmethod. "Dc" then don't care, value stored in order if supplied, but not passed to payment method
  • Extensively validated (Ext.). => Yes then this field is extensively validated when supplied. No then field is not extensively validated.
OrderField iDEAL Creditcard PayPal Sofortbanking Klarna
Req. Ext. Req. Ext. Req. Ext. Req. Ext. Req. Ext.
countryIso3166Alpha2 Dc Yes No No Dc No Yes Yes Yes Yes
firstName Dc No No No No No Dc No Yes Yes
Klarna: Must always be supplied with the exception that for company orders in SE, NO, DK or FI, firstName is allowed to be "null".
lastName Dc No No No No No Dc No Yes Yes
Klarna: Must always be supplied with the exception that for company orders in SE, NO, DK or FI, lastName is allowed to be "null".
addressLine1 Dc No No No No No Dc No Yes Yes
Klarna: In DE,AT and NL assure a house number is present. In NL the house number extension should be present in the string as well if applicable.
zipCode Dc No No No No No Dc No Yes Yes
city Dc No No No No No Dc No Yes Yes
title Dc No Dc No Dc No Dc No Dc No
addressLine2 Dc No No No No No Dc No Dc No
stateProvince Dc No No No No No Dc No Dc No
phoneNumber Dc No No No No No Dc No Yes Yes
Klarna: PhoneNumber or CellPhoneNumber is required for Klarna. If PhoneNumber is not set then CellPhoneNumber must have a value.
cellPhoneNumber Dc No No No Dc No Dc No Yes Yes
Klarna: PhoneNumber or CellPhoneNumber is required for Klarna. If CellPhoneNumber is not set then PhoneNumber must have a value.
organisation Dc No No No Dc No Dc No Yes Yes
Klarna: Company orders are allowed in Sweden (SE), Norway (NO), Denmark (DK) and Finland (FI) only. For other countries value must not be set.
department Dc No Dc No Dc No Dc No Dc No

using System;
using System.Collections.Generic;
{
	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005042080338);

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		phoneNumber:"0612345678");
}

<?php
require_once('autoloader.php');

// Prepare an update order message
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005042080338',null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Piet','Janssen','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678');
			

Payment_AddOrderItem

With this method you supply the order items of an order. Repeat this method until all order items are supplied.

Name Required Type Description Limits
orderLineNumber Yes Long The order line number, assures each item has a unique order line number. The order line number together with ItemType is used to uniquely reference a specific order line Range: [-2147483648 - 2147483647] advised Range: [-9223372036854775808 - 9223372036854775807] allowed but programming language limits may apply
  • iDEAL: no limit.
  • PayPal: value is not passed to PayPal.
  • Klarna: Value is not passed to Klarna.
name Yes String Article name, usually the acticle number May not contain control characters or tags.
description No String Article description May be null, if filled may not contain control characters or tags.
quantityOrdered Yes Integer Number of units ordered Limits: 1 - 21474863647
quantityCancelled Yes Integer Quantity cancelled Must be 0 when performing a payment. May not be negative or larger than quantity.
quantityInvoiced Yes Integer Quantity invoiced Must be 0 when performing a payment. May not be negative or larger than quantity - quantityCancelled.
quantityRefunded Yes Integer Quantity refunded Must be 0 when performing a payment. May not be negative or larger than quantityInvoiced.
unitPriceExclusiveVat Yes Integer Price per unit, excluding VAT and with discount applied. Currency to integer conversion applied. Limits: 0 - 21474863647. May not be equal to or greater than unitPriceInclusiveVat. Must be a negative integer (-1 - -21474863648) in case of itemtype "Discount"
unitPriceInclusiveVat No Integer Price per unit including VAT and with discount applied. Currency to integer conversion applied. Limits: 0 - 21474863647. If VAT is null then this must be null as well. Must be a negative integer (-1 - -21474863648) in case of itemtype "Discount"
vatPercentageDisplay No Integer Percentage to display * 100. For example 21% is 2100 Limits: 0 - 9900. If this is null then unitPriceInclusiveVat must be null as well.
itemType No ItemType ItemType of item, default is "Article" Possible values are defined by itemType.
  • iDEAL: can use all values.
  • Klarna: "Article", "PaymentCost" and "ShippingCost" are supported by Klarna, other values are passed as "Article" to Klarna.
discountPercentageDisplay No Integer Percentage to display * 100. For example 10% discount is 1000 Limits: 0 - 9999
skuCode No String SkuCode or barCode or whatever is convenient to store
  • iDEAL: no limit.
  • Klarna: Value is not passed to Klarna.
  • May not contain control characters or tags.
unitPriceMultiplyFactorOverride No Integer This factor overrides the currency-default factor used to convert prices with decimals to integers. In case of Euros, this value is set to 2, to turn decimal prices (like 1.23) into integers (123). If you have prices that need more decimal places, you give this parameter the value needed to convert your prices to integers. Suppose you have an item that costs 0.0007: you would give this parameter the value 4, as 0.0007 * 10^4 = 7.
  • Minimum value is the currency default (e.g. 2 for EUR)

using System;
using System.Collections.Generic;
{
	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005042080338);

	// Add order item info
	apiMessage.Payment_AddOrderItem(
		0,
		"fiets",
		"luxe fiets",
		1,0,0,0,
		70248,
		85000,
		2100,
		Article);
}

<?php
require_once('autoloader.php');

// Prepare an update order message
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005042080338',null,null,null,null);

// Add order item info
$apiMessage->payment_addOrderItem(0,"fiets","luxe fiets",1,0,0,0,70248,85000,2100,PayCheckout\ItemType::ARTICLE,null,null);
			

Payment_SetOrderInfo

With this method you supply customer info that you can add to an order.

Name Required Type Description Limits
customerOrderNumber Yes String The customer order number if applicable
  • iDEAL: no limit.
  • Klarna: Value is passed as "Reference" to Klarna.
  • May not contain control characters or tags.
customerNote Yes String The customer note if applicable
  • iDEAL: no limit.
  • Klarna: Value is passed as "Comment" to Klarna, but Klarna currently ignores this value.
  • May not contain control characters or tags.

using System;
using System.Collections.Generic;
{
	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005042080338);

	// Set CustomerOrderNumber and/or CustomerNote
	apiMessage.Payment_SetOrderInfo("Inkoop order:20150101","Graag met spoed");
}

<?php
require_once('autoloader.php');

// Prepare the KlarnaAccount payment
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005042080338');

// Set CustomerOrderNumber and/or CustomerNote
$apiMessage->Payment_setOrderInfo('Inkoop order:20150101','Graag met spoed');
			

Payment_SetQuantityMultiplyFactor

With this method you can specify you want to use non integer values for quantities. For example if you expect to be using quanties like "1.25" then you must specify a multiplyfactor of 2, indication 10^2 is 100. The real quantity for example 1.25 is multiplied by this factor resulting in integer value 125. This is analogue to multiply factors used by currencies.

NOTE: You can only set it when you START a payment, you can not alter it during processing orders! Attempting to do so will force the calling function to fail.

Name Required Type Description Limits
quantityMultiplyFactor Yes Integer The multiplication factor you want to apply on each supplied quantity to turn it into an integer. range [1..8]

using System;
using System.Collections.Generic;
{
	// Prepare the iDEAL payment
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.IDeal.Create("Order-18965","PayCheckout inzake WebShop",1000,"ABNANL2A","169.254.80.80");

    // Set fractional quanties with 2 digits
	apiMessage.Payment_SetQuantityMultiplyFactor(2);
}
                

<?php
require_once('../src/PayCheckout/autoloader.php');

// Prepare the iDEAL payment
$apiMessage = PayCheckout\Api\Payment\IDeal::create('Order-18965','PayCheckout inzake WebShop',1000,'ABNANL2A','169.254.80.80');

// Set fractional quanties with 2 digits
$apiMessage->payment_setQuantityMultiplyFactor(2);

                

Payment_OverrideConfiguredReturnUrls

With this method you override the return urls configured in the portal.

Name Required Type Description Limits
returnUrlSuccess No String The return URL for a successful payment. Must be a valid URL
returnUrlCancelled No String The return URL for a cancelled payment. Must be a valid URL
returnUrlFailed No String The return URL for a failed payment. Must be a valid URL

using System;
using System.Collections.Generic;
{
	// Prepare the iDEAL payment
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.IDeal.Create("Order-18965","PayCheckout inzake WebShop",1000,"ABNANL2A","169.254.80.80");

	// Set Return Url override
	apiMessage.Payment_OverrideConfiguredReturnUrls("https://www.example.com/override_success",null,null);
}
                

<?php
require_once('../src/PayCheckout/autoloader.php');

// Prepare the iDEAL payment
$apiMessage = PayCheckout\Api\Payment\IDeal::create('Order-18965','PayCheckout inzake WebShop',1000,'ABNANL2A','169.254.80.80');

// Set return url override
$apiMessage->payment_overrideConfiguredReturnUrls('https://www.example.com/override_success',null,null);
                

Payment_OverrideConfiguredNotificationUrl

With this method you override the notification url configured in the portal.

Name Required Type Description Limits
notificationUrl Yes String The return URL for a successful payment. Must be a valid URL

using System;
using System.Collections.Generic;
{
	// Prepare the iDEAL payment
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.IDeal.Create("Order-18965","PayCheckout inzake WebShop",1000,"ABNANL2A","169.254.80.80");

	// Set Notification Url override
	apiMessage.Payment_OverrideConfiguredNotificationUrl("https://www.paycheckout.com/ideal-checkout/notify.php");
}
                

<?php
require_once('../src/PayCheckout/autoloader.php');

// Prepare the iDEAL payment
$apiMessage = PayCheckout\Api\Payment\IDeal::create('Order-18965','PayCheckout inzake WebShop',1000,'ABNANL2A','169.254.80.80');

// Set notification url override
$apiMessage->payment_overrideConfiguredNotificationUrl('https://www.paycheckout.com/ideal-checkout/notify.php');
                

Payment_AddParameter

With this method you can add parameter data to a payment.

Currently supported additional payment parameters
Payment method Key Value Description
iDEAL IssuingBank ABNANL2A BIC code of ABN Amro bank
iDEAL IssuingBank ASNBNL21 BIC code of ASN bank
iDEAL IssuingBank INGBNL2A BIC code of Ing bank
iDEAL IssuingBank KNABNL2H BIC code of Knab bank
iDEAL IssuingBank RABONL2U BIC code of Rabobank
iDEAL IssuingBank RBRBNL21 BIC code of Regio bank
iDEAL IssuingBank SNSBNL2A BIC code of Sns bank
iDEAL IssuingBank TRIONL2U BIC code of Triodos bank
iDEAL IssuingBank FVLBNL22 BIC code of Van Lanschot bank
iDEAL IssuingBank BUNQNL2A BIC code of Bunq bank
KlarnaAccount PClassID 3114 Campaign number for example "3114"
<Any method> EnforceNoVAT True Enforce no VAT being calculated. Surcharge, if configured, will be calculated without VAT too.
<Any method> GoogleAnalyticsData <jsonDataOfCookie> The data read from the "gapco" cookie just before executing the payment.

using System;
using System.Collections.Generic;
{
	// Prepare the iDEAL payment
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.iDEAL.Create("Order-18965","PayCheckout inzake WebShop",1000,"ABNANL2A","169.254.80.80");

	// Add Parameter
	apiMessage.Payment_AddParameter("GoogleAnalyticsData","{"UA-52808866-2":{"name":"t0","clientId":"1522592134.1446540134"}}");
}
                

<?php
require_once('../src/PayCheckout/autoloader.php');

// Prepare the iDEAL payment
$apiMessage = PayCheckout\Api\Payment\IDeal::create('Order-18965','PayCheckout inzake WebShop',1000,'ABNANL2A','169.254.80.80');

// Add Parameter
$apiMessage->payment_addParameter('GoogleAnalyticsData','{"UA-52808866-2":{"name":"t0","clientId":"1522592134.1446540134"}}');
                

Jobs

Jobs are calls that create jobs on our transaction system that are executed in "batch" mode. The basic idea is that you make the apiCall and if the ApiResult is "Success" then the job is succesfully submitted.

Klarna Update PClasses

PayCheckout. Api. Job. Klarna. UpdatePClasses

This jobs starts a job that will contact Klarna and update the PClasses in your configuration. PClasses are the way Klarna defines Campaigns. When the job finishes an email is sent to the notification email address as supplied in the webshop configuration. You can also start this job in the portal by pressing "Update campaigns", so normally you don't have to implement this in your application. Klarna will communicate with you if you have to update the PClasses/Campaigns. The job also has protection for starting it too frequently. You can submit it as many times as you like, but the job will be executed only once each hour of the day.


using System;
using System.Collections.Generic;
{
	// Prepare the klarna job
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Job.Klarna.UpdataPClasses();

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Job was succesfully submitted
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');
// Prepare the Klarna Job to update PClasses

$apiMessage = PayCheckout\Api\Job\Klarna::updatePClasses();
// Create an executor instance

$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success, the job is submitted
}
else
{
	// Analyze why the job failed
}
		

Service calls

Service calls are API calls that send requests to the transaction system and expect a response from it. Service calls are used to do various things that are payment related. Some calls return information, in that case use a "Response" api call to extract the returned data from the response message. See each individual call for more details.

GetAvailablePaymentMethods

PayCheckout.Api.Service.GetAvailable Payment Methods.Create

This function is introduced to assist in presenting available payment methods to the webshop visitor. As a developer you supply the checkout-amount and currency. You supply the cultureInfo name only if you want to override the cultureInfo that you have configured in the portal for this website. The billing info is supplied with the standard ApiMessage enrich function Payment_SetOrderBillingAddress. The paymentmethods are presented in the order as configured in the portal. NOTE: Omitting the billing information severely limits availability of payment methods.

As of libversion 1.2.0.2 and higher, the information returned now has an issuerlist for iDEAL. The most interesting change is that from this version and newer versions the list of presented payment methods is sorted on a per user preference. Each paymentmethod that is presented in a user preferred way has the isPreferred flag set. Payment methods that have the isPreferedflag set as false are sorted in the way as configured in the portal as in previous versions. You could consider to automatic select the topmost paymentmethod that has the isPreferredFlag set to true, highlight the other preferred methods that have isPreferredFlag true and show the remaining paymentmethods in non highlighted way. Or more drastically show only the topmost preferred method and give an option to show the remaining paymentmethods.

The issuerList has simular behaviour as the payment methods, if the topmost entry has the Preferredflag set to true this is the most likely choice the user wil make, based on the users history. If no history is present the issuerlist is shown alfabetically sorted on BIC code.

The following parameters apply:

Name Required Type Description Limits
amount Yes Int The total amount that must be paid, calculated as in integer according to the used currency. Minimum 1. Maximum order amounts are limited by the choosen payment method
currency Yes Enum (C#)/Integer (PHP) The currency the future payment is in. One of the supported currencies.
customerIpAddress Yes String The customer's IP address Must be a valid public IP address.
cultureInfo No String 'null' use portal configured value. When specified, the name of the cultureInfo you want to use. Must be a supported cultureInfo. When the supplied value has no match, the portal configured cultureInfo will be used.
enforceNoVat No Bool (C#) String (other) Can only be true or false (null in PHP is allowed too) When set to true enforces configured surcharges to be calculated without VAT and validates order items do not have VAT applied.

On return the function returns a list/array of AvailablePaymentMethod classes which can be used to complete payment of this order. For each configured paymentmethod that fails validation one or more warnings are present indicating the reason why that method failed selection. When no paymentmethods survive the selection ErrorCode "RequestNoSuitablePaymentMethodsFound" is returned.


using System;
using System.Collections.Generic;
{
	// Create the GetAvailablePaymentMethod request
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.GetAvailablePaymentMethods.Create(1000,PayCheckout.Currency.EUR,"10.10.10.100");

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress(
					"NL",
					"Testperson-nl",
					"Approved",
					"Neherkade 1 XI",
					"2521VA",
					"'s Gravenhage",
					dateOfBirth:"10-07-1970",
					emailAddress:"youremail@email.com",
					gender:"Male",
					phoneNumber:"0612345678");

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can retrieve AvailablePaymentMethods data
		var AvailablePaymentMethods = PayCheckout.Api.Service.GetAvailablePaymentMethods.Response(response);

		if (AvailablePaymentMethods != null)
		{
			// Available payment methods are available, do something smart with it
		}
	}
	else
	{
		// Analyze why GetAvailablePaymentMethods failed
	}
}

<?php

require_once('../src/PayCheckout/autoloader.php');

// Create the GetAvailablePaymentMethod request
$apiMessage = PayCheckout\Api\Service\GetAvailablePaymentMethods::create(1000,PayCheckout\Currency::EUR,'10.10.10.100');

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL',
					'Testperson-nl',
					'Approved',
					'Neherkade 1 XI',
					'2521VA',
					'\'s Gravenhage',
					null,
					null,
					null,
					DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),
					'youremail@email.com',
					PayCheckout\Gender::MALE,
					'0612345678',
					null,null,null,null,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can retrieve availablePaymentMethods data
	$availablePaymentMethods = PayCheckout\Api\Service\GetAvailablePaymentMethods::response($response);

	if ( $availablePaymentMethods != null )
	{
		// An array of availablePaymentMethods has been retrieved, do something smart with it.
	}
}
else
{
	// Analyze why GetAvailablePaymentMethods failed
}
			

CancelOrder

PayCheckout. Api. Service. CancelOrder. Create

Scenario 1: The payment method involved (for example Klarna) computes a supplied order in different phases. On receival of the payment the order is seen as a reservation first. Then when goods are delivered an invoice is created and send to the customer. The fact that the reservation has been accepted indicates the customer has passed the credit check of the payment method used. If no goods have been invoiced yet, or only a part of the reservation has been invoiced and the customer indicates he does not want the remaining goods to be delivered, the function CancelOrder should be called.

The function CancelOrder will cancel all (remaining) items of an order that have not been invoiced yet. As a result the reservation amount will decrease with the amount of the reservation that was remaining at the time the function was called. If nothing was invoiced yet, the balance will stay zero, otherwise the balance will still show the balance of the already invoiced items. The transaction system will analyse the affected order and reservation and will call the appropiate API calls of the payment method to accomplish this task.

Scenario 2: A customer has ordered and paid the goods by a payment method that utilizes a pre-paid approach. Examples are IDeal and Creditcard payments. CancelOrder in this scenario will perform a refund on all the items that have not been invoiced and modifies the order to reflect this scenario. The balance will decrease with the items that have not been invoiced yet and an affiliated refund will show up in the payments dashboard. An orderchange notification will be sent, with the "quantityCancelled" increased to the quantities that could be refunded because they where not invoiced yet. If all items in this scenario are invoiced, CancelOrder will respond with an error because the order is not cancelable anymore. To refund invoiced items you must use "UpdateOrder".

There is one mandatory input parameter and the optional parameter ProcessOffline:

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference. Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.
ProcessOffline No bool If cancelled "offline" specify value true Can only be true or false (null in PHP is allowed too)

If the ApiResponse ApiResult is "Success" then the (remainder of the) reservation was succesfully cancelled. If no items have been invoiced and thus the whole reservation is cancelled then the payment status will change from "Paid" into "Cancelled". In all other cases the error(s) tell(s) the reason why the function failed.

When CancelOrder is succesfull the altered order will be communicated by sending a Notification with a "OrderChanged" to the specified webshop url.


using System;
using System.Collections.Generic;
{
	// Prepare the cancel order action
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.CancelOrder.Create(201501005176298002);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, the order has been cancelled succesfully
	}
	else
	{
		// Analyze why the order could not be cancelled
	}
}

<?php
require_once('autoloader.php');
// Prepare the cancel order action
$apiMessage = PayCheckout\Api\Service\CancelOrder::create('201501005176298002');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, the order has been cancelled succesfully
}
else
{
	// Analyze why the order could not be cancelled
}		

Refund

PayCheckout. Api. Service. Refund. Create

Scenario : You decide to return an amount of money to a customer that is NOT related to an order item. For scenario's where you want to refund returned goods use "UpdateOrder" instead! The amount can be with or without VAT applied, depending on the parameters you supply. If you don't want VAT applied specify "AmountInclVat" equal to "AmountExclVat" and specify the "VatDisplayPercentage" as zero. If the payment method involves generation of invoices and you want the refund amount to appear on a certain invoice you must specify the transactionreference where that specific invoice was created, otherwise the system will try to find a suitable invoice the amount can be credited on (assuming one exists). The "CustomerNote" can be used to explain what the refund is about and depending on the payment method will appear on the Bankaccount remark section or on an affected invoice.

The function Refund will try to return the specified amount to the customer. As a programmer you specify WHAT you want and the transaction system will try to figure out HOW to do it. The transaction system will compute the request in the following manner:

  • If the payment method involved is iDEAL, the amount is refunded by a SEPA bank transfer directly to the consumer, assuming your Merchant balance allows this. Otherwise, the action is delayed until the balance is sufficient to execute it.
  • If the payment method is Klarna we have two situations:
    • You have supplied the "TransactionReference" (where the invoice is created) that you want the refund to appear on.
    • You did not specify a "TransactionReference". In that case the system tries to find an invoice which can refund the required amount in newest to oldest order. When no invoice can be found an error will result.

The following parameters apply:

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference of the payment we want to refund. Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.
amountInclVat Yes Integer The amount to refund including VAT. The amount is converted to an integer using the amount and currency. Amount must not be larger than payment and in case an invoice is specified not larger than the invoice amount. If VAT is null than this must be null as well.
amountExclVat Yes Integer The amount to refund excluding VAT. The amount is converted to an integer using the amount and currency. Amount must be related to AmountInclVat and VatDisplayPercentage.
vatDisplayPercentage Yes Integer The VAT amount * 100 or Zero if no VAT is applied. (Example 21% is 2100). Null or between 0 and 9900. If the value is null then amountInclVat must be null as well.
refundInvoiceTransaction No Int64 (C#)/String (PHP) The transaction reference of the transaction (where the invoice was created) you want the refund to be applied on. Note for PHP: Due to Integer restrictions in PHP we use a string to identify transaction references.
customerNote No String The description you want to show to the customer regarding the refund. Will appear on invoice or bankaccount statement. Payment methods may restrict the length of the customer note. May not contain control characters or tags.
processOffline No Bool Set to true if you just want to register you performed a refund in offline modus false/null (default) - no effect, true - in effect

If the ApiResponse ApiResult is "Success" then the (remainder of the) reservation was succesfully cancelled. If no items have been invoiced and thus the whole reservation is cancelled then the payment status will change from "Paid" into "Refunded". In all other cases the error(s) tell(s) the reason why the function failed.

When the refund is succesfull the altered order or plain refund will be communicated by sending a Notification with a "OrderChanged" or "RefundInformation" to the specified webshop url.


using System;
using System.Collections.Generic;
{
	// Prepare the refund action
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.Refund.Create(201501005167909458,1000,826.2100,null,"Extra korting");

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, the refund has been applied succesfully
	}
	else
	{
		// Analyze why the discount could not be applied
	}
}

<?php
require_once('autoloader.php');

// Prepare the refund action
$apiMessage = PayCheckout\Api\Service\Refund::create('201501005167909458',1000,826,2100,null,'Extra korting');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);
// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, the refund has been applied succesfully
}
else
{
	// Analyze why the refund could not be applied
}		

UpdateOrder

PayCheckout. Api. Service. UpdateOrder. Create

Update order is one of the most powerful service calls available in the system. The idea behind this call is that you tell the system WHAT you want the order to look like. The transaction system will figure out HOW to make it happen. This simplifies programming backoffice actions significantly. As a programmer you don't have to worry on what payment method is used or what API calls should be used to accomplish the wanted task. In all scenarios the transaction system will compare the new order information with the last successful order operation and then makes an action plan on what to do and execute it.

In the next sections we will show various scenario's that can be handled by the update order call.

Create the ApiMessage and supply the payment reference of the order you want to update, then supply additional parameters where applicable:

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference of the payment we want to update the order from. Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.
invoiceNumber No String The invoice number of the invoice to generate for scenario "creating invoice" when the payment method itself does not generate invoice numbers. Leave "null" if not used. When payment method is KlarnaInvoice/KlarnaAccount this parameter does nothing as Klarna generates their own invoice numbers.
refundInvoiceTransaction No Int64 (C#)/String (PHP) The transaction reference (where you have created the invoice) you want to refund an amount or items from. If no refund scenario is active leave "null". Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.
refundCreditNumber No String In case you are refunding items the credit invoice number you want to use. Be aware that using characters other than numbers [0..9] may lead to the transaction system filtering the non numeric characters out of the string if the underlying payment method does not support alphanumeric credit numbers.
refundCost No class refundCost When refunding items you may supply a RefundCost class to account for cost like restocking cost. See RefundCost for limits.
TrackAndTraceInfo No class TrackAndTraceInfo When refunding items you may supply a TrackAndTraceInfo class to supply track and trace info when performing billing. See TransactionInfo for limits.
parameters No AssociatedArray (PHP), Dictionary<String,String> (C#) Specify key/value data for specific payments (See table) Key and Value must both be strings.

Find below the supported parameters

Key Value Description
ProcessOffline True Specify this parameter if you want to update the order, but you do not want to execute the required actions on the corresponding payment methods. Typical usage is in cases where a webshop runs in cooperation with a store. When invoices or refund actions are performed in the store only the administrative part of the update order needs to be done.
ExpectedMutationAmount Integer This value represents the value calculated by the shopmodule or customized software that it expects the paymentbalance to change. The transaction system tries to assist in handling rounding differences that can occur due to different calculation algorithms used. For more details see the section Parameter ExpectedMutationAmount.

After the "ApiMessage" is created you enrich the message with the relevant order info. This information is supplied by calling one or more of the methods for adding billing, shipping, info or items. According to different scenarios you supply the relevant data. Keep in mind that when you supply order items you always supply ALL orderitems so that the transaction system can detect the differences.

You may call the methods for adding order information in any order. There are four methods available to add order information:

If the ApiResponse ApiResult is "Success" then the whole update order action was succesfully completed. If the ApiResult is "PartialOk" then the change is not completely executed and you should check the warnings on what part failed. You can always use the service calls GetPaymentInfo or GetTransactionInfo to investigate how the order is currently administered in the system or view them in the portal. If the ApiResult of ApiResponse is "Failed" then the error(s) tell(s) the reason why the function failed and the order is not changed.

When the update is succesfull the altered order will be communicated by sending a Notification with a "OrderChanged" to the specified webshop url.

Parameter ExpectedMutationAmount

The ExpectedMutationAmount parameter assists in handling rounding differences that occur due to different algorithms used to calculate orderitem total amounts. The amount represents the amount the balance of the payment will be altered by the proposed updateorder action. Keep in mind that when invoicing "paid" payments no change in balance will occur. If you expect rounding differences while updating orderitem quantities you can enforce the transactionsystem to follow the calculation of the shopmodule within reasonable limits. Amounts are always passed as integers and so this parameter is expected to have an integer value too. The (integer) value itself is passed as a string to be consistent with the parameter passing mechanism. The expectedmutationamount value may differ as much as value 3 + total quantity of all orderlines. For example if you order 2 items this will in Euro allow a difference of 5 cents. The most common use of this parameter is when you generate refunds because goods are returned or you have cancelled order items. If the paymentmethod allows it, the transaction system will generate a refund that is exactly the ExpectedMutationAmount. If the expectedmutationamount is within limits but the value is a larger amount then originally was paid then the value is maximized. This assures you do not refund a larger amount then initially paid avoiding negative balances.

For example your shop module wants to refund 1 item of Euro 8,26 excl. It calculates this value as Euro 9,99 incl (21%) VAT while the transaction system uses the exact incl. value of Euro 10,00. In this situation you would like to refund 9,99 instead of the 10 Euro. In this case you would specify the ExpectedMutationAmount to have the value "-999". Negative because you will be refunding. This results in -(9,99 * 100) = "-999".

Scenario: Alter Billing Or Shipping Address

You decide that you want to change the billing or shipping address information of your order so that invoices that will be created after the change will show correct address information. Any invoices that were already created before the change are not affected by this change.

Limitations and restrictions

The following limits apply:

  • Changing the billing or shipping address may lead to a new credit check which can result in the change being refused.
  • You can only change an address if there are items left to be invoiced.

Parameters to supply

You supply the payment reference of the order.

Order data to supply

You supply billing address and/or shipping address. In either case you enter all (known) parameters, including the one that is changing for each function method. So if, for example, only the first name has changed in the billing address you have to supply the complete billing address.

"ApiMessage" methods applicable:


using System;
using System.Collections.Generic;
{
	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005193075226);

	// Set the new altered billing address info, all known parameters are supplied!
	apiMessage.Payment_SetOrderBillingAddress("NL","Piet","Janssen","Neherkade 1 XI","2521VA","'s Gravenhage",dateOfBirth:"10-07-1970",emailAddress:"youremail@email.com",gender:"Male",phoneNumber:"0612345678");

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, the order billing address has been updated succesfully
	}
	else
	{
		// Analyze why the order update could not be applied
	}
}

<?php
require_once('autoloader.php');

// Prepare an update order message
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005193075226',null,null,null,null);

// Set the new altered billing address info, all known parameters are supplied!
$apiMessage->payment_setOrderBillingAddress('NL','Piet','Janssen','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, the order billing address has been updated succesfully
}
else
{
	// Analyze why the order update could not be applied
}
		

Scenario: Invoicing items

You have delivered goods and you want to invoice them. In order to invoice goods you simply increment the "QuantityInvoiced" value with the item amount that is being delivered. If you have multiple order lines and multiple goods delivered increment the "QuantityInvoiced" with the number of items delivered. Each update order call generates exactly one invoice. So if a customer has ordered 4 items and you deliver 1 item and this is the first invoice created. You would set "QuantityOrdered" = 4 and "QuantityInvoiced" = 1.

Limitations and restrictions

The following limits apply:

  • The reservation must not be cancelled previously.
  • Range checks are applied on the supplied numbers.

Parameters to supply

You supply the "PaymentReference" of the order. If you have Track and Trace info available supply this by creating a Json.Generic.Invoice.TrackAndTraceInfo class and fill it with track and trace data. Supply the new class as a parameter to the UpdateOrder call. Depending on the payment method that is used you may need to supply an "InvoiceNumber" if the payment method does not generate an invoice number automatically. The table below shows what to do:

Payment method Supply "InvoiceNumber"
iDEAL Yes
CreditCard Yes
Klarna Invoice No
Klarna Account No

Order data to supply

You supply the order items of the order by calling AddOrderItem repeatedly for ALL order items. Increase the "QuantityInvoiced" of all goods that need to be invoiced.

"ApiMessage" method applicable:


using System;
using System.Collections.Generic;
{
	// Prepare the Klarna invoice payment of 4 bicycles of 540 Euro each (total order EUR 2160 )
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.KlarnaInvoice.Create("Order-51456","PayCheckout inzake WebShop",216000,"EUR");

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress("NL","Testperson-nl","Approved","Neherkade 1 XI","2521VA","'s Gravenhage",dateOfBirth:"10-07-1970",emailAddress:"youremail@email.com",gender:"Male",phoneNumber:"0612345678");
	// Set order shipping address info

	apiMessage.Payment_SetOrderShippingAddress("NL","Testperson-nl","Approved","Neherkade 1 XI","2521VA","'s Gravenhage",phoneNumber:"0612345678");
	
	// Add order item info with the order of 4 bicycles
	apiMessage.Payment_AddOrderItem(0,"gazelle-sport","Gazelle sport",4,0,0,0,44628,54000,2100,Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success indicates the reservation was succesfull (store the pament reference with the order)
	}
	else
	{
		// Analyze why it failed
	}

 	// Now invoice 1 bicycle and leave 3 bicycles in backorder

    // Supply track and trace of this shipment
    var trackAndTrace = new PayCheckout.Json.Generic.Invoice.TrackAndTraceInfo()
    {
        TrackingNumber        = "3445445",
        TrackingUrl           = "https://www.carrier.local/information_on_tracking",
        ShippingCompany       = "MyCarrier",
        ShippingMethod        = "home delivery",
        ReturnTrackingNumber  = "7894568",
        ReturnTrackingUrl     = "https://www.myreturncarrier.local/information_on_tracking",
        ReturnShippingCompany = "MyReturnCarrier",
        
    };

	// Prepare an update order message (supply paymentReference and TrackAndTrace information)
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005050337882,trackAndTraceInfo:trackAndTrace);

	// Add order item info specifify quantity invoice as 1.
	apiMessage.Payment_AddOrderItem(0,"gazelle-sport","Gazelle sport",4,0,1,0,44628,54000,2100,Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success an invoice was created
	}
	else
	{
		// Analyze why the order update could not be applied
	}
}

<?php
require_once('autoloader.php');

// Prepare the Klarna invoice payment of 4 bicycles of 540 Euro each (total order EUR 2160 )
$apiMessage = PayCheckout\Api\Payment\KlarnaInvoice::create('Order-51456','PayCheckout inzake WebShop',216000,PayCheckout\Currency::EUR);

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null);

// Add order item info with the order of 4 bicycles
$apiMessage->payment_addOrderItem(0,"gazelle-sport","Gazelle sport",4,0,0,0,44628,54000,2100,Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success indicates the reservation was succesfull (store the pament reference with the order)
}
else
{
	// Analyze why it failed
}

// Now invoice 1 bicycle and leave 3 bicycles in backorder

// Supply track and trace of this shipment
$trackAndTrace = new PayCheckout\Api\Json\Generic\Invoice\TrackAndTraceInfo();

$trackAndTrace->set('3445445','https://www.carrier.local/information_on_tracking','MyCarrier','home delivery','7894568','https://www.returncarrier.local/information_on_tracking','MyReturnCarrier');

// Prepare an update order message (Supply payment reference and track and trace information)
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005050337882',null,null,null,null,$trackAndTrace);

// Add order item info specifify quantity invoice as 1.
$apiMessage->payment_addOrderItem(0,"gazelle-sport","Gazelle sport",4,0,1,0,44628,54000,2100,Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success an invoice was created
}
else
{
	// Analyze why the order update could not be applied
}		

Scenario: Refund items

You have delivered and invoiced goods and then some or all of the goods are returned and must be refunded. You apply this scenario by setting the "QuantityRefunded" of the corresponding order itemline(s) to the amount of items that need to be refunded. As the goods are invoiced one or more invoices can be present for this order. Also one order item line that has an "QuantityOrdered" larger than one can have several invoices. This can lead to complex scenario's. In all scenario's the transaction system will try to find the most logical action scheme. If you want to add a charge while refunding for example for "restocking" this is possible (See parameters section). If you are not sure how to handle a scenario be free to test it using the demonstrator tool in our sandbox.

Example 1

Basic: one item ordered, invoiced and refunded.

Orderline Ordered Invoiced Refunded Action
0 1 0 0 A (Payment)
0 1 1 0 B (UpdateOrder)
0 1 1 1 C (UpdateOrder)
  • A - The order is created by a payment.
  • B - Invoice is created.
  • C - The item is refunded.

Example 2

Two items ordered, 2 invoices created because one was on stock and one was taken in backorder and delivered later. Then the last delivered item was returned and needs to be refunded.

Orderline Ordered Invoiced Refunded Action
0 2 0 0 A (Payment)
0 2 1 0 B (UpdateOrder)
0 2 2 0 C (UpdateOrder)
0 2 2 1 D (UpdateOrder)
  • A. The order is created by a payment, 2 items were ordered.
  • B. One item was delivered and an invoice is created, each update order generates an unique transaction reference. In your application store the transaction reference as an attribute of the invoice.
  • C. The second item was delivered at a later point in time and an invoice is created. This invoice also has an unique transaction reference assigned. Store it too with your invoice.
  • D. As two invoices were generated you have two invoices that are candidate for refunding. If you want to specify which invoice to use you must supply the transaction reference where the invoice of your choice was created. If you don't supply the transaction reference the transaction system will search for an invoice in newest to older order. In this situation the second invoice would be targeted for the refund.

Limitations and restrictions

The following limits apply:

  • If you provide a "RefundCost" class assure that only one invoice gets affected by the change. So if the order contained 2 items and two invoices were created, you should not set the refund quantity to "2".
  • You can refund multiple invoices at once (when no refundcost is supplied) by specifying refund quantities that address more than one invoice, but be aware that your "CreditInvoiceNumber" will be used for multiple invoices which might frustrate your accountant.

Parameters to supply

You supply the "PaymentReference" of the order and don't supply the "InvoiceNumber" as there is nothing to be invoiced. Supply the "RefundInvoiceTransaction" when two or more invoices are created for one order item. If you omit this information the newest invoice will be used for refunding. Supply a "RefundCost" class if you want to charge the user some additional cost regarding the refund.

Order data to supply

You supply the order items of the order by calling AddOrderItem repeatedly for ALL order items. Increase the "QuantityRefunded" of all goods that need to be refunded.

"ApiMessage" method applicable:


using System;
using System.Collections.Generic;
{
	// Prepare the Klarna invoice payment for Example 2
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.KlarnaInvoice.Create("Order-51456","PayCheckout inzake WebShop",10000,"EUR");

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress("NL","Testperson-nl","Approved","Neherkade 1 XI","2521VA","'s Gravenhage",dateOfBirth:"10-07-1970",emailAddress:"youremail@email.com",gender:"Male",phoneNumber:"0612345678");

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress("NL","Testperson-nl","Approved","Neherkade 1 XI","2521VA","'s Gravenhage",phoneNumber:"0612345678");

	// Add order item info
	apiMessage.Payment_AddOrderItem(0,"radio-dab","Radio DAB+",2,0,0,0,4132,5000,2100,Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success, the payment was succesfull
	}
	else
	{
		// Analyze why it failed
	}

	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005184555610);

	// Add order item info, 1 radio is invoiced 
	apiMessage.Payment_AddOrderItem(0,"radio-dab","Radio DAB+",2,0,1,0,4132,5000,2100,Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
 		// Success, the first radio is invoiced
	}
	else
	{
		// Analyze why the order update could not be applied
	}
	
	// Prepare an update order message
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005184555610);

	// Add order item info, the 2nd radio is invoiced 
	apiMessage.Payment_AddOrderItem(0,"radio-dab","Radio DAB+",2,0,2,0,4132,5000,2100,Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
 		// Success, the second radio is invoiced
	}
	else
	{
		// Analyze why the order update could not be applied
	}

	// Prepare an update order message, specify refundCreditNumber as "10", we don't specify an invoice transaction reference
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.UpdateOrder.Create(201501005184555610,refundCreditNumber:"10");

	// Add order item info, specify one radio needs to be refunded on the last invoice
	apiMessage.Payment_AddOrderItem(0,"radio-dab","Radio DAB+",2,0,2,1,4132,5000,2100,Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success the last invoice was refunded
	}
	else
	{
		// Analyze why the order update could not be applied
	}
}

<?php
require_once('autoloader.php');

// Prepare the Klarna invoice payment for example 2
$apiMessage = PayCheckout\Api\Payment\KlarnaInvoice::create('Order-51456','PayCheckout inzake WebShop',10000,PayCheckout\Currency::EUR);

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null);

// Add order item info
$apiMessage->payment_addOrderItem(0,"radio-dab","Radio DAB+",2,0,0,0,4132,5000,2100,Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);
// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success, the payment was succesfull
}
else
{
	// Analyze why it failed
}

// Prepare an update order message
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005184555610',null,null,null,null);

// Add order item info, 1 radio is invoiced
$apiMessage->payment_addOrderItem(0,"radio-dab","Radio DAB+",2,0,1,0,4132,5000,2100,Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success, the first radio is invoiced
}
else
{
	// Analyze why the order update could not be applied
}

// Prepare an update order message
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005184555610',null,null,null,null);

// Add order item info, second radio is invoiced
$apiMessage->payment_addOrderItem(0,"radio-dab","Radio DAB+",2,0,2,0,4132,5000,2100,Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success, the second radio is invoiced
}
else
{
	// Analyze why the order update could not be applied
}

// Prepare an update order message, specify refundCreditNumber as "10", we don't specify an invoice transaction reference
$apiMessage = PayCheckout\Api\Service\UpdateOrder::create('201501005184555610',null,null,'10',null);

// Add order item info, specify one radio needs to be refunded on the last invoice
$apiMessage->payment_addOrderItem(0,"radio-dab","Radio DAB+",2,0,2,1,4132,5000,2100,Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success the last invoice was refunded
}
else
{
	// Analyze why the order update could not be applied
}
		

GetCurrentConfiguration

PayCheckout. Api. Service. Get Current Configuration. Create

With this service call you retrieve the current configuration as entered by the user in the portal. This is useful for example for webshop module implementers to retrieve the configuration. There are no input parameters.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Get Current Configuration. Response

to fill the Configuration class.


using System;
using System.Collections.Generic;
{
	// Create the GetCurrentConfiguration request
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.GetCurrentConfiguration.Create();

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can retrieve configuration data
		PayCheckout.Json.Generic.Configuration.Configuration configuration = PayCheckout.Api.Service.GetCurrentConfiguration.Response(response);
		if (configuration != null)
		{
			// Configuration is now loaded, do something smart with it
		}
	}
	else
	{
		// Analyze why GetCurrentConfiguration failed
	}
}

<?php
require_once('autoloader.php');
// Create the GetCurrentConfiguration request
$apiMessage = PayCheckout\Api\Service\GetCurrentConfiguration::create();

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can retrieve configuration data
	$configuration = PayCheckout\Api\Service\GetCurrentConfiguration::response($response);

	if ( $configuration != null)
	{
		// Configuration has been retrieved, do something smart with it.
	}
}
else
{
	// Analyze why GetCurrentConfiguration failed
}			

GetPaymentInfo

PayCheckout. Api. Service. Get Payment Info. Create

With this service call you retrieve all information about a payment by its payment reference. There is one input parameter:

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference. Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Get Payment Info. Response

to fill the Paymentinfo class.


using System;
using System.Collections.Generic;
{
	// Prepare GetPaymentInfo
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.GetPaymentInfo.Create(201501005042080274);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can now retrieve the PaymentInfo
		PayCheckout.Json.PaymentInfo.PaymentInfo paymentInfo = PayCheckout.Api.Service.GetPaymentInfo.Response(response);

		if (paymentInfo != null)
		{
			// Do something smart with the received paymentInfo
		}
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare GetPaymentInfo
$apiMessage = PayCheckout\Api\Service\GetPaymentInfo::create('201501005042080274');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can now retrieve the PaymentInfo
	$paymentInfo = PayCheckout\Api\Service\GetPaymentInfo::response($response);

	if ($paymentInfo != null)
	{
		// Do something smart with the received paymentInfo
	}
}
else
{
	// Analyze why it failed
}				

GetTransactionInfo

PayCheckout. Api. Service. Get Transaction Info. Create

With this service call you retrieve all information about a transaction within a payment by specifying its payment reference and transaction reference. There are two input parameters:

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference. Note for PHP: Due to Integer restrictions in PHP we use a string to identify a payment reference.
transactionReference Yes Int64 (C#)/String (PHP) The transaction reference. Note for PHP: Due to Integer restrictions in PHP we use a string to identify a transaction reference.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Get Transaction Info. Response

to fill the Transactioninfo class.


using System;
using System.Collections.Generic;
{
	// Prepare GetTransactionInfo
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.GetTransactionInfo.Create(201501005042080274,201501005042080274);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can now retrieve the PaymentInfo
		PayCheckout.Json.PaymentInfo.TransactionInfo transactionInfo = PayCheckout.Api.Service.GetTransactionInfo.Response(response);

		if (transactionInfo != null)
		{
			// Do something smart with the received transactionInfo
		}
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare GetTransactionInfo
$apiMessage = PayCheckout\Api\Service\GetTransactionInfo::create('201501005042080274','201501005042080274');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can now retrieve the TransactionInfo
	$transactionInfo = PayCheckout\Api\Service\GetTransactionInfo::response($response);

	if ($transactionInfo != null)
	{
		// Do something smart with the received transactionInfo
	}
}
else
{
	// Analyze why it failed
}				

IDealGetDirectory

PayCheckout. Api. Service. IDeal Get Directory. Create

With this service call you retrieve all currently available issuing banks for iDEAL, for each available country. There are no input parameters. Over time, banks may be added or removed, it's advised to use this call to refresh the available banks at least once a month.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. IDeal Get Directory. Response

to fill the collection of Country classes.


using System;
using System.Collections.Generic;
{
	// Create the GetDirectory request
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.IDealGetDirectory.Create();

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can retrieve directory data
		List<Paycheckout.Api.Service.IDealGetDirectory.Country> countries = PayCheckout.Api.Service.IDealGetDirectory.Response(response);

		if (countries != null)
		{
			// countries is now filled, do something smart with it
		}
	}
	else
	{
		// Analyze why the GetDirectory failed
	}
}

<?php
require_once('autoloader.php');

// Create the GetDirectory request
$apiMessage = PayCheckout\Api\Service\IDealGetDirectory::create();

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can retrieve country data
	$countrydata = PayCheckout\Api\Service\IDealGetDirectory::response($response);

	if ( $countrydata != null )
	{
		// countrydata has been retrieved, do something smart with it.
	}
}
else
{
	// Analyze why the GetDirectory failed
}				

KlarnaAccountGetInstallmentsInfo

PayCheckout. Api. Service. Klarna Account Get Installments Info. Create

With this service call you retrieve all the possible installments the consumer can be offered. Installments can be calculated based on the amount in the checkoutpage or on a product page. You specifiy the amount source by specifying "OnProductPage" or "OnCheckoutPage". In case of a checkout action, after presenting the options to the consumer and letting him/her select one of the offered options, you use the corresponding PClassId in the call to the KlarnaAccount payment to perform the payment. It is not uncommon to have only one option, in that case you don't have to offer a selection, you can just select the PClassID from the one and only installment to the payment.

The following parameters are needed:

Name Required Type Description Limits
countryIso3166Alpha2 Yes String The ISO-3166 two character country the consumer is originating the order from. Max 2 chars
currency Yes (enum/class) Currency The currency the amount is paid in. Must be one of the supported currencies.
checkoutAmount Yes Integer The amount of the order or product that needs to get paid. Integer conversion for currency/amount must be applied. Amount might be limited according to the contract with Klarna.
target No (enum/class) KlarnaInstallmentCalculationTarget Specify one of the values as defined in the enum KlarnaInstallmentCalculationTarget. By default the amount is assumed to be the amount on the checkout page.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Klarna Account Get Installments Info. Response

to receive a collection of InstallmentInfo classes.


using System;
using System.Collections.Generic;
{
	// Fetch Klarna installments
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.KlarnaAccountGetInstallmentsInfo.Create("NL",EUR,10000);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can now retrieve the InstallmentInfo list
		List <Paycheckout.Api.Service.KlarnaAccountGetinstallmentsInfo.InstallmentInfo> listInstallments = PayCheckout.Api.Service.KlarnaAccountGetInstallmentsInfo.Response(response);
		if (listInstallments != null)
		{
			// Do something smart with the received installments
		}
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Fetch Klarna installments
$apiMessage = PayCheckout\Api\Service\KlarnaAccountGetInstallmentsInfo::create('NL',PayCheckout\Currency::EUR,10000);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can now retrieve the InstallmentInfo list
	$installmentsData = PayCheckout\Api\Service\KlarnaAccountGetInstallmentsInfo::response($response);

	if ($installmentsData != null)
	{
		// Do something smart with the installments
	}
}
else
{
	// Analyze why it failed
}			

KlarnaGetAddresses

PayCheckout. Api. Service. Klarna Get Addresses. Create

With this service call you can retrieve the addresses that might be registered at Klarna for country/social security/organisation number. Currently this only is supported for Sweden (SE). In Sweden private persons and companies can be queried for their addresses.

Klarna allows usage of this function under the following restrictions:

  • The function can only be used by consumers with a Swedish social security number or organization number
  • Customer data is only retrieved for Klarna's payment methods in the checkout
  • The function may not be used for registering customers
  • The function may only be used after providing the consumer with Klarna’s terms & conditions
  • The get_addresses function and received data must disappear if the consumer chooses another payment method
  • The consumer needs to actively press a button to collect the data, it may not be triggered by completion of a form field
  • The button is not allowed to be called get address (hämta address). Approved names: Fetch (Hämta), Continue (Fortsätt), Search (Sök), Proceed (Vidare)

The following parameters are needed:

Name Required Type Description Limits
countryIso3166Alpha2 Yes String The ISO-3166 two character country the consumer is originating from. Currently only Sweden (SE) is supported.
pnoNumber Yes String The social security number if a private person is concerned, or the organisation number if a company is involved. Must be a valid social security or organisation number.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Klarna Get Addresses. Response

to receive a collection of KlarnaAddress classes. The first address will always be the billing address. If two or more addresses are returned they indicate one or more shipping addresses.


using System;
using System.Collections.Generic;
{
	// Prepare the service call KlarnaGetAddresses action
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.KlarnaGetAddresses.Create(SE,"002031-0132");

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can retrieve address data
		List <PayCheckout.Api.Service.KlarnaGetAddresses.KlarnaAddress> addresses = PayCheckout.Api.Service.KlarnaGetAddresses.Response(response);
		if (addresses != null)
		{
			// Do something smart with the received addresses
		}
	}
	else
	{
		// Analyze why it failed
	}
}
 
<?php
require_once('autoloader.php');

// Prepare the service call KlarnaGetAddresses action
$apiMessage = PayCheckout\Api\Service\KlarnaGetAddresses::create(SE,'002031-0132');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can retrieve address data
	$addresses = PayCheckout\Api\Service\KlarnaGetAddresses::response($response);
	if ($addresses != null)
	{
		// Do something smart with the received addresses
	}
}
else
{
	// Analyze why it failed
} 			

KlarnaHasAccount

PayCheckout. Api. Service. Klarna Has Account. Create

With this service call you can check if the customer has an active part payment plan. If the value is true you should put part payment as the default payment option. Currently this function is only supported for Sweden (SE), Finland (FI), Norway (NO) and Denmark (DK).

The following parameters are needed:

Name Required Type Description Limits
countryIso3166Alpha2 Yes String The ISO-3166 two character country the consumer is originating from. Currently only Sweden (SE), Finland (FI), Norway (NO), and Denmark (DK) are supported.
pnoNumber Yes String The social security number if a private person is concerned, or the organisation number if a company is involved. Must be a valid social security or organisation number.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Klarna Has Account. Response

to receive a true or false value, indicating the existence of an Klarna part payment plan for the customer.


using System;
using System.Collections.Generic;
{
	// Prepare the service call KlarnaHasAccount action
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.KlarnaHasAccount.Create(DK,"27968880");

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can retrieve address data
		bool? result = PayCheckout.Api.Service.KlarnaHasAccount.Response(response);

		if (result.HasValue && result.Value)
		{
			// Klarna reports that an account is present, do something smart with this result
		}
		else
		{
			// Klarna reports that no account is present, do something smart with this result
		}
	}
	else
	{
		// Analyze why it failed
	}
}
 
<?php
require_once('autoloader.php');

// Prepare the service call KlarnaHasAccount action
$apiMessage = PayCheckout\Api\Service\KlarnaHasAccount::create(DK,"27968880");

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can retrieve address data
	$result = PayCheckout\Api\Service\KlarnaHasAccount::response($response);

	if ($result != null && result)
	{
		// Klarna reports that an account is present, do something smart with this result
	}
	else
	{
		// Klarna reports that no account is present, do something smart with this result
	}
}
else
{
	// Analyze why it failed
}			

GetModuleVersion

PayCheckout. Api. Service. Get Module Version. Create

This function is mainly for "Module" implementers. With this function the process of detecting the availability of a new(er) version is supported. You supply the name of the module and the current version of the module. When recognized as a supported module the version is compared with the system configured most recent available version.

The following parameters apply:

Name Required Type Description Limits
moduleName Yes String The name of the module to investigate. Must be a known module.
currentVersion Yes String The current version. Simply copy the version of the module.

On return the function returns the ModuleVersionInfo class. if "VersionIsCurrent" is true then you have the correct version, else NewestVersion shows the newest available version.


using System;
using System.Collections.Generic;
{
	// Create the GetModuleVersion request
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.GetModuleVersion.Create("Magento","1.0.0.0");

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can retieve moduleVersionInfo
		PayCheckout.Api.Service.GetModuleVersion.ModuleVersionInfo moduleVersionInfo = PayCheckout.Api.Service.GetModuleVersion.Response(response);

		if (moduleVersionInfo != null)
		{
			// moduleVersionInfo is present, do something smart with it
		}
	}
	else
	{
		// Analyze why GetModuleVersion failed
	}
}

<?php

require_once('../src/PayCheckout/autoloader.php');

// Create the GetModuleVersion request
$apiMessage = PayCheckout\Api\Service\GetModuleVersion::create('Magento','1.0.0.0');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can retrieve moduleVersionInfo data
	$moduleVersionInfo = PayCheckout\Api\Service\GetModuleVersion::response($response);

	if ( $moduleVersionInfo != null )
	{
		// moduleVersionInfo is available, do something smart with it.
	}
}
else
{
	// Analyze why GetModuleVersion failed
}
			

SendManualNotification

PayCheckout. Api. Service. SendManualNotification. Create

The function SendManualNotification allows you to send a notification manually. Manual notifications can be sent only when manual notifications are configured/enabled in the portal. This call is useful when you are developing the nofication handling for a webshop. Sending manual notifications is also possible using the portal.

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference. Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.

using System;
using System.Collections.Generic;
{
	// Prepare the send manual notification action
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.SendManualNotification.Create(201501005176298002);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success, the notification was sent and processed succesfully
	}
	else
	{
		// Analyze why notification was not processed correctly, for example http resultcode was not 200 OK.
	}
}

<?php
require_once('autoloader.php');
// Prepare the send manual notification action
$apiMessage = PayCheckout\Api\Service\SendManualNotification::create('201504005327297114');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success, the notification was send and processed correctly by the webshop
}
else
{
	// Analyze why the notification was not processed correctly for example http resultcode was not 200 Ok.
}		

GetLastNotificationContent

PayCheckout. Api. Service. Get Last Notification Content. Create

With this service call you retrieve the content of the last notification send. This call is intendent for use during the development fase to be able to test notification handling. There is one input parameter:

Name Required Type Description Limits
paymentReference Yes Int64 (C#)/String (PHP) The payment reference. Note for PHP: Due to Integer restrictions in PHP we use a string to identify payment references.

If the ApiResponse ApiResult is "Success" use the call

PayCheckout. Api. Service. Get Last Notification Content. Response

to retrieve the json string of the ApiMessage that contains a notification message. See example code how to decode this.


using System;
using System.Collections.Generic;
{
	// Prepare GetPaymentInfo
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.GetLastNotificationContent.Create(201509001050423902);

    // Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);
	
    // Execute the call and receive result
	PayCheckout.ApiResponse apiResponse = executor.Execute(apiMessage);
	
    // Analyze result
	if (apiResponse.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can now retrieve the jsonCode of the notification
		string jsonResult = PayCheckout.Api.Service.GetLastNotificationContent.Response(apiResponse);

       	PayCheckout.Json.ApiMessageSigned apiMessageSigned = Newtonsoft.Json.JsonConvert.DeserializeObject<paycheckout.json.apimessagesigned>(jsonResult);
		
		if (apiMessageSigned.Verify("e8fe7ab6-8d39-4936-88dc-f27dd479bdcb"))
		{
			var notification = apiMessageSigned.ApiMessage.Notification;
			// Do something smart with the notification
		}
	}
}

<?php
require_once('autoloader.php');

// Prepare GetPaymentInfo
$apiMessage = PayCheckout\Api\Service\GetLastNotificationContent::create('201509001050423902');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can now retrieve the PaymentInfo
	$jsonString = PayCheckout\Api\Service\GetLastNotificationContent::response($response);

    // Decode the POST content				 						    
    $jsonData = json_decode($jsonString, false, 512, JSON_BIGINT_AS_STRING);
    
    // Decode into ApiSigned message
    $apiSigned = new PayCheckout\Json\ApiMessageSigned();
    $apiSigned->setJson($jsonData);

    // Verify message integrety
    if ($apiSigned->verify($encryptionPassword))
    {
	    $notification = $apiSigned->getApiMessage()->getNotification();

        // Do something smart with the notification
    }
}

				

Help functions

Help functions are API calls that provide you with some more functions to help you process payments. See each individual call for more details.

Help currently has the following functions available:

GetCurrencyMultiplyFactor

This function retrieves the multiplyfactor used by the specified currency.

Name Required Type Description Limits
currency Yes Currency The currency used Must be a valid Currency


    // Retrieve the currency multiplyfactor for currency EUR
    decimal CurrencyMultiplyFactor = PayCheckoutApi.HelpFunction.GetCurrencyMultiplyFactor( PayCheckoutApi.Currency.EUR );


<?php

require_once('autoloader.php');

// Retrieve the currency multiplyfactor for currency EUR
$currencyMultiplyFactor = PayCheckout\Api\HelpFunction::getCurrencyMultiplyFactor(\PayCheckout\Currency::EUR)

			

GetCurrencyMultiplyConstant

This function retrieves the constant to multiply with for the given currency.

Name Required Type Description Limits
currency Yes Currency The currency used Must be a valid Currency

                         
    // Retrieve the currency multiplyconstant for currency EUR
    decimal CurrencyMultiplyConstant = PayCheckoutApi.HelpFunction.GetCurrencyMultiplyConstant( PayCheckoutApi.Currency.EUR );


<?php

require_once('autoloader.php');

// Retrieve the currency multiplyconstant for currency EUR
$currencyMultiplyConstant = PayCheckout\Api\HelpFunction::getCurrencyMultiplyConstant(\PayCheckout\Currency::EUR)

			

GetMultiplyConstant

This function retrieves the multiplication constant according to the specified factor.

Name Required Type Description Limits
factor Yes Int The factor used 1 up to 8, including


    // Retrieve the multiplyconstant for the given factor
    decimal MultiplyConstant = PayCheckoutApi.HelpFunction.GetMultiplyConstant( 4 );


<?php

require_once('autoloader.php');

// Retrieve the multiplyconstant for the given factor
$multiplyConstant = PayCheckout\Api\HelpFunction::getMultiplyConstant( 4 )
			

Notifications

Payment notifications

Payments and several service calls send notifications to the WebShop to inform about relevant changes. The URL for notifications is configured per WebShop instance using the portal. The URL that is entered must be a https address as notifications may contain sensitive data.

NOTE: In the sandbox environment it is permitted to have a non https url to ease up the development process. Remember that in order to go live you have to configure a https url.

Payment notifications are send by sending a html POST request to the specified url. This POST contains a json payload that contains a SignedApiMessage that includes a Notification class. The notification class can contain 5 types of information. The NotificationType indicates which class has been filled with information.

NotificationType Class Description
PaymentStatusChange (0) PaymentStatusChange Contains information about a payment it may also contain the (modified regarding paymentcost) order.
RefundInformation (10) RefundInformation Contains information about one or more (not order item related) refund(s) that have occured since this notification.
OrderChange (20) OrderChange Contains the order after it's content is modified by a service call
MandateStatusChange (30) MandateStatusChange Contains information about the mandate thas has changed (Can only happen on mandate notifications)
VerifiedBankAccount(40) VerifiedBankAccount Contains information about the bank account that is successfully verified (Can only happen on addBankAccount from CustomerApi notifications)

To assist in developing notification handlers we supply a service call named GetLastNotificationContent. Using this api-call you can retrieve the last notification content to test handling notifications without actually having to send and capture it. You can also configure the webshop for "manual notifications". When the webshop is configured for manual notifications you can develop a notification handler without having to wait for an automatic resend. Instead you can manually submit a notification from the portal or using the service call SendManualNotification. To inform you on when to expect a notification during the payment fase of an order, you can have a look at the state diagrams in the next chapter Statuses

Mandate notifications

Mandate notifications are sent only when a notificationurl is supplied with a mandate request and is active for the specified apicall only. If you specify a notification url when creating a mandate and do not specify a notification url when you alter the mandate the alter request will not send notifications. The configured notification Url for webshops only affects payments, the configured url will NOT be used for mandates.

NOTE: Notification urls for mandates do not require https secured destinations. Notification urls do not carry sensitive information and therefore need no encryption.

NOTE: The payment notification support calls SendManualNotification and GetLastNotificationContent are not valid nor applicable on mandate notifications.

Notification messages however do have a signature that needs to be verified before processing the content. Mandate notifications always have NotificationType "MandateStatusChange" and the Mandate notification class is populated.

Mandate notifications are send by sending a html POST request to the API specified url. This POST contains a json payload that contains a SignedApiMessage that includes a Notification class. The notification class contains only "MandateStatusChange" information. And only the Mandate notification class is populated.

VerifiedBankAccount notifications

VerifiedBankAccount notifications are sent only when a notificationurl is supplied with an AddBankAccount request (CustomerApi) and is active for the specified apicall only. The configured notification Url for webshops only affects payments, the configured url will NOT be used for AddBankAccount requests.

NOTE: Notification urls for VerifiedBankAccount notifications require https secured destinations (like payment notifications). The VerifiedBankAccount notification url carries sensitive information and therefore needs encryption.

NOTE: The payment notification support calls SendManualNotification and GetLastNotificationContent are not valid nor applicable on VerifiedBankAccount notifications.

NO EMAIL ON FAILURE: The current implementation sends no e-mails when "VerifiedBankAccount" notifications fail.

VerifiedBankAccount notification messages also carry a signature that needs to be verified before you can safely process the content. VerifiedBankAccount notifications always have NotificationType "VerifiedBankAccount" and the VerifiedBankAccount notification class is populated.

VerifiedBankAccount notifications are send by sending a html POST request to the API specified url. This POST contains a json payload that contains a SignedApiMessage that includes a Notification class. The verifiedBankAccount class contains only "VerifiedBankAccount" information. And only the VerifiedBankAccount notification class is populated.

Decoding

Notifications are processed by processing POST commands. The POST command contains "Content-Type" of "application/json" with utf-8 encoded content. In the samples on the right you find how to decode the Json body message into a usable Notification class. You must verify the SignedApiMessage with the "Encryption Password" belonging to the webshop according to the sample. After succesfully processing the content you respond with a "Http Response 200 OK". Any other Response code will result in the transaction system retrying sending the notification again. See next chapter how this mechanism works.


using Newtonsoft.Json;
using System;
using System.Collections.Generic;
{
	// Fetch body content from page
	string jLoad = .....;

	// Set encryption password
	string encryptionPassword = "e8fe7ab6-8d39-4936-88dc-f27d3479bdcb";

	PayCheckout.Json.ApiMessageSigned apiMessageSigned = Newtonsoft.Json.JsonConvert.DeserializeObject<Paycheckout.Json.ApiMessageSigned>(jLoad);
		
	if (apiMessageSigned.Verify(encryptionPassword))
	{
		var notification = apiMessageSigned.ApiMessage.Notification;
		// Do something smart with the notification

		// If all processing went well Send HTTP response code 200 (OK)
	}
	else
	{
		// Send HTTP Response code 403 (Forbidden) or any response which is not 200 (OK)
	}
}

<?php

require_once('autoloader.php');

// Your webshop encryption password
$encryptionPassword = "e8fe7ab6-8d39-4936-88dc-f27ad579bdcb";

// Fetch the POST content
$postPayload = file_get_contents('php://input');			 

// Decode the POST content				 						    
$jsonData = json_decode($postPayload, false, 512, JSON_BIGINT_AS_STRING);
    
// Decode into ApiSigned message
$apiSigned = new PayCheckout\Json\ApiMessageSigned();
$apiSigned->setJson($jsonData);

// Verify message integrety
if ($apiSigned->verify($encryptionPassword))
{
	$notification = $apiSigned->getApiMessage()->getNotification();
    // Do something smart with the notification

    // Verify message integrety
    if ($apiSigned->verify($encryptionPassword))
    {
	    $notification = $apiSigned->getApiMessage()->getNotification();

        // Do something smart with the notification
        switch ($notification->getNotificationType())
        {
            case PayCheckout\NotificationType::PAYMENT_STATUS_CHANGE:
                // Do something smart with a payment status change
                $paymentStatus = $notification->getPaymentStatusChange()->getStatus();
                // etc...
                break;

            case PayCheckout\NotificationType::REFUND_INFORMATION:
                // Do somthing smart with a refund notification
                $refunds = $notification->getRefundInformation()->getRefunds();
                //
                $totalRefundAmount = 0;
                foreach ($refunds as $refund)
                {
                    $totalRefundAmount += $refund->getRefundAmountInclVat();
                }
                // Convert to real amount
                $totalRefundAmount = $totalRefundAmount / PayCheckout\Api\HelpFunction::getCurrencyMultiplyConstant($notification->getRefundInformation()->getCurrency());
                // etc....
                break;

            case PayCheckout\NotificationType::ORDER_CHANGE:
                // Do somehting smart with the modified order
                $order = $notification->getOrderChange()->getOrder();
                // etc...
                break;

			case PayCheckout\NotificationType::VERIFIED_BANK_ACCOUNT:
				// Do something with the verified bank account
				$bankAccountInfo = $notification->getVerifiedBankAccount();
				$iBAN = $bankAccountInfo->getIBAN();
				// etc.
        }
    }
	// Send response 200 Ok if all is ok
}
else
{
	// Verification failed
	// Send response 403 Forbidden or any other response than 200 Ok 
}

		

Retry Mechanism

The table below explains how many times and at which interval, notifications are retried.

After the first notification is retried a mail is sent to the configured e-mail address for problem notification. A final E-mail message is sent on the last retry attempt, this happens roughly after 45 hours of retry attempts.

Retries Interval (minutes) Remark
6 1/6 (10 secs) After the second failure an e-mail is sent that POSTing the notification failed.
5 1
6 10
83 30 At the last attempt a final e-mail is sent and the retry mechanism stops.

Statuses

Below are the statuses used in the api.

Payment status

When executing payments the payment.status follows the state of the payment. We differentiate between payments performed in cooperation with a hosted page or payments that directly interact with the webshop application.

NOTE: As from library version 1.2.0.1 we introduce new statuses to cover practical situations like duplicate payments or payments that came through while the payment is marked as cancelled or exipired/hostedExpired. Previously an email was sent to the app owner this happened and the app owner had to handle the funds manually. Applications that are using the old library will not receive the new status to assure backwards compatibility and unexpected behaviour.

The tables below indicate how the payment.status follows the described events

Hosted payment:

Action (Result:Success) From status to status Payment notification
Hosted payment start HostedInitiated No
Payment with status:Paid HostedInitiated Paid Yes
Action: Cancel order apicall without completed payment HostedInitiated Cancelled Yes
Action: User cancels payment on hosted page HostedInitiated Cancelled Yes (libversion > 1.2.0.3)
Payment with status:Paid Cancelled Paid Yes
Payment with status:Reserved HostedInitiated Reserved Yes
Payment with status:Expired HostedInitiated HostedInitiated No
Payment with status:Cancelled HostedInitiated HostedInitiated No
Payment with status:Failed HostedInitiated HostedInitiated No
Payment with status:ApprovalPending HostedInitiated ApprovalPending No
Payment with status:Approved (ApprovalPending) ApprovalPending Reserved Yes
Payment with status:Denied (ApprovalPending) ApprovalPending HostedInitiated No
Hosted payment expired HostedInitiated HostedExpired Yes
Payment has been reversed (Creditcard/PayPal) Paid Reversed Yes
Reversal reversed (ex. conflict with PayPal resolved) Reversed Paid Yes
Paid (duplicate payment) Paid PaidUnexpectedAmount Yes (libversion 1.2.0.1)
Payment received while status was HostedExpired HostedExpired PaidExpiredPayment Yes (libversion 1.2.0.1)

Direct API payment (Depricated!):

Action (Result:Success) From status to status Payment notification
Payment start with redirect Pending No
Payment with status:Paid (redirected) Pending Paid Yes
Payment with result:Paid (direct) Paid Yes
Payment with status:Failed (redirected) Pending Failed Yes
Payment with result:Failed (direct) Failed Yes
Payment with status:Cancelled (redirected) Pending Cancelled Yes
Payment with status:Expired (redirected) Pending Failed Yes
Payment with result:ApprovalPending (direct) ApprovalPending No
Payment with status:Approved (ApprovalPending) ApprovalPending Reserved Yes
Payment with status:Denied (ApprovalPending) ApprovalPending Rejected Yes
Payment has been reversed (Creditcard/PayPal) Paid Reversed Yes
Reversal reversed (ex. conflict with PayPal resolved) Reversed Paid Yes
Payment received while already paid Paid PaidUnexpectedAmount Yes (libversion 1.2.0.1)
Payment received while status was cancelled Cancelled PaidCancelledPayment Yes (libversion 1.2.0.1)
Payment received while stats was expired Expired PaidExpiredPayment Yes (libversion 1.2.0.1)

Substatus SEPArefund

Substatus Description
Queued Transaction on hold for further processing.
InsertedInBatch Transaction has been inserted in a batch for external processing.

Sandbox testing

We offer comprehensive testing capabilities in our sandbox environment.

Bancontact

When testing bancontact payments you can quickly select the outcome by checking one of the predefined "outcome" radio buttons. Avoiding having to enter bancontact information. You can also select the "Live emulation" button. Pressing this button will show you the near live screen that is identical to the screen the customer will see in the live environment.

Bancontact users have the ability to pay with an app they can download for free. App paymenst are limited to a maximum amount of 250 Euro. The hosted page adapts to this rule to show App options only if the payment amount (including any surcharge) stays below the app max limit of EUR 250,--.

Bancontact numbers are validated using the "Luhn checksum" and are validated on length. The 3d secure emulation will give you options to try. If you don't understand the options leave them default. If you want to play with the options just do, no harm can be done as this is a sandbox environment!

In the table below you will find bancontact numbers and there defined outcome at card provider level. Bancontact errors are interpreted by our system and translated into a consumer and technical error description.

Cardnumber Redirection StatusCode ResponseCode Acquirer ResponseCode Remark
5017 6700 0000 0000 8 00 00 00 Ok payment
5017 6700 0000 5900 4 01 00 00 Card not enrolled
5017 6700 0000 0802 7 00 05 02 Authorisation refused
5017 6700 0000 0604 7 00 05 04 Card blocked (lost or stolen)

Creditcard

When testing creditcards payments you can quickly select the outcome by checking one of the predefined "outcome" radio buttons. Avoiding having to enter creditcard information. You can also select the "Live emulation" button. Pressing this button will show you the near live screen that is identical to the screen the customer will see in the live environment.

In the near live environment brandselection, cardholdername, expiry and cvc code are don't care values. Which means any valid entry is ok and will not affect the payment outcome. Creditcard numbers are validated using the "Luhn checksum" and are validated on length. The 3d secure emulation will give you options to try. If you don't understand the options leave them default. If you want to play with the options just do, no harm can be done as this is a sandbox environment!

In the table below you will find cardnumbers and there defined outcome at card provider level. The Card provider errors are interpreted by our system and translated into a consumer and technical error description.

Cardnumber Redirection StatusCode ResponseCode Acquirer ResponseCode Remark
5017670000000000 00 00 00 Ok payment
5017670000005900 01 00 00 Card not enrolled
5017670000000802 00 05 02 Authorisation refused
5017670000000604 00 05 04 Card blocked (lost or stolen)

Api Classes

The api uses various classes that are of interest for the programmer. In this section each relevant class is described in detail in the beneath section. They all have a json backgrond.

Json.Generic.Configuration

Field Name Description
SelectedPaymentMethods Contains a list or array of the enumeration PaymentMethod with the payment methods that can be used
SelectedPaymentMethodsTxt Contains a list or array of strings with the text representation of the payment method that can be used (to support future paymentmethods without upgrading libs)
SurChargeCollectionV2 Collection containing configured SurchargeV2s, if none are configured the value is "null"
MinMaxSelector Collection containing MinMaxSelectors, if none are configured the value is "null"
Klarna Contains Klarna configuration if Klarna is selected as a PaymentMethod, can be "null" if Klarna is not selected.
IDeal Contains iDEAL configuration if iDEAL is selected as a PaymentMethod, can be "null" if iDEAL is not selected.
PayPal Contains PayPal configuration if PayPal is selected as a PaymentMethod, can be "null" if PayPal is not selected.
SofortBanking Contains SofortBanking configuration if SofortBanking is selected as a PaymentMethod, can be "null" if SofortBanking is not selected.

using Newtonsoft.Json;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Configuration
{
	public class Configuration
	{
		public Configuration()
		{
			SelectedPaymentMethods      = new List<paymentmethod>();
			SelectedPaymentMethodsTxt   = new List<String>();
			SurchargeV2                 = new Surcharge.SurchargeCollectionV2();
			MinMaxSelector              = new MinMaxSelector.MinMaxSelectorCollection();
		}

		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Paycheckout.Paymentmethod> SelectedPaymentMethods { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<String> SelectedPaymentMethodsTxt { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Surcharge.SurchargeCollectionV2 SurchargeV2 { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public MinMaxSelector.MinMaxSelectorCollection MinMaxSelector { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Klarna.Klarna Klarna { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public IDeal.IDeal IDeal { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PayPal.PayPal PayPal { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public SofortBanking.SofortBanking SofortBanking { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Generic\Configuration;

use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Generic\Configuration\Klarna\Klarna;
use PayCheckout\Json\Generic\Configuration\IDeal\IDeal;
use PayCheckout\Json\Generic\Configuration\PayPal\PayPal;
use PayCheckout\Json\Generic\Configuration\SofortBanking\SofortBanking;
use PayCheckout\Json\Generic\Configuration\Surcharge\SurchargeV2;
use PayCheckout\Json\Generic\Configuration\MinMaxSelector\MinMaxSelector;

class Configuration extends JsonBase
{
    /**
     * @var int[]
     */
    protected $selectedPaymentMethods;

    /**
     * @var string[]
     */
    protected $selectedPaymentMethodsTxt;
    
    /**
     * @var array|SurchargeV2[]
     */
    protected $surchargeV2;
    
    /**
     * @var array|MinMaxSelector[]
     */
    protected $minMaxSelector;
    
    /**
     * @var Klarna
     */
    protected $klarna;

    /**
     * @var IDeal
     */
    protected $iDeal;
    
    /**
     * @var PayPal
     */
    protected $payPal;
    
    /**
     * @var SofortBanking
     */
    protected $sofortBanking;

    /**
     * Create new configuration
     */
    public function __construct()
    {
        $this->selectedPaymentMethods	    = array();
        $this->selectedPaymentMethodsTxt    = array();
        $this->surchargeV2				    = array();
        $this->minMaxSelector			    = array();
    }
    
    /**
     * @return int[]
     */
    public function getSelectedPaymentMethods()
    {
        return $this->selectedPaymentMethods;
    }
    
    /**
     * @return string[]
     */
    public function getSelectedPaymentMethodsTxt()
    {
        return $this->selectedPaymentMethodsTxt;
    }
    
    /**
     * @return SurchargeV2[]
     */
    public function getSurchargeV2()
    {
        return $this->surchargeV2;
    }
    
    /**
     * @return MinMaxSelector[]
     */
    public function getMinMaxSelector()
    {
        return $this->minMaxSelector;
    }
    
    /**
     * @return Klarna
     */
    public function getKlarna()
    {
        return $this->klarna;
    }

    /**
     * @return IDeal
     */
    public function getIDeal()
    {
        return $this->iDeal;
    }

    /**
     * @return PayPal
     */
    public function getPayPal()
    {
        return $this->payPal;
    }

    /**
     * @return SofortBanking
     */
    public function getSofortBanking()
    {
        return $this->sofortBanking;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'surchargeV2':
                // Items needs to an array (list of surcharges)
                if (is_object($value)) 
                {
                    $paymentMethodIndex = \PayCheckout\PaymentMethod::convertFromJson($paymentMethod);
                    foreach ( (array) $value as $paymentMethod => $countries)
                    {
                        foreach ($countries as $country => $itemValues) 
                        {
                            // Check if item is an object
                            if (is_object($itemValues))
                            {
                                // Create new surcharge and add to configuration
                                $surchargeV2 = new SurchargeV2();
                                $surchargeV2->jsonDeserialize($itemValues);
								
                                $this->surchargeV2[$paymentMethodIndex][$country] = $surchargeV2;
                            }
                        }
                    }
                }
                return;
            case 'minMaxSelector':
                // Items needs to an array (list of min max selectors)
                if (is_object($value)) 
                {
                    foreach ( (array) $value as $paymentMethod => $currencies)
                    {
                        $paymentMethodIndex = \PayCheckout\PaymentMethod::convertFromJson($paymentMethod);
                        foreach ($currencies as $currency => $itemValues) 
                        {
                            // Check if item is an object
                            if (is_object($itemValues))
                            {
                                // Create new min max selector and add to configuration
                                $minMaxSelector = new MinMaxSelector();
                                $minMaxSelector->jsonDeserialize($itemValues);
                                
                                $this->minMaxSelector[$paymentMethodIndex][$currency] = $minMaxSelector;
                            }
                        }
                    }
                }
                return;
            case 'klarna':
                $this->klarna = new Klarna();
                $this->klarna->jsonDeserialize($value);
                return;
            case 'iDeal':
                $this->iDeal = new IDeal();
                $this->iDeal->jsonDeserialize($value);
                return;
            case 'payPal':
                $this->payPal = new PayPal();
                $this->payPal->jsonDeserialize($value);
                return;
            case 'sofortBanking':
                $this->sofortBanking = new SofortBanking();
                $this->sofortBanking->jsonDeserialize($value);
                return;
        }
        
        parent::setJsonData($name, $value);
    }
}			

Json.Generic.Configuration.SurCharge.SurChargeV2

Field Name Description
Currency Contains the currency that is used.
MinimumCharge Contains the minimum charge that should be charged at all times. When 0 no minimum charge is used. (Integer currency conversion applied)
FixedCharge If a fixed charge should be applied this is the value used. When 0 no fixed charge is used. (Integer currency conversion applied)
Percentage Percentage times 100 used to calculate the surcharge. When 0 no percentage is used. (1.25% will show as 125)
RoundOfValue The calculated amount will always be a multiple of this value. When 0 no round of value is used. (Integer currency conversion applied)
PaymentCostVatDisplayPercentage Vat percentage * 100 displayed. (21% will show up as 2100) When 0 no VAT percentage will be shown.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.Configuration.Surcharge
{
	public class Surcharge
	{
		#region Json

    	[JsonProperty]
    	public Currency Currency	{ get; internal set; }

   		[JsonProperty]
		public Int32 MinimumCharge	{ get; internal set; }

		[JsonProperty]
		public Int32 FixedCharge    { get; internal set; }

		[JsonProperty]
		public Int32 Percentage	    { get; internal set; }

		[JsonProperty]
		public Int32 RoundOfValue   { get; internal set; }

		[JsonProperty]
		public Int32 PaymentCostVatDisplayPercentage { get; internal set; }

		#endregion
	}
}

<?php
				 					 	
namespace PayCheckout\Json\Generic\Configuration\SurchargeV2;
use PayCheckout\Json\JsonBase;

class SurchargeV2 extends JsonBase
{
    /**
     * @var int
     **/
    protected $currency;

    /**
     * @var int
     */
    protected $minimumCharge;
    
    /**
     * @var int
     */
    protected $fixedCharge;
    
    /**
     * @var int
     */
    protected $percentage;
    
    /**
     * @var int
     */
    protected $roundOfValue;
        
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->getCurrency;
    }
    
    /**
     * @return int
     */
    public function getMinimumCharge()
    {
        return $this->minimumCharge;
    }

    /**
     * @return int
     */
    public function getFixedCharge()
    {
        return $this->fixedCharge;
    }

    /**
     * @return int
     */
    public function getPercentage()
    {
        return $this->percentage;
    }
    
    /**
     * @return int
     */
    public function getRoundOfValue()
    {
        return $this->roundOfValue;
    }
}
			

Json.Generic.Configuration.SurCharge.SurChargeCollectionV2

Collection of surchargeV2. The surchargeV2 can be retrieved from the collection by specifying a PaymentMethod and an isoCountryCode. This collection is programmed depending on the capabilities of the programming language used.


using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Configuration.Surcharge
{
	public class SurchargeCollectionV2 : Dictionary<Paycheckout.Paymentmethod, Dictionary<String, SurchargeV2>>
	{
		public SurchargeV2 Get(PayCheckout.PaymentMethod method, String country)
		{
			Dictionary<String, SurchargeV2> countrySurcharges;
			if (TryGetValue(method, out countrySurcharges))
			{
				SurchargeV2 result;
				if (countrySurcharges.TryGetValue(country, out result))
				{
					return result;
				}
			}
			return null;
		}
	}
}

<?php

// Retrieve $configuration by interpreting response from service call GetCurrentConfiguration
$configuration = PayCheckout\Api\Service\GetCurrentConfiguration::response($response);

// Retrieve SurChargeV2 data for payment method iDeal, the Netherlands.
if (array_key_exists(\PayCheckout\PaymentMethod::IDEAL,$configuration->getSurChargeV2()))
{
    $surChargeV2Collection = $configuration->getSurchargeV2()[\PayCheckout\PaymentMethod::IDEAL];
    if (array_key_exists('NL',$surChargeV2Collection))
    {
        $surChargeV2 = $surChargeV2Collection['NL'];
        
        // Do something with this surcharge
        var_dump($surChargeV2);
    }
}


			

Json.Generic.Configuration.MinMaxSelector.MinMaxSelector

Field Name Description
MinimumCharge The payment method may be used when the amount charged (before applying surCharges) is greater than or equal to the MinimumCharge. When 0, no minimum charge is used. (Integer currency conversion applied)
MaximumCharge The payment method may be used when the amount charged (before applying surCharges) is less than the MaximumCharge. Warning: when 0, the payment method can NEVER be used! (Integer currency conversion applied)

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.Configuration.MinMaxSelector
{
	public class MinMaxSelector
	{
		#region Json

		[JsonProperty]
		public Int32 MinimumCharge	{ get; internal set; }

		[JsonProperty]
		public Int32 MaximumCharge	{ get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Configuration\MinMaxSelector;
use PayCheckout\Json\JsonBase;

class MinMaxSelector extends JsonBase
{
    /**
     * @var int
     */
    protected $minimumCharge;
    
    /**
     * @var int
     */
    protected $maximumCharge;
    
    /**
     * @return int
     */
    public function getMinimumCharge()
    {
        return $this->minimumCharge;
    }

    /**
     * @return int
     */
    public function getMaximumCharge()
    {
        return $this->maximumCharge;
    }
}
			

Json.Generic.Configuration.MinMaxSelector.MinMaxSelectorCollection

Collection of MinMaxSelectors. They can be indexed by specifying a PaymentMethod and a Currency. This collection is programmed depending on the capabilities of the programming language used.


using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Configuration.MinMaxSelector
{
	public class MinMaxSelectorCollection : Dictionary<Paycheckout.Paymentmethod, dictionary<PayCheckout.Currency, MinMaxSelector>>
	{
		public MinMaxSelector Get(PayCheckout.PaymentMethod method, PayCheckout.Currency currency)
		{
			Dictionary<PayCheckout.Currency, MinMaxSelector> minmaxSelector;
			if (TryGetValue(method, out minmaxSelector))
			{
				MinMaxSelector result;
				if (minmaxSelector.TryGetValue(currency, out result))
				{
					return result;
				}
			}
			return null;
		}
	}
}

			

Json.Generic.Configuration.Klarna.Klarna

Field Name Description
Eid The Eid value as configured in the portal. This value is generated/supplied by Klarna after you have made an agreement.
Secret The Secret value as configured in the portal. This value is generated/supplied by Klarna after you have made an agreement.
FixDuplicateOrderItemNames The Klarna API can not handle duplicate order items. When value is TRUE, if duplicate names are encountered, 2 digits from the orderline and 1 digit from itemType are added to the name to make it unique. When FALSE, if duplicate OrderItemNames are detected the function will fail.
KlarnaCountrySpecific Collection of KlarnaCountrySpecific classes.
SendKlarnaEmailWhenInvoiceIsCreated Boolean that determines whether Klarna shall send an email to the customer when an invoice is created.
SendKlarnaEmailWhenInvoiceIsAltered Boolean that determines whether Klarna shall send an email to the customer when an invoice is altered.

using Newtonsoft.Json;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Configuration.Klarna
{
	public class Klarna
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public int? Eid { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string Secret { get; internal set; }

		[JsonProperty]
		public bool FixDuplicateOrderItemNames { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<KlarnaCountrySpecific> KlarnaCountrySpecific { get; internal set; }

        [JsonProperty]
		public bool SendKlarnaEmailWhenInvoiceIsCreated { get; internal set; }

		[JsonProperty]
		public bool SendKlarnaEmailWhenInvoiceIsAltered { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Configuration\Klarna;
use PayCheckout\Json\JsonBase;

class Klarna extends JsonBase
{
    /**
     * @var int
     */
    protected $eid;
    
    /**
     * @var string
     */
    protected $secret;

    /**
     * @var bool
     */
    protected $fixDuplicateOrderItemNames;
    
    /**
     * @var KlarnaCountrySpecific[]
     */
    protected $klarnaCountrySpecific;

    /**
     * @var bool
     */
    protected $sendKlarnaEmailWhenInvoiceIsCreated;
    
	/**
	 * @var bool
	 */
	protected $sendKlarnaEmailWhenInvoiceIsAltered;

    /**
     * @return int
     */
    public function getEid()
    {
        return $this->eid;
    }
    
    /**
     * @return string
     */
    public function getSecret()
    {
        return $this->secret;
    }

    /**
     * @return bool
     */
    public function isFixDuplicateOrderItemNames()
    {
        return $this->fixDuplicateOrderItemNames;
    }

    /**
     * @return bool
     */
    public function isSendKlarnaEmailWhenInvoiceIsCreated()
    {
        return $this->sendKlarnaEmailWhenInvoiceIsCreated;
    }
    
    /**
     * @return bool
     */
    public function isSendKlarnaEmailWhenInvoiceIsAltered()
    {
        return $this->sendKlarnaEmailWhenInvoiceIsAlterd;
    }

    /**
     * @return KlarnaCountrySpecific[]
     */
    public function getKlarnaCountrySpecific()
    {
        return $this->klarnaCountrySpecific;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'klarnaCountrySpecific':
                // Items needs to an array (list of Klarna country specifics)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new Klarna country specific and add to configuration
                            $klarnaCountrySpecific = new KlarnaCountrySpecific();
                            $klarnaCountrySpecific->jsonDeserialize($itemValues);                            
                            $this->klarnaCountrySpecific[] = $klarnaCountrySpecific;
                        }
                    }
                }
                return;
        }
        parent::setJsonData($name, $value);
    }
}
			

Json.Generic.Configuration.Klarna.KlarnaCountrySpecific

Field Name Description
CountryIso3166Alpha2 The 2 chars ISO3166 country code
UsesKlarnaAccount TRUE - KlarnaAccount enabled for this country, FALSE KlarnaAccount disabled for this country.
UsesKlarnaInvoice TRUE - KlarnaInvoice enabled for this country, FALSE KlarnaInvoice disabled for this country.

using Newtonsoft.Json;

namespace PayCheckout.Json.Generic.Configuration.Klarna
{
	public class KlarnaCountrySpecific
	{
		public KlarnaCountrySpecific(string country,bool useKlarnaAccount,bool useKlarnaInvoice)
		{
			CountryIso3166Alpha2    = country;
			UsesKlarnaAccount       = useKlarnaAccount;
			UsesKlarnaInvoice       = useKlarnaInvoice;
		}

		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string CountryIso3166Alpha2 { get; internal set;}

		[JsonProperty]
		public bool UsesKlarnaAccount { get;  internal set; }

		[JsonProperty]
		public bool UsesKlarnaInvoice { get;  internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Generic\Configuration\Klarna;
use PayCheckout\Json\JsonBase;

class KlarnaCountrySpecific extends JsonBase
{
    /**
     * @var string
     */
    protected $countryIso3166Alpha2;
    
    /**
     * @var bool
     */
    protected $usesKlarnaAccount;
    
    /**
     * @var bool
     */
    protected $usesKlarnaInvoice;
    
    /**
     * @return string
     */
    public function getCountryIso3166Alpha2()
    {
        return $this->countryIso3166Alpha2;
    }

    /**
     * @return bool
     */
    public function usesKlarnaAccount()
    {
        return $this->usesKlarnaAccount;
    }

    /**
     * @return bool
     */
    public function usesKlarnaInvoice()
    {
        return $this->usesKlarnaInvoice;
    }
}
			

Json.Generic.Configuration.IDeal.IDeal

Field Name Description
ExpirationPeriodInMinutes The expiration time in minutes of iDEAL transactions. This is the time the user has to finish an iDEAL transaction.

using Newtonsoft.Json;

namespace PayCheckout.Json.Generic.Configuration.IDeal
{
	public class IDeal
	{
		#region Json

		[JsonProperty]
		public int ExpirationPeriodInMinutes { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Configuration\IDeal;
use PayCheckout\Json\JsonBase;

class IDeal extends JsonBase
{
    /**
     * @var int
     */
    protected $expirationPeriodInMinutes;
     
    /**
     * @return int
     */
    public function getExpirationPeriodInMinutes()
    {
        return $this->expirationPeriodInMinutes;
    }   
 }
			

Json.Generic.Configuration.PayPal.PayPal

Field Name Description
PayPalAccountToUse The email address of the PayPal account on behalf we will perform payment actions.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PayCheckout.Json.Generic.Configuration.PayPal
{
    public class PayPal
    {
        #region Json

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string PayPalAccountToUse;

        #endregion
    }
}

<?php

namespace PayCheckout\Json\Generic\Configuration\PayPal;

use PayCheckout\Json\JsonBase;

class PayPal extends JsonBase
{
    /**
     * Summary of $payPalAccountToUse
     * @var string
     */
    protected $payPalAccountToUse;
     
    /**
     * @return string
     */
    public function getPayPalAccountToUse()
    {
        return $this->payPalAccountToUse;
    }
}
			

Json.Generic.Configuration.SofortBanking.SofortBanking

Field Name Description
TransactionTimeoutSeconds The timeout for a Sofort transaction between 300 and 1555200 seconds (5 min and 180 days)
EnabledCountryCodes The list of countries SOFORT banking is activated for. (2 Letter ISO3166 country code)

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Configuration.SofortBanking
{
	public class SofortBanking
	{
		#region Json

   		[JsonProperty]
		public int TransactionTimeoutSeconds { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<String> EnabledCountryCodes { get; set; }

		#endregion
	}
}

<?php

                         namespace PayCheckout\Json\Generic\Configuration\SofortBanking;
use PayCheckout\Json\JsonBase;
class SofortBanking extends JsonBase
{   
    /**
     * @var int
     */
    protected $transactionTimeoutSeconds;
    
    /**
     * @var string[]
     */
    protected $enabledCountryCodes;
    
    /**
     * @return int
     */
    public function getTransactionTimeoutSeconds()
    {
        return $this->transactionTimeoutSeconds;
    }  
    /**
     * @return string[]
     */
    public function getEnabledCountries()
    {
        return $this->enabledCountryCodes;
    }
}			

Json.Generic.Order.Order

Field Name Description
BillingIdentity Contains an Identity class or "null".
ShippingAddress Contains a Address class or "null".
Items Contains a list of OrderItems classes or "null".
CustomerOrderRef Contains a customer supplied order reference or "null"
CustomerNote Contains a customer supplied note or "null"
Currency Contains a currency or "null"
QuantityMultiplyFactor Contains (integer) QuantityMultiplyFactor or "null" when not used

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Order
{
	public class Order
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Identity.Identity BillingIdentity { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Identity.Address.ShippingAddress ShippingAddress { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Json.Generic.Order.Item.Orderitem> Items { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CustomerOrderRef { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CustomerNote { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PayCheckout.Currency? Currency { get; internal set; }

  		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? QuantityMultiplyFactor { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Order;
use DateTime;
use PayCheckout\Json\Generic\Order\Identity\Address;
use PayCheckout\Json\Generic\Order\Identity\Identity;
use PayCheckout\Json\Generic\Order\Item\OrderItem;
use PayCheckout\Json\JsonBase;

class Order extends JsonBase
{
    /**
     * @var Identity
     */
    protected $billingIdentity;
    
    /**
     * @var Address
     */
    protected $shippingAddress;
    
    /**
     * @var OrderItem[]
     */
    protected $items;
    
    /**
     * @var string
     */
    protected $customerOrderRef;
    
    /**
     * @var string
     */
    protected $customerNote;

    /**
     * @var int
     */
    protected $currency;
    
    /**
     * @var int
     */
    protected $quantityMultiplyFactor;

    
    /**
     * Create new order
     */
    public function __construct()
    {
        $this->items = array();
    }
    
    /**
     * @return Identity
     */
    public function getBillingIdentity()
    {
        return $this->billingIdentity;
    }

    /**
     * @return Address
     */
    public function getShippingAddress()
    {
        return $this->shippingAddress;
    }

    /**
     * @return OrderItem[]
     */
    public function getItems()
    {
        return $this->items;
    }
      
    /**
     * @param OrderItem $item 
     */
    public function addItem(OrderItem $item)
    {
        $this->items[] = $item;
    }

    /**
     * @return string
     */
    public function getCustomerOrderReference()
    {
        return $this->customerOrderRef;
    }

    /**
     * @param string $customerOrderRef
     */
    public function setCustomerOrderReference($customerOrderRef)
    {
        $this->customerOrderRef = $customerOrderRef;
    }

    /**
     * @return string
     */
    public function getCustomerNote()
    {
        return $this->customerNote;
    }

    /**
     * @param string $customerNote
     */
    public function setCustomerNote($customerNote)
    {
        $this->customerNote = $customerNote;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }
    
    /**
     * @param int $currency 
     */
    public function setCurrency($currency)
    {
        $this->currency = $currency;
    }

    /**
     * @return int
     */
    public function getQuantityMultiplyFactor()
    {
        return $this->quantityMultiplyFactor;
    }

       
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'billingIdentity':
                $this->billingIdentity = new Identity();
                $this->billingIdentity->jsonDeserialize($value);
                return;
            case 'shippingAddress':
                $this->shippingAddress = new Address();
                $this->shippingAddress->jsonDeserialize($value);
                return;
            case 'items':
                // Items needs to an array (list of items)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new OrderItem();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addItem($item);
                        }
                    }
                }
                return;
        }
        parent::setJsonData($name, $value);
    }
}
			

Json.Generic.Order.Identity.Identity

Field Name Description
IdentityType Contains the enum IdentityType or "null".
EmailAddress Contains an email address or "null".
Gender Contains the enum Gender or "null".
Address Contains the customer supplied Address class or "null"
PhoneNumber2 Contains the customer supplied second phonenumber or "null"
DateOfBirth Contains the customers supplied birthday or "null"
SocialSecurityNumber Contains the customers supplied social security number or "null"
ChamberOfCommerceNumber Contains the customers supplied chamber of commerce number or "null"
VatNumber Contains the customers supplied VAT number or "null"

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Order.Identity
{
	public class Identity
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public IdentityType? IdentityType { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String EmailAddress { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Gender?  Gender { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Address.Address Address { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String PhoneNumber2 { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CellPhoneNumber { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public DateTime? DateOfBirth { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String SocialSecurityNumber { get; internal set; }

		// Organisation specific
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ChamberOfCommerceNumber { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String VatNumber { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Order\Identity;
use DateTime;
use PayCheckout\Gender;
use PayCheckout\IdentityType;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Generic\Order\Identity\Address;

class Identity extends JsonBase
{
    /**
     * @var int
     */
    protected $identityType;
    
    /**
     * @var string
     */
    protected $emailAddress;
    
    /**
     * @var int
     */
    protected $gender;

    /**
     * @var Address
     */
    protected $address;
    
    /**
     * @var string
     */
    protected $phoneNumber2;
    
    /**
     * @var DateTime|null
     */
    protected $dateOfBirth;
    
    /**
     * @var string
     */
    protected $socialSecurityNumber;
    
    /**
     * Organisation specific
     * 
     * @var string
     */
    protected $chamberOfCommerceNumber;
    
    /**
     * Organisation specific
     * 
     * @var string
     */
    protected $vatNumber;

    /**
     * Create new identity (and address)
     * 
     * @param string $countryIso3166Alpha2 
     * @param string $firstName 
     * @param string $lastName 
     * @param string $addressLine1 
     * @param string $zipCode 
     * @param string $city 
     * @param string $title 
     * @param string $addressLine2 
     * @param string $stateProvince 
     * @param DateTime|null $dateOfBirth 
     * @param string $emailAddress 
     * @param int $gender 
     * @param string $phoneNumber 
     * @param string $phoneNumber2 
     * @param string $cellPhoneNumber 
     * @param string $socialSecurityNumber 
     * @param string $organisation 
     * @param string $department 
     * @param string $chamberOfCommerceNumber 
     * @param string $vatNumber 
     */
    public function __construct($countryIso3166Alpha2 = null, $firstName = null, $lastName = null, $addressLine1 = null, $zipCode = null, $city = null,
        $title = null, $addressLine2 = null, $stateProvince = null, DateTime $dateOfBirth = null, $emailAddress = null, $gender = null,
        $phoneNumber = null, $phoneNumber2 = null, $cellPhoneNumber = null, $socialSecurityNumber = null, $organisation = null, $department = null, $chamberOfCommerceNumber = null, $vatNumber = null)
    {
        // Identity
        $this->dateOfBirth              = $dateOfBirth;
        $this->emailAddress             = $emailAddress;
        $this->gender                   = $gender;
        $this->phoneNumber2             = $phoneNumber2;
        $this->socialSecurityNumber     = $socialSecurityNumber;
        $this->chamberOfCommerceNumber  = $chamberOfCommerceNumber;
        $this->vatNumber                = $vatNumber;
        
        // It's important to remove the time
        if ($dateOfBirth != null)
        {
            $this->dateOfBirth->setTime(0, 0, 0);
        }
        
        if ($organisation != null)
        {
            $this->identityType = IdentityType::ORGANISATION;
        }
        else
        {
            $this->identityType = IdentityType::PERSON;
        }
        
        // Address
        $this->setAddress(new Address(
            $countryIso3166Alpha2, $firstName, $lastName, $addressLine1, $zipCode, $city,
            $title, $addressLine2, $stateProvince, $phoneNumber, $cellPhoneNumber, $organisation, $department
        ));
    }
    
    /**
     * @return int
     */
    public function getIdentityType()
    {
        return $this->identityType;
    }

    /**
     * @param int $identityType
     */
    public function setIdentityType($identityType)
    {
        $this->identityType = $identityType;
    }

    /**
     * @return string
     */
    public function getEmailAddress()
    {
        return $this->emailAddress;
    }

    /**
     * @param string $emailAddress
     */
    public function setEmailAddress($emailAddress)
    {
        $this->emailAddress = $emailAddress;
    }

    /**
     * @return int
     */
    public function getGender()
    {
        return $this->gender;
    }

    /**
     * @param int $gender
     */
    public function setGender($gender)
    {
        $this->gender = $gender;
    }

    /**
     * @return string
     */
    public function getPhoneNumber2()
    {
        return $this->phoneNumber2;
    }

    /**
     * @param string $phoneNumber2
     */
    public function setPhoneNumber2($phoneNumber2)
    {
        $this->phoneNumber2 = $phoneNumber2;
    }

    /**
     * @return Address
     */
    public function getAddress()
    {
        return $this->address;
    }

    /**
     * @param Address $address
     */
    public function setAddress(Address $address)
    {
        $this->address = $address;
    }
    
    /**
     * @return DateTime|null
     */
    public function getDateOfBirth()
    {
        return $this->dateOfBirth;
    }

    /**
     * @param DateTime|null $dateOfBirth
     */
    public function setDateOfBirth(DateTime $dateOfBirth = null)
    {
        $this->dateOfBirth = $dateOfBirth;
    }

    /**
     * @return string
     */
    public function getSocialSecurityNumber()
    {
        return $this->socialSecurityNumber;
    }

    /**
     * @param string $socialSecurityNumber
     */
    public function setSocialSecurityNumber($socialSecurityNumber)
    {
        $this->socialSecurityNumber = $socialSecurityNumber;
    }

    /**
     * @return string
     */
    public function getChamberOfCommerceNumber()
    {
        return $this->chamberOfCommerceNumber;
    }

    /**
     * @param string $chamberOfCommerceNumber
     */
    public function setChamberOfCommerceNumber($chamberOfCommerceNumber)
    {
        $this->chamberOfCommerceNumber = $chamberOfCommerceNumber;
    }

    /**
     * @return string
     */
    public function getVatNumber()
    {
        return $this->vatNumber;
    }

    /**
     * @param string $vatNumber
     */
    public function setVatNumber($vatNumber)
    {
        $this->vatNumber = $vatNumber;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'dateOfBirth':
                $this->dateOfBirth = new DateTime($value);
                return;
            case 'address':
                $this->address = new Address();
                $this->address->jsonDeserialize($value);
                return;
        }
        parent::setJsonData($name, $value);
    }
}
			

Json.Generic.Order.Identity.Address

Field Name Description
Title Contains the customer supplied title or "null".
FirstName Contains the customer supplied first name or "null".
LastName Contains the customer supplied last name or "null".
CountryIso3166Alpha2 Contains the country with 2 characters according to Iso-3166 or "null".
AddressLine1 Contains the customer supplied address line, for specific payment types, restrictions or requirements may be present.
AddressLine2 Contains the customer supplied 2nd addressline or "null", typically used in the UK and US
ZipCode Contains the customer supplied zip-code or "null"
City Contains the customers supplied city or "null"
StateProvince Contains the customers supplied state/province or "null", typically used in the US
PhoneNumber Contains the customer supplied phone number or "null"
CellPhoneNumber Contains the customer supplied cell phone number or "null"
Organisation Contains the customer supplied organisation name or "null"
Department Contains the customers supplied department or "null"
VatNumber Contains the customers supplied VAT number or "null"

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Order.Identity
{
	public class Address
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String Title { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String FirstName { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String LastName { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CountryIso3166Alpha2 { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String AddressLine1 { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String AddressLine2 { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ZipCode { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String City { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String StateProvince { get; internal set; }
		
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String PhoneNumber { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CellPhoneNumber { get; internal set; }

		// Organisation specific
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String Organisation { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String Department { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Order\Identity;
use PayCheckout\Json\JsonBase;

class Address extends JsonBase
{
    /**
     * @var string
     */
    protected $title;
    
    /**
     * @var string
     */
    protected $firstName;
    
    /**
     * @var string
     */
    protected $lastName;
    
    /**
     * @var string
     */
    protected $countryIso3166Alpha2;
    
    /**
     * @var string
     */
    protected $addressLine1;
    
    /**
     * @var string
     */
    protected $addressLine2;
    
    /**
     * @var string
     */
    protected $zipCode;
    
    /**
     * @var string
     */
    protected $city;
    
    /**
     * @var string
     */
    protected $stateProvince;
    
    /**
     * @var string
     */
    protected $phoneNumber;

    /**
     * @var string
     */
    protected $cellPhoneNumber;

    /**
     * Organisation specific
     * 
     * @var string
     */
    protected $organisation;
    
    /**
     * Organisation specific
     * 
     * @var string
     */
    protected $department;
    
    /**
     * Create new address
     * 
     * @param string $countryIso3166Alpha2 
     * @param string $firstName 
     * @param string $lastName 
     * @param string $addressLine1 
     * @param string $zipCode 
     * @param string $city 
     * @param string $title 
     * @param string $addressLine2 
     * @param string $stateProvince 
     * @param string $phoneNumber 
     * @param string $cellPhoneNumber 
     * @param string $organisation 
     * @param string $department 
     */
    public function __construct($countryIso3166Alpha2 = null, $firstName = null, $lastName = null, $addressLine1 = null, $zipCode = null, $city = null,
        $title = null, $addressLine2 = null, $stateProvince = null,$phoneNumber = null, $cellPhoneNumber = null, $organisation = null, $department = null)
    {
        $this->countryIso3166Alpha2 = $countryIso3166Alpha2;
        $this->firstName            = $firstName;
        $this->lastName             = $lastName;
        $this->addressLine1         = $addressLine1;
        $this->zipCode              = $zipCode;
        $this->city                 = $city;
        $this->title                = $title;
        $this->addressLine2         = $addressLine2;
        $this->stateProvince        = $stateProvince;
        $this->phoneNumber          = $phoneNumber;
        $this->cellPhoneNumber      = $cellPhoneNumber;
        $this->organisation         = $organisation;
        $this->department           = $department;
    }
    
    /**
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param string $title
     */
    public function setTitle($title)
    {
        $this->title = $title;
    }

    /**
     * @return string
     */
    public function getFirstName()
    {
        return $this->firstName;
    }

    /**
     * @param string $firstName
     */
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;
    }

    /**
     * @return string
     */
    public function getLastName()
    {
        return $this->lastName;
    }

    /**
     * @param string $lastName
     */
    public function setLastName($lastName)
    {
        $this->lastName = $lastName;
    }

    /**
     * @return string
     */
    public function getCountryIso3166Alpha2()
    {
        return $this->countryIso3166Alpha2;
    }

    /**
     * @param string $countryIso3166Alpha2
     */
    public function setCountryIso3166Alpha2($countryIso3166Alpha2)
    {
        $this->countryIso3166Alpha2 = $countryIso3166Alpha2;
    }

    /**
     * @return string
     */
    public function getAddressLine1()
    {
        return $this->addressLine1;
    }

    /**
     * @param string $addressLine1
     */
    public function setAddressLine1($addressLine1)
    {
        $this->addressLine1 = $addressLine1;
    }

    /**
     * @return string
     */
    public function getAddressLine2()
    {
        return $this->addressLine2;
    }

    /**
     * @param string $addressLine2
     */
    public function setAddressLine2($addressLine2)
    {
        $this->addressLine2 = $addressLine2;
    }

    /**
     * @return string
     */
    public function getZipCode()
    {
        return $this->zipCode;
    }

    /**
     * @param string $zipCode
     */
    public function setZipCode($zipCode)
    {
        $this->zipCode = $zipCode;
    }

    /**
     * @return string
     */
    public function getCity()
    {
        return $this->city;
    }

    /**
     * @param string $city
     */
    public function setCity($city)
    {
        $this->city = $city;
    }

    /**
     * @return string
     */
    public function getStateProvince()
    {
        return $this->stateProvince;
    }

    /**
     * @param string $stateProvince
     */
    public function setStateProvince($stateProvince)
    {
        $this->stateProvince = $stateProvince;
    }

    /**
     * @return string
     */
    public function getPhoneNumber()
    {
        return $this->phoneNumber;
    }
    
    /**
     * @param string $phoneNumber
     */
    public function setPhoneNumber($phoneNumber)
    {
        $this->phoneNumber = $phoneNumber;
    }
    
    /**
     * @return string
     */
    public function getCellPhoneNumber()
    {
        return $this->cellPhoneNumber;
    }
    
    /**
     * @param string $cellPhoneNumber
     */
    public function setCellPhoneNumber($cellPhoneNumber)
    {
        $this->cellPhoneNumber = $cellPhoneNumber;
    }
    
    /**
     * @return string
     */
    public function getOrganisation()
    {
        return $this->organisation;
    }

    /**
     * @param string $organisation
     */
    public function setOrganisation($organisation)
    {
        $this->organisation = $organisation;
    }

    /**
     * @return string
     */
    public function getDepartment()
    {
        return $this->department;
    }

    /**
     * @param string $department
     */
    public function setDepartment($department)
    {
        $this->department = $department;
    }
}
			

Json.Generic.Order.Item.Item

Field Name Description
OrderLineNumber The order line number that together with ItemType uniquely identifies an item. The full range of a long value may be used. If using values above 2^32 you may loose backwards compatibility with older api versions
ItemType The enumeration ItemType together with the OrderLineNumber uniquely indexes an Item.
SkuCode Typically contains UPC, EAN, GTIN or APN code, may be "null".
Name Typically an article code, some payment methods like Klarna strongly depend on this value. Value can be "null".
Description Item description if any
Quantity Integer value with the quantity
UnitPriceExclusiveVat Integer value, converted using the price and currency representing the price for each unit without VAT. Discount applied when applicable.
UnitPriceInclusiveVat Integer value, converted using the price and currency representing the price for each unit with VAT. Discount applied when applicable. Is null if VAT is also null.
VatDisplayPercentage Integer value, converted by multiplying percentage by 100. Is used for display purposes. Can be "null" if no VAT applicable.
DiscountDisplayPercentage Integer value, converted by multiplying percentage by 100. Is used for displaying the applied discount. Can be "null" if no discount applied.
unitPriceMultiplyFactorOverride Factor to override currency to int conversion (x in 10^x)
Amount A readonly that calculates the item amout (incl. VAT) as an integer value (currency conversion applied)
CalculatedExclusiveVat A readonly that calculates the item amout (excl. VAT) as an integer value (currency conversion applied)

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.Order.Item
{
	public class Item
	{
		#region Json

		[JsonProperty]
		public Int64 OrderLineNumber { get; internal set; }

		[JsonProperty]
		public ItemType ItemType { get; internal set; }

		/// <summary>
		/// Optional: typical usage: UPC, EAN, GTIN or APN code
		/// </summary>
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String SkuCode { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String Name { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String Description { get; internal set; }

		[JsonProperty]
		public Int32 Quantity { get; internal set; }

		/// <summary>
		/// Price per unit exclusive Vat. (Including discount)
		/// </summary>
		[JsonProperty]
		public Int32 UnitPriceExclusiveVat { get; internal set; }

		/// <summary>
		/// Price per unit inclusive Vat. (Includes discount)
		/// </summary>
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? UnitPriceInclusiveVat { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? VatDisplayPercentage { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? DiscountDisplayPercentage { get; internal set; }

        /// <summary>
		/// If set this factor indicates the power of 10 to use to apply when specifying UnitPrices
		/// For example a factor of 4 indicates realvalue is UnitPrice / ( 10 power 4 ) 
		/// So if wanted unit price is EUR 0,0034 specify UnitPrice = 34 and Override value of 4 (default for EUR is 2)
		/// </summary>
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? UnitPriceMultiplyFactorOverride { get; internal set; }

		#endregion
	}
}

<?php
namespace PayCheckout\Json\Generic\Order\Item;
use PayCheckout\Json\JsonBase;
class Item extends JsonBase
{
    /**
     * @var int
     */
    protected $orderLineNumber;
    
    /**
     * @var int
     */
    protected $itemType;
    
    /**
     * Optional: typical usage: UPC, EAN, GTIN or APN code
     * 
     * @var string
     */
    protected $skuCode;
    
    /**
     * @var string
     */
    protected $name;
    
    /**
     * @var string
     */
    protected $description;
    
    /**
     * @var int
     */
    protected $quantity;
    
    /**
     * Price per unit exclusive VAT (including discount)
     * 
     * @var int
     */
    protected $unitPriceExclusiveVat;
    
    /**
     * Price per unit inclusive VAT (including discount)
     * 
     * @var int
     */
    protected $unitPriceInclusiveVat;
    
    /**
     * @var int
     */
    protected $vatDisplayPercentage;
    
    /**
     * @var int
     */
    protected $discountDisplayPercentage;
    
    /**
     * @var int
     */
    protected $unitPriceMultiplyFactorOverride;
    
    /**
     * Create new order item
     * 
     * @param int $orderLineNumber
     * @param int $itemType
     * @param string $name 
     * @param string $description 
     * @param int $quantity
     * @param int $unitPriceExclusiveVat 
     * @param int $unitPriceInclusiveVat 
     * @param int $vatDisplayPercentage 
     * @param int $discountDisplayPercentage 
     * @param string $skuCode
     * @param int unitPriceMultiplyFactorOverride
     */
    public function __construct($orderLineNumber = null, $itemType = null, $name = null, $description = null, $quantity = null, $unitPriceExclusiveVat = null, 
        $unitPriceInclusiveVat = null, $vatDisplayPercentage = null, $discountDisplayPercentage = null, $skuCode = null, $unitPriceMultiplyFactorOverride = null)
    {
        $this->orderLineNumber                  = $orderLineNumber;
        $this->itemType                         = $itemType;
        $this->name                             = $name;
        $this->description                      = $description;
        $this->quantity                         = $quantity;
        $this->unitPriceExclusiveVat            = $unitPriceExclusiveVat;
        $this->unitPriceInclusiveVat            = $unitPriceInclusiveVat;
        $this->vatDisplayPercentage             = $vatDisplayPercentage;
        $this->discountDisplayPercentage        = $discountDisplayPercentage;
        $this->skuCode                          = $skuCode;
        $this->unitPriceMultiplyFactorOverride  = $unitPriceMultiplyFactorOverride;
    }
    
    /**
     * @return int
     */
    public function getOrderLineNumber()
    {
        return $this->orderLineNumber;
    }
    
    /**
     * @param int $orderLineNumber
     */
    public function setOrderLineNumber($orderLineNumber)
    {
        $this->orderLineNumber = $orderLineNumber;
    }
    
    /**
     * @return int
     */
    public function getItemType()
    {
        return $this->itemType;
    }
    
    /**
     * @param int $itemType
     */
    public function setItemType($itemType)
    {
        $this->itemType = $itemType;
    }
    
    /**
     * @return string
     */
    public function getSkuCode()
    {
        return $this->skuCode;
    }
    
    /**
     * @param string $skuCode
     */
    public function setSkuCode($skuCode)
    {
        $this->skuCode = $skuCode;
    }
    
    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    
    /**
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }
    
    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }
    
    /**
     * @param string $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }
    
    /**
     * @return int
     */
    public function getQuantity()
    {
        return $this->quantity;
    }
    
    /**
     * @param int $quantity
     */
    public function setQuantity($quantity)
    {
        $this->quantity = $quantity;
    }
    
    /**
     * @return int
     */
    public function getUnitPriceExclusiveVat()
    {
        return $this->unitPriceExclusiveVat;
    }
    
    /**
     * @param int $unitPriceExclusiveVat
     */
    public function setUnitPriceExclusiveVat($unitPriceExclusiveVat)
    {
        $this->unitPriceExclusiveVat = $unitPriceExclusiveVat;
    }
    
    /**
     * @return int
     */
    public function getUnitPriceInclusiveVat()
    {
        return $this->unitPriceInclusiveVat;
    }
    
    /**
     * @param int $unitPriceInclusiveVat
     */
    public function setUnitPriceInclusiveVat($unitPriceInclusiveVat)
    {
        $this->unitPriceInclusiveVat = $unitPriceInclusiveVat;
    }
    
    /**
     * @return int
     */
    public function getVatDisplayPercentage()
    {
        return $this->vatDisplayPercentage;
    }
    
    /**
     * @param int $vatDisplayPercentage
     */
    public function setVatDisplayPercentage($vatDisplayPercentage)
    {
        $this->vatDisplayPercentage = $vatDisplayPercentage;
    }
    
    /**
     * @return int
     */
    public function getDiscountDisplayPercentage()
    {
        return $this->discountDisplayPercentage;
    }
    
    /**
     * @param int $discountDisplayPercentage
     */
    public function setDiscountDisplayPercentage($discountDisplayPercentage)
    {
        $this->discountDisplayPercentage = $discountDisplayPercentage;
    }
     
    /**
     * @return int
     */
    public function getUnitPriceMultiplyFactorOverride()
    {
        return $this->unitPriceMultiplyFactorOverride;
    }  
}
			

Json.Generic.Order.Item.OrderItem

Field Name Description
OrderLineNumber The orderlinenumber that together with itemtype uniquely identifies an item. The full range of a long value may be used. If using values above 2^32 you may loose backwards compatibility with older api versions
ItemType The enumeration ItemType together with the OrderLineNumber uniquely identifies an Item.
SkuCode Typical contains UPC, EAN GTIN or APN code, maybe "null".
Name Typical an article code, some payment methods like Klarna strongly depend on this value. Value can be "null".
Description Item description if any
QuantityOrdered Integer value with the quantity
QuantityInvoiced The quantity invoiced.
QuantityPaid The quantity paid.
QuantityRefunded The quantity refunded.
QuantityCancelled The quantity cancelled.
UnitPriceExclusiveVat Integer value, converted using the price and currency representing the price for each unit without VAT. Discount applied when applicable.
UnitPriceInclusiveVat Integer value, converted using the price and currency representing the price for each unit with VAT. Discount applied when applicable. Is null if VAT is also null.
VatDisplayPercentage Integer value, converted by multiplying percentage by 100. Is used for display purposes. Can be "null" if no VAT applicable.
DiscountPercentage Integer value, converted by multiplying percentage by 100. Is used for displaying the applied discoun. Can be "null" if no discount applied.
unitPriceMultiplyFactorOverride Factor to override currency to int conversion (x in 10^x)
Amount A readonly that calculates the item amout (incl. VAT) as an integer value (currency conversion applied)
CalculatedExclusiveVat A readonly that calculates the item amout (excl. VAT) as an integer value (currency conversion applied)

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Order.Item
{
	public class OrderItem : Item
	{
		#region Json

		// Quantity from base reflects the ordered quantity
		[JsonProperty]
		public Int32 QuantityInvoiced { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? QuantityPaid { get; internal set; }

		[JsonProperty]
		public Int32 QuantityRefunded { get; internal set; }

		[JsonProperty]
		public Int32 QuantityCancelled { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Generic\Order\Item;
use PayCheckout\Json\JsonBase;

class OrderItem extends Item
{    
    /**
     * @var int
     */
    protected $quantityInvoiced;
    
    /**
     * @var int
     */
    protected $quantityPaid;
    
    /**
     * @var int
     */
    protected $quantityRefunded;
    
    /**
     * @var int
     */
    protected $quantityCancelled;
    
    /**
     * Create new order item
     * 
     * @param int $orderLineNumber
     * @param int $itemType
     * @param string $name
     * @param string $description
     * @param int $quantity
     * @param int $quantityCancelled
     * @param int $quantityInvoiced
     * @param int $quantityRefunded
     * @param int $unitPriceExclusiveVat
     * @param int $unitPriceInclusiveVat
     * @param int $vatDisplayPercentage
     * @param int $discountDisplayPercentage
     * @param string $skuCode
     * @param int $unitPriceMultiplyFactorOverride
     */
    public function __construct($orderLineNumber = null, $itemType = null, $name = null, $description = null, $quantity = null,
        $quantityCancelled = null, $quantityInvoiced = null, $quantityRefunded = null, $unitPriceExclusiveVat = null, 
        $unitPriceInclusiveVat = null, $vatDisplayPercentage = null, $discountDisplayPercentage = null, $skuCode = null, $unitPriceMultiplyFactorOverride = null)
    {
        parent::__construct($orderLineNumber, $itemType, $name, $description, $quantity, $unitPriceExclusiveVat, 
            $unitPriceInclusiveVat, $vatDisplayPercentage, $discountDisplayPercentage, $skuCode, $unitPriceMultiplyFactorOverride );
		
        $this->quantity				= $quantity;
        $this->quantityInvoiced		= $quantityInvoiced;
        $this->quantityRefunded		= $quantityRefunded;
        $this->quantityCancelled	= $quantityCancelled;
    }
    
    /**
     * @return int
     */
    public function getQuantityInvoiced()
    {
        return $this->quantityInvoiced;
    }
    
    /**
     * @param int $quantity
     */
    public function setQuantityInvoiced($quantityInvoiced)
    {
        $this->quantityInvoiced = $quantityInvoiced;
    }
    
    /**
     * @return int
     */
    public function getQuantityPaid()
    {
        return $this->quantityPaid;
    }
    
    /**
     * @param int $quantity
     */
    public function setQuantityPaid($quantityPaid)
    {
        $this->quantityPaid = $quantityPaid;
    }
    
    /**
     * @return int
     */
    public function getQuantityRefunded()
    {
        return $this->quantityRefunded;
    }
    
    /**
     * @param int $quantity
     */
    public function setQuantityRefunded($quantityRefunded)
    {
        $this->quantityRefunded = $quantityRefunded;
    }
    
    /**
     * @return int
     */
    public function getQuantityCancelled()
    {
        return $this->quantityCancelled;
    }

    /**
     * @param int $quantity
     */
    public function setQuantityCancelled($quantityCancelled)
    {
        $this->quantityCancelled = $quantityCancelled;
    }
}
			

Json.Generic.Invoice.Invoice

Field Name Description
CreateTime Time the invoice was created
InvoiceNumber The assigned invoice number.
Paid Currently always true as invoicing is only allowed for paid payments.
CompletelyRefunded The attribute if all items wihtin the invoice are refunded. (true or false)
BillingIdentity The BillingIdentity of this invoice.
ShippingAddress The ShippingAddress of this invoice.
Items Contains a list of invoice Items.
CustomerOrderRef Contains a customer supplied order reference or "null"
CustomerNote Contains a customer supplied note or "null"
Refunds Contains a list of applied Refunds or "null"
Discounts Contains a list of applied Discounts or "null"
TrackAndTraceInfo Contains track and trace information for this invoice or null if not present (TrackAndTraceInfo)"
QuantityMultiplyFactor Contains (integer) QuantityMultiplyFactor or "null" when not used
ProcessedOffline True or False, depended how it was processed.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Invoice
{
	public class Invoice
	{
		#region Json

		[JsonProperty]
		public DateTime CreateTime { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String InvoiceNumber { get; internal set; }

		[JsonProperty]
		public bool	Paid { get; internal set; }

		[JsonProperty]
		public bool	CompletelyRefunded { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Order.Identity.Identity BillingIdentity { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Order.Identity.Address ShippingAddress { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Json.Generic.Order.Item.Item> Items { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CustomerOrderRef { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CustomerNote { get; internal set; }

        [JsonProperty]
        public bool ProcessedOffline { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Refund> Refunds { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Discount> Discounts { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public TrackAndTraceInfo TrackAndTraceInfo { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? QuantityMultiplyFactor { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Generic\Invoice;
    
use DateTime;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Generic\Invoice\Discount;
use PayCheckout\Json\Generic\Invoice\Refund;
use PayCheckout\Json\Generic\Invoice\TrackAndTraceInfo;
use PayCheckout\Json\Generic\Order\Identity\Identity;
use PayCheckout\Json\Generic\Order\Identity\Address;
use PayCheckout\Json\Generic\Order\Item\Item;
    
class Invoice extends JsonBase
{
    /**
     * @var DateTime
     */
    protected $createTime;
    
    /**
     * @var string
     */
    protected $invoiceNumber;
    
    /**
     * @var bool
     */
    protected $paid;
    
    /**
     * @var bool
     */
    protected $completelyRefunded;
    
    /**
     * @var Identity
     */
    protected $billingIdentity;
    
    /**
     * @var Address
     */
    protected $shippingAddress;
    
    /**
     * @var Item[]
     */
    protected $items;
    
    /**
     * @var string
     */
    protected $customerOrderRef;
    
    /**
     * @var string
     */
    protected $customerNote;
    
    /**
     * @var Refund[]
     */
    protected $refunds;
    
    /**
     * @var Discount[]
     */
    protected $discounts;
    
    /**
     * @var TrackAndTraceInfo
     */
    protected $trackAndTraceInfo;
    
    /**
     * @var integer
     */
    protected $quantityMultiplyFactor;
    
    /**
     * @var bool
     */
    protected $processedOffline;


    /**
     * Create new invoice
     */
    public function __construct() 
    {
        $this->items		= array();
        $this->refunds		= array();
        $this->discounts	= array();
    }
    
    /**
     * @return DateTime
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }
        
    /**
     * @return bool
     */
    public function isPaid()
    {
        return $this->paid;
    }
        
    /**
     * @return bool
     */
    public function isCompletelyRefunded()
    {
        return $this->completelyRefunded;
    }
        
    /**
     * @return Identity
     */
    public function getBillingIdentity()
    {
        return $this->billingIdentity;
    }
        
    /**
     * @return Address
     */
    public function getShippingAddress()
    {
        return $this->shippingAddress;
    }
        
    /**
     * @return Item[]
     */
    public function getItems()
    {
        return $this->items;
    }
        
    /**
     * @return string
     */
    public function getCustomerOrderReference()
    {
        return $this->customerOrderRef;
    }  
    
    /**
     * @return string
     */
    public function getCustomerNote()
    {
        return $this->customerNote;
    }
        
    /**
     * @return Refund[]
     */
    public function getRefunds()
    {
        return $this->refunds;
    }
       
    /**
     * @return Discount[]
     */
    public function getDiscounts()
    {
        return $this->discounts;
    }
    
    /**
     * @return TrackAndTraceInfo
     */
    public function getTrackAndTraceInfo()
    {
        return $this->trackAndTraceInfo;
    }

    /**
     * @return int
     */
    public function getQuantityMultiplyFactor()
    {
        return $this->quantityMultiplyFactor;
    }
    
    /**
     * @return bool
     */
    public function getProcessedOffline()
    {
        return $this->processedOffline;
    }
            
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'createTime':
                $this->createTime = new DateTime($value);
                return;
            case 'billingIdentity':
                $this->billingIdentity = new Identity();
                $this->billingIdentity->jsonDeserialize($value);
                return;
            case 'shippingAddress':
                $this->shippingAddress = new Address();
                $this->shippingAddress->jsonDeserialize($value);
                return;
            case 'trackAndTraceInfo':
                $this->trackAndTraceInfo = new TrackAndTraceInfo();
                $this->trackAndTraceInfo->jsonDeserialize($value);
                return;
            case 'items':
                // Items needs to an array (list of items)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new Item();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addItem($item);
                        }
                    }
                }
                return;
            case 'refunds':
                // Refund needs to an array (list of refunds)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new refund and add to refunds
                            $item = new Refund();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addRefund($item);
                        }
                    }
                }
                return;
            case 'discounts':
                // Discounts needs to an array (list of discounts)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new discount and add to discounts
                            $item = new Discount();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addDiscount($item);
                        }
                    }
                }
                return;
        }
		
        parent::setJsonData($name, $value);
    }
}
				 	
			

Json.Generic.Invoice.Refund

Field Name Description
CreateTime Time the invoice was created
RefundReference The assigned refund reference (CreditNote).
Items Contains a list of refunded Items.
RefundCost Can be "null" or refer to class RefundCost.
ProcessedOffline True or False, depended how it was processed.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Generic.Invoice
{
	public class Refund
	{
		#region Json

		[JsonProperty]
		public DateTime CreateTime { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string RefundReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Order.Item.Item> Items { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Json.Parameter.RefundCost RefundCost { get; internal set; }

        [JsonProperty]
        public bool ProcessedOffline { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Invoice;
    
use DateTime;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Generic\Invoice\RefundItem;
use PayCheckout\Json\Parameter\RefundCost;
    
class Refund extends JsonBase
{
    /**
     * @var DateTime
     */
    protected $createTime;
    
    /**
     * @var string
     */
    protected $refundReference;
    
    /**
     * @var RefundItem[]
     */
    protected $items;
    
    /**
     * @var RefundCost
     */
    protected $refundCost;

    /**
     * @var bool
     */
    protected $processedOffline;
    
    /**
     * Create new refund
     */
    public function __construct()
    {
        $this->items = array();
    }
    
    /**
     * @return DateTime
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }
    
    /** 
     * @param DateTime $createTime 
     */
    public function setCreateTime(DateTime $createTime)
    {
        $this->createTime = $createTime;
    }
    
    /**
     * @return string
     */
    public function getRefundReference()
    {
        return $this->refundReference;
    }
    
    /**
     * @param string $refundReference
     */
    public function setRefundReference($refundReference)
    {
        $this->refundReference = $refundReference;
    }
    
    /**
     * @return RefundItem[]
     */
    public function getItems()
    {
        return $this->items;
    }
    
    /**
     * @param RefundItem[] $items
     */
    public function addItem(RefundItem $item)
    {
        $this->items[] = $item;
    }
    
    /**
     * @return RefundCost
     */
    public function getRefundCost()
    {
        return $this->refundCost;
    }
    
    /**
     * @param RefundCost $refundCost 
     */
    public function setRefundCost(RefundCost $refundCost)
    {
        $this->refundCost = $refundCost;    
    }
        
    /**
     * @return bool
     */
    public function getProcessedOffline()
    {
        return $this->processedOffline;
    }

    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'createTime':
                $this->createTime = new DateTime($value);
                return;
            case 'items':
                // Items needs to an array (list of items)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new RefundItem();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addItem($item);
                        }
                    }
                }
                return;
            case 'refundCost':
                $this->refundCost = new RefundCost();
                $this->refundCost->jsonDeserialize($value);
                return;
        }
		
        parent::setJsonData($name, $value);
    }
}
			

Json.Generic.Invoice.RefundItem

Field Name Description
OrderLineNumber The order line number that together with ItemType uniquely identifies an item. The full range of an integer value may be used.
ItemType The enumeration ItemType together with the OrderLineNumber uniquely indexes an Item.
SkuCode Typically contains UPC, EAN, GTIN or APN code, may be "null".
Name Typically an article code, some payment methods like Klarna strongly depend on this value. Value can be "null".
Description Item description if any
Quantity Integer value with the quantity
UnitPriceExclusiveVat Integer value, converted using the price and currency representing the price for each unit without VAT. Discount applied when applicable.
UnitPriceInclusiveVat Integer value, converted using the price and currency representing the price for each unit with VAT. Discount applied when applicable. Is null if VAT is also null.
VatDisplayPercentage Integer value, converted by multiplying percentage by 100. Is used for display purposes. Can be "null" if no VAT applicable.
DiscountDisplayPercentage Integer value, converted by multiplying percentage by 100. Is used for displaying the applied discount. Can be "null" if no discount applied.
unitPriceMultiplyFactorOverride Factor to override currency to int conversion (x in 10^x)
Amount A readonly that calculates the item amout (incl. VAT) as an integer value (currency conversion applied)
CalculatedExclusiveVat A readonly that calculates the item amout (excl. VAT) as an integer value (currency conversion applied)
RefundAmount The amount that has been refunded for this item

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.Invoice
{
	public class RefundItem : Order.Item.Item
	{
		#region Json

		[JsonProperty]
		public Int32 RefundAmount { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Invoice;
    
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Generic\Order\Item\Item;
    
class RefundItem extends Item
{
    /**
     * @var int
     */
    protected $refundAmount;
    
    /**
     * 
     * returns RefundAmount
     * 
     * @return int
     */
    function getRefundAmount()
    {
        return $this->refundAmount;
    }  
}
			

Json.Generic.Invoice.Discount

Field Name Description
CreateTime Time the invoice was created
DiscountReference The assigned discount reference.
AmountInclusiveVat The amount of the discount including VAT (Integer converted from amount and currency).
AmountExclusiveVat The amount of the discount excluding VAT (Integer converted from amount and currency).
VatDisplayPercentage The VAT percentage to display (Vat percentage * 100). Can have value "null" if no VAT is applied.
CustomerNote Customer note about the reason the discount was applied.
ProcessedOffline True or False, depended how it was processed.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.Invoice
{
	public class Discount
	{
		#region Json

		[JsonProperty]
		public DateTime CreateTime { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string DiscountReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? AmountInclusiveVat { get; internal set; }

		[JsonProperty]
		public Int32 AmountExclusiveVat { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? VatDisplayPercentage { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CustomerNote { get; internal set; }

        [JsonProperty]
   		public bool ProcessedOffline { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\Invoice;

use DateTime;
class Discount extends JsonBase
{
    /**
     * @var DateTime
     */
    protected $createTime;
    
    /**
     * @var string
     */
    protected $discountReference;
    
    /**
     * @var int
     */
    protected $amountInclusiveVat;
    
    /**
     * @var int
     */
    protected $amountExclusiveVat;
    
    /**
     * @var int
     */
    protected $vatDisplayPercentage;
    
    /**
     * @var string
     */
    protected $customerNote;
    
    /**
     * @var bool
     */
    protected $processedOffline;
    
    /**
     * @return DateTime
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }
    
    /**
     * @param DateTime $createTime 
     */
    public function setCreateTime(DateTime $createTime)
    {
        $this->createTime = $createTime;
    }
    
    /**
     * @return string
     */
    public function getDiscountReference()
    {
        return $this->discountReference;
    }
    /**
     * @param string $discountReference
     */
    public function setDiscountReference($discountReference)
    {
        $this->discountReference = $discountReference;
    }
    
    /**
     * @return int
     */
    public function getAmountInclusiveVat()
    {
        return $this->amountInclusiveVat;
    }
    /**
     * @param int $amountInclusiveVat
     */
    public function setAmountInclusiveVat($amountInclusiveVat)
    {
        $this->amountInclusiveVat = $amountInclusiveVat;
    }
    
    /**
     * @return int
     */
    public function getAmountExclusiveVat()
    {
        return $this->amountExclusiveVat;
    }
    /**
     * @param int $amountExclusiveVat
     */
    public function setAmountExclusiveVat($amountExclusiveVat)
    {
        $this->amountExclusiveVat = $amountExclusiveVat;
    }
    
    /**
     * @return int
     */
    public function getVatDisplayPercentage()
    {
        return $this->vatDisplayPercentage;
    }
    /**
     * @param int $vatDisplayPercentage
     */
    public function setVatDisplayPercentage($vatDisplayPercentage)
    {
        $this->vatDisplayPercentage = $vatDisplayPercentage;
    }
    
    /**
     * @return string
     */
    public function getCustomerNote()
    {
        return $this->customerNote;
    }

    /**
     * @param string $customerNote
     */
    public function setCustomerNote($customerNote)
    {
        $this->customerNote = $customerNote;
    }
    
    /**
     * @return bool
     */
    public function getProcessedOffline()
    {
        return $this->processedOffline;
    }

    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'createTime':
                $this->createTime = new DateTime($value);
                return;
        }
		
        parent::setJsonData($name, $value);
    }
}
			

Json.Generic.Invoice.TrackAndTraceInfo

Field Name Description Restrictions
TrackingNumber The trackingnumber for this shipment/invoice. Empty or a valid string
TrackingUrl The trackingurl for this shipment/invoice. Empty or a valid url
ShippingCompany The companyname that excecutes the shipment. Empty or a valid string
ShippingMethod The shipping method used. Empty or a valid string
ReturnTrackingNumber The trackingnumber in case the goods are returned. Empty or a valid string
ReturnTrackingUrl The trackingurl in case the goods are returned. Empty or a valid url
ReturnShippingCompany The name of the company that will handle the return of the goods. Empty or a valid string

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.Invoice
{
	public class TrackAndTraceInfo
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string TrackingNumber { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string TrackingUrl { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string ShippingCompany { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string ShippingMethod { get; set; }

  		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string ReturnTrackingNumber { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string ReturnTrackingUrl { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string ReturnShippingCompany { get; set; }

		#endregion
	}
}

<?php
namespace PayCheckout\Json\Generic\Invoice;

use PayCheckout\Json\JsonBase;

/**
 * TrackAndTraceInfo
 */
class TrackAndTraceInfo extends JsonBase
{
    /**
     * @var string
     */
    protected $trackingNumber;
    
    /**
     * @var string
     */
    protected $trackingUrl;
    
    /**
     * @var string
     */
    protected $shippingCompany;
    
    /**
     * @var string
     */
    protected $shippingMethod;
    
    /**
     * @var string
     */
    protected $returnTrackingNumber;
    
    /**
     * @var string
     */
    protected $returnTrackingUrl;
    
    /**
     * @var string
     */
    protected $returnShippingCompany;
    
    /**
     * Summary of set
     * @param string $trackingNumber 
     * @param string $trackingUrl 
     * @param string $shippingCompany 
     * @param string $shippingMethod 
     * @param string $returnTrackingNumber 
     * @param string $returnTrackingUrl 
     * @param string $returnShippingCompany 
     */
    public function set($trackingNumber,$trackingUrl,$shippingCompany,$shippingMethod,$returnTrackingNumber,$returnTrackingUrl,$returnShippingCompany)
    {
        $this->trackingNumber           = $trackingNumber;
        $this->trackingUrl              = $trackingUrl;
        $this->shippingCompany          = $shippingCompany;
        $this->shippingMethod           = $shippingMethod;
        $this->returnTrackingNumber     = $returnTrackingNumber;
        $this->returnTrackingUrl        = $returnTrackingUrl;
        $this->returnShippingCompany    = $returnShippingCompany;
    }
    
    /**
     * @return string
     */
    public function getTrackingNumber()
    {
        return $this->trackingNumber;
    }
    
    /**
     * @return string
     */
    public function getTrackingUrl()
    {
        return $this->trackingUrl;
    }
    
    /**
     * @return string
     */
    public function getShippingCompany()
    {
        return $this->shippingCompany;
    }
      
    /**
     * @return string
     */
    public function getShippingMethod()
    {
        return $this->shippingMethod;
    }   
    
    /**
     * @return string
     */
    public function getReturnTrackingNumber()
    {
        return $this->returnTrackingNumber;
    }   
    
    /**
     * @return string
     */
    public function getReturnTrackingUrl()
    {
        return $this->returnTrackingUrl;
    }   
    
    /**
     * @return string
     */
    public function getReturnShippingCompany()
    {
        return $this->returnShippingCompany;
    }   
}
			

Json.Generic.PaymentSpecific.IDeal

Field Name Description
ConsumerName The registered name on the consumers bank account.
ConsumerBIC The BIC name of the consumer bank.
ConsumerIBAN The IBAN bank account of the consumer.
iDEALTxn The iDEAL txn reference (as given by the acquiring bank).

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class IDeal
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerName { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerBIC { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerIBAN { get; internal set; }

  		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String IDEALTxn		{ get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;

class IDeal extends JsonBase
{
    /**
     * @var string
     */
    protected $consumerName;
    
    /**
     * @var string
     */
    protected $consumerBIC;
    
    /**
     * @var string
     */
    protected $consumerIBAN;
        
    /**
     * @var string
     */
    protected $iDEALTxn;
    
    /**
     * @return string
     */
    public function getConsumerName()
    {
        return $this->consumerName;
    }   
    
    /**
     * @return string
     */
    public function getConsumerBIC()
    {
        return $this->consumerBIC;
    }
           
    /**
     * @return string
     */
    public function getConsumerIBAN()
    {
        return $this->consumerIBAN;
    }
        
    /**
     * @return string
     */
    public function getIDEALTxn()
    {
        return $this->iDEALTxn;
    }
}
			

Json.Generic.PaymentSpecific.Klarna

Field Name Description
ReservationNumber The Klarna reservation number.
KlarnaOrderStatus The Klarna order status (as returned from the Klarna API).
PClassIdUsed The PClassId (Campaign) used or "null" if KlarnaInvoice.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class Klarna
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ReservationNumber { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String KlarnaOrderStatus { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PClassIdUsed { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;
class Klarna extends JsonBase
{
    /**
     * @var string
     */
    protected $reservationNumber;
    
    /**
     * @var string
     */
    protected $klarnaOrderStatus;
    
    /**
     * @var int
     */
    protected $pClassIdUsed;
    
    /**
     * @return string
     */
    public function getReservationNumber()
    {
        return $this->reservationNumber;
    }
    
    /**
     * @param string $reservationNumber 
     */
    public function setReservationNumber($reservationNumber)
    {
        $this->reservationNumber = $reservationNumber;
    }
    
    /**
     * @return string
     */
    public function getKlarnaOrderStatus()
    {
        return $this->klarnaOrderStatus;
    }
    
    /**
     * @param string $klarnaOrderStatus 
     */
    public function setKlarnaOrderStatus($klarnaOrderStatus)
    {
        $this->klarnaOrderStatus = $klarnaOrderStatus;
    }
    
    /**
     * @return string
     */
    public function getPClassIdUsed()
    {
        return $this->pClassIdUsed;
    }
    
    /**
     * @param string $pClassIdUsed 
     */
    public function setPClassIdUsed($pClassIdUsed)
    {
        $this->pClassIdUsed = $pClassIdUsed;
    }
}
			

Json.Generic.PaymentSpecific.PayPal

Field Name Description
PaymentTransactionId The PayPal payment transaction id.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class PayPal
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String PaymentTransactionId { get; internal set; }

		#endregion
	}
}
                

<?php

namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;

class PayPal extends JsonBase
{
    /**
     * @var string
     */
    protected $paymentTransactionId;
    
    /**
     * @return string
     */
    public function getPaymentTransactionId()
    {
        return $this->paymentTransactionId;
    }
}
				 	
			

Json.Generic.PaymentSpecific.Sofort

Field Name Description
TestPayment Boolean, true or false.
BankReference String with the description on what is on the bankstatement.
SofortTransaction String with sofort transaction identifier.
ConsumerName bank account holder name.
ConsumerBIC BIC code of bank used.
ConsumerIBAN IBAN accountnumber.
BankCode BIC or other if not SEPA bank account.
BankName Name of the bank where the account is held.
AccountNumber IBAN or other accountnumber if not SEPA bank account.
CountryCode ISO3166 2-character country code where bank is located.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class SofortBanking
	{
		#region Json

		[JsonProperty]
		public Boolean TestPayment { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String BankReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String SofortTransaction { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerName { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerBIC { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerIBAN { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String BankCode { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String BankName { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String AccountNumber { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String CountryCode { get; internal set; }

		#endregion
	}
}
                

<?php

namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;

class SofortBanking extends JsonBase
{
    /**
     * @var bool
     */
    protected $testPayment; 
    
    /**
     * @var string
     */
	protected $bankReference;
	
    /**
     * @var string
     */
	protected $sofortTransaction;
    
	/**
     * @var string
     */
	protected $consumerName;
    
	/**
     * @var string
     */
	protected $consumerBIC;
    
	/**
     * @var string
     */
	protected $consumerIBAN;
    
	/**
     * @var string
     */
	protected $bankCode;
    
	/**
     * @var string
     */
	protected $bankName;
    
	/**
     * @var string
     */
	protected $accountNumber;
    
	/**
     * @var string
     */
	protected $countryCode;
    
	/**
	 * @return bool
	 */
	public function getTestPayment()
    {
        return $this->testPayment;
    }
	
	/**
     * @return string
     */
    public function getBankReference()
    {
        return $this->bankReference;
    }
	
    /**
     * @return string
     */
    public function getSofortTransaction()
    {
        return $this->sofortTransaction;
    }
    
    /**
     * @return string
     */
	public function getConsumerName()
    {
        return $this->consumerName;
    }
    
    /**
     * @return string
     */
	public function getConsumerBIC()
    {
        return $this->consumerBIC;
    }
    
    /**
     * @return string
     */
	public function getconsumerIBAN()
    {
        return $this->consumerIBAN;
    }
    
    /**
     * @return string
     */
    public function getBankCode()
    {
        return $this->bankCode;
    }
    
    /**
     * @return string
     */
	public function getBankName()
    {
        return $this->bankName;
    }
    
    /**
     * @return string
     */
	public function getAccountNumber()
    {
        return $this->accountNumber;
    }
    
    /**
     * @return string
     */
	public function getCountryCode()
    {
        return $this->countryCode;
    }   
}				 	
			

Json.Generic.PaymentSpecific.SEPAbanktransfer

Field Name Description
BankReference The payment reference the customer should enter in their banking application.
ConsumerName The registered name on the consumers bank account.
ConsumerBIC The BIC name of the consumer bank.
ConsumerIBAN The IBAN bank account of the consumer.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class SEPAbanktransfer
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String BankReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerName { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerBIC { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerIBAN { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;
class SEPAbanktransfer extends JsonBase
{
    /**
     * @var string
     */
    protected $bankReference;
	
    /**
     * @var string
     */
    protected $consumerName;
    
    /**
     * @var string
     */
    protected $consumerBIC;
    
    /**
     * @var string
     */
    protected $consumerIBAN;
    
    /**
     * @return string
     */
    public function getConsumerName()
    {
        return $this->consumerName;
    }
    
    /**
     * @param string $consumerName 
     */
    public function setConsumerName($consumerName)
    {
        $this->consumerName = $consumerName;
    }

    /**
     * @return string
     */
    public function getBankReference()
    {
        return $this->bankReference;
    }
    
    /**
     * @return string
     */
    public function getConsumerBIC()
    {
        return $this->consumerBIC;
    }
    
    /**
     * @param string $consumerBIC 
     */
    public function setConsumerBIC($consumerBIC)
    {
        $this->consumerBIC = $consumerBIC;
    }
    
    /**
     * @return string
     */
    public function getConsumerIBAN()
    {
        return $this->consumerIBAN;
    }
    
    /**
     * @param string $consumerIBAN 
     */
    public function setConsumerIBAN($consumerIBAN)
    {
        $this->consumerIBAN = $consumerIBAN;
    }
}
			

Json.Generic.PaymentSpecific.Creditcard

Field Name Description
MaskedPan The masked creditcard number.
CreditcardBrand One of the CreditcardBrand enumerations, "null" if unknown.
CreditcardTxn Assigned txn number returned from the acquirer ("null" for emulated creditcard).

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class Creditcard
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String						MaskedPan		{ get; internal set; }
		
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PayCheckout.CreditCardBrand?	CreditcardBrand	{ get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String						CreditcardTxn	{ get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;

class Creditcard extends JsonBase
{
    /**
     * @var string
     */
    protected $maskedPan;
    
    /**
     * @var int
     */
    protected $creditcardBrand;
    
    /**
     * @var string
     */
    protected $creditcardTxn;
           
    /**
     * @return string
     */
    public function getMaskedPan()
    {
        return $this->maskedPan;
    }   
    
    /**
     * @return int
     */
    public function getCreditcardBrand()
    {
        return $this->creditcardBrand;
    }
           
    /**
     * @return string
     */
    public function getCreditcardTxn()
    {
        return $this->creditcardTxn;
    }
}
			

Json.Generic.PaymentSpecific.Bancontact

Field Name Description
ConsumerName The registered name on the consumers bank account.
ConsumerBIC The BIC name of the consumer bank.
ConsumerIBAN The IBAN bank account of the consumer.
BancontactTxn The Bancontact txn reference (as given by the acquiring bank).

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Generic.PaymentSpecific
{
	public class Bancontact
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerName  { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerBIC   { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ConsumerIBAN  { get; internal set; }

  		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String BancontactTxn	{ get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Generic\PaymentSpecific;

use PayCheckout\Json\JsonBase;

class Bancontact extends JsonBase
{
    /**
     * @var string
     */
    protected $consumerName;
    
    /**
     * @var string
     */
    protected $consumerBIC;
    
    /**
     * @var string
     */
    protected $consumerIBAN;
        
    /**
     * @var string
     */
    protected $bancontactTxn;
    
    /**
     * @return string
     */
    public function getConsumerName()
    {
        return $this->consumerName;
    }   
    
    /**
     * @return string
     */
    public function getConsumerBIC()
    {
        return $this->consumerBIC;
    }
           
    /**
     * @return string
     */
    public function getConsumerIBAN()
    {
        return $this->consumerIBAN;
    }
        
    /**
     * @return string
     */
    public function getBancontactTxn()
    {
        return $this->bancontactTxn;
    }
}
			

Json.PaymentInfo.PaymentInfo

Field Name Description
CreateTime Time this class was created in UTC.
Currency Currency in case of a payment. Currency is null when for example a Job is referred.
PaymentAmount In case of a payment: the amount to be paid, converted to an integer value. When no payment is involved the value might be "null"
ReservationAmount If case of a payment where reservations are used, the amount of the reservation, converted to an integer value. When no payment is involved the value might be "null"
Balance Value reflects the sum of all payments received on this payment. The value is converted to an integer value. When no payment is involved the value might be "null"
LastUpdateTime Time this class was last updated in UTC.
Status One of the possible PaymentStatus values.
SecondChanceEmailSent True or False depending on the fact if a second chance email has been sent for this payment
Transactions Collection of TransactionInfo classes.
PaymentReference Reference of this payment.
PaymentFlag The PaymentFlag or a combination of PaymentFlags applicable for this payment.
SplitOutpaymentInfo "null" or contains an instance of a SplitOutpaymentInfo class if splitOutpaymentInfo actions are present.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.PaymentInfo
{
	public class PaymentInfo
	{
		#region Json
		[JsonProperty]
		public DateTime CreateTime { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Currency? Currency { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentAmount { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? ReservedAmount { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? Balance { get; internal set; }

		[JsonProperty]
		public DateTime LastUpdateTime { get; internal set; }

		[JsonProperty]
		public PaymentStatus Status { get; internal set; }

   		[JsonProperty]
		public bool SecondChanceEmailSent { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<TransactionInfo> Transactions { get; internal set; }

   		[JsonProperty]
		public Int64	PaymentReference { get; internal set;}

		[JsonProperty]
		public PayCheckout.PaymentFlag PaymentFlag { get; internal set;}

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public SplitOutpaymentInfo		SplitOutpaymentInfo		{ get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\PaymentInfo;

use DateTime;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\PaymentInfo\TransactionInfo;
use PayCheckout\Json\PaymentInfo\SplitOutpaymentInfo;

class PaymentInfo extends JsonBase
{
    /**
	 * @var DateTime
	 */
    protected $createTime;
	
	/**
	 * @var int
	 */
	protected $currency;
	
	/**
	 * @var int
	 */
	protected $paymentAmount;
    
	/**
	 * @var int
	 */
	protected $reservedAmount;
	
	/**
	 * @var int
	 */
	protected $balance;
    
    /**
	 * @var DateTime
	 */
    protected $lastUpdateTime;
    
    /**
	 * @var int
	 */
    protected $status;
    
    /**
     * @var bool
     */
    protected $secondChanceEmailSent;
    
    /**
	 * @var TransactionInfo[]
	 */
    protected $transactions;
        
    /**
     * @var int|string
     */
    protected $paymentReference;
    
    /**
     * @var int
     */
    protected $paymentFlag;
                                 
    /**
     * @var SplitOutpaymentInfo
     */
    protected $splitOutpaymentInfo;
    
    /**
	 * Create new payment info
	 */
    public function __construct()
    {
        $this->transactions = array();
    }
    
    /**
	 * @return DateTime
	 */
    public function getCreateTime()
    {
        return $this->createTime;
    }
    	
	/**
	 * @return int 
	 */
    public function getCurrency()
    {
        return $this->currency;
    }
        
	/**
	 * @return int 
	 */
    public function getPaymentAmount()
    {
        return $this->paymentAmount;
    }
        
	/**
	 * @return int 
	 */
    public function getReservedAmount()
    {
        return $this->reservedAmount;
    }
    	
	/**
	 * @return int 
	 */
    public function getBalance()
    {
        return $this->balance;
    }
        
    /**
	 * @return DateTime
	 */
    public function getLastUpdateTime()
    {
        return $this->lastUpdateTime;
    }
        
    /**
	 * @return int
	 */
    public function getPaymentStatus()
    {
        return $this->status;
    }
  
    /**
     * @return bool
     */
    public function getSecondChanceEmailSent()
    {
        return (bool) $this->secondChanceEmailSent;
    }
    
    /**
     * @return \integer|string
     */
    public function getPaymentReference()
    {
        return $this->paymentReference;
    }
    
    /**
     * @return integer
     */
    public function getPaymentFlag()
    {
        return $this->paymentFlag;
    }
      
    /**
	 * @return TransactionInfo[]
	 */
    public function getTransactions()
    {
        return $this->transactions;
    }
        
    /**
     * Add transaction
     * 
     * @param TransactionInfo $transactionInfo
     */
    private function addTransaction(TransactionInfo $transactionInfo)
    {
        $this->transactions[] = $transactionInfo;
    }
                             
    /**
     * @return SplitOutpaymentInfo
     */
    public function getSplitOutpaymentInfo()
    {
        return $this->splitOutpaymentInfo;
    }
           
    /**
	 * {@inheritDoc}
	 */
    protected function setJsonData($name, $value)
    {        
        switch($name)
        {
            case 'createTime':
                $this->createTime = new DateTime($value);
                return;
            case 'lastUpdateTime':
                $this->lastUpdateTime = new DateTime($value);
                return;
            case 'transactions':
                // Transactions needs to an array (list of transactions)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new TransactionInfo();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addTransaction($item);
                        }
                    }
                }
                return;
            case 'splitOutpaymentInfo':
                $this->splitOutpaymentInfo = new SplitOutpaymentInfo();
                $this->splitOutpaymentInfo->jsonDeserialize($value);
                return;
        }
		
        parent::setJsonData($name, $value);
    }
}			

Json.PaymentInfo.TransactionInfo

Field Name Description
TransactionReference The unique reference for this transaction
TraceReference Trace reference that can be used to look up what exactly happened in this transaction.
LastUpdateTime Time this class was last updated in UTC.
Action ApiAction that initiated this transaction.
BalanceMutationAmount Amount the balance is mutated with in this action, converted to an integer value. When no payment is involved the value might be "null"
ReservationMutationAmount Amount the reservation is mutated with in this action, converted to an integer value. When no payment is involved the value might be "null"
Status The TransactionStatus of this transaction.
SubStatus Additional status info, paymentmethod specific, of this transaction.
AccountAction One, or a combination, of the possible AccountAction values. You can use DisplayAccountAction to generate a string with all flags listed.
PaymentMethod Contains PaymentMethod that is associated with this transaction.
PaymentMethodDescription Contains a, localized to the culture of the payment, description of the payment method.
RelatedPaymentReference Contains "null" or a related payment reference. For example a refund payment.
RelatedTransactionIndex Contains "null" or the index of the transaction where this transaction relates too. Typical payment/statusrequest are linked this way, so that you can find which statusrequest belongs to which payment and vice-versa.
HostedExpirationTime Contains "null" or UTC time the hosted payment is configured to expire. NOTE: When a payment is pending for the hosted payment, until the status of that pending payment is final the hosted payment will not expire!
IpAddress Internet address of the caller of the transaction.
Request Contains "null" or the Request that is executed on this transaction.
Response Contains "null" or the Response that is executed on this transaction.
PreviousOrder Contains "null" or how the Order class looked before execution of this transaction.
CurrentOrder Contains "null" or how the Order class looks after execution of this transaction.
Invoices Contains "null" or a collection of Invoice classes that represent generated invoices upto this transaction.
CustomerDiscounts Contains "null" or a collection of Discount classes that represent generated discount actions upto this transaction.
IDeal Contains "null" or an IDeal class specifying the payment details of the transaction.
PayPal Contains "null" or a PayPal class specifying the payment details of the transaction.
Sofort Contains "null" or a Sofort class specifying the payment details of the transaction.
SEPAbanktransfer Contains "null" or a SEPAbanktransfer class specifying the payment details of the transaction.
Creditcard Contains "null" or a Creditcard class specifying the payment details of the transaction.
Bancontact Contains "null" or a Bancontact class specifying the payment details of the transaction.
ProcessedOffline True or False, depended how it was processed.
StatisticsSpecifier Optional specifies additional info regarding this transaction used for statistics generation.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace PayCheckout.Json.PaymentInfo
{
	public class TransactionInfo
	{
		#region Json
		[JsonProperty]
		public Int64 TransactionReference { get; internal set; }

		[JsonProperty]
		public Int64 TraceReference { get; internal set; }

		[JsonProperty]
		public DateTime LastUpdateTime { get; internal set; }

		[JsonProperty]
		public ApiAction Action { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? ReservationMutationAmount { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? BalanceMutationAmount { get; internal set; }

		[JsonProperty]
		public TransactionStatus Status { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String SubStatus { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public AccountAction? AccountAction { get; internal set; }
		
		[JsonProperty]
		public PayCheckout.PaymentMethod PaymentMethod { get; internal set; }

   		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String PaymentMethodDescription { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64? RelatedPaymentReference { get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public Int32? RelatedTransactionIndex { get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime? HostedExpirationTime { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String IpAddress { get; internal set; }
		
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Request.Request Request { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Response.Response Response { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.Order.Order PreviousOrder { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.Order.Order CurrentOrder { get; internal set; }

        [JsonProperty]
   		public bool ProcessedOffline { get; set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String StatisticsSpecifier { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Generic.Invoice.Invoice> Invoices { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Generic.Invoice.Discount> CustomerDiscounts { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.PaymentSpecific.IDeal Ideal { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.PaymentSpecific.PayPal PayPal { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.PaymentSpecific.Sofort Sofort { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.PaymentSpecific.SEPAbanktransfer SEPAbanktransfer { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.PaymentSpecific.Creditcard Creditcard { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.PaymentSpecific.Bancontact Bancontact { get; internal set; }

		#endregion

		public String DisplayAccountAction
		{
			get
			{
				if (!AccountAction.HasValue) return "";
				StringBuilder buildstr = new StringBuilder();
				foreach (var compareAction in Enum.GetValues(typeof(PayCheckout.AccountAction)))
				{
					if ((int) compareAction == (int) PayCheckout.AccountAction.NoAction) continue;
					if (( (int) AccountAction.Value & (int) compareAction) == (int) compareAction)
					{
						if (buildstr.Length > 0) buildstr.Append(", ");
						buildstr.Append(compareAction.ToString());
					}
				}
				return buildstr.ToString();
			}
		}
	}
}

<?php

namespace PayCheckout\Json\PaymentInfo;

use DateTime;
use PayCheckout\Json\Generic\Invoice\Discount;
use PayCheckout\Json\Generic\Invoice\Invoice;
use PayCheckout\Json\Generic\Order\Order;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Request\Request;
use PayCheckout\Json\Response\Response;
use PayCheckout\Json\Generic\PaymentSpecific\IDeal;
use PayCheckout\Json\Generic\PaymentSpecific\PayPal;
use PayCheckout\Json\Generic\PaymentSpecific\SofortBanking;
use PayCheckout\Json\Generic\PaymentSpecific\SEPAbanktransfer;
use PayCheckout\Json\Generic\PaymentSpecific\Creditcard;
use PayCheckout\Json\Generic\PaymentSpecific\Bancontact;

class TransactionInfo extends JsonBase
{
    /**
	 * @var int|string
	 */
    protected $transactionReference;
    
    /**
	 * @var int|string
	 */
    protected $traceReference;
    
    /**
	 * @var DateTime
	 */
    protected $lastUpdateTime;
    
    /**
	 * @var int
	 */
    protected $action;
	
    /**
	 * @var int
	 */
    protected $reservationMutationAmount;
    
    /**
	 * @var int
	 */
    protected $balanceMutationAmount;
	
	/**
	 * @var int
	 */
    protected $status;
    
    /**
     * @var int
     */
    protected $paymentStatus;
    
	/**
     * @var string
     */
    protected $subStatus;
    
	/**
	 * @var int
	 */
	protected $accountAction;
    
	/**
     * @var int
     */
	protected $paymentMethod;
    
    /**
     * @var string
     */
    protected $paymentMethodDescription;
    
    /**
	 * @var int|string
     */
    protected $relatedPaymentReference;
        
    /**
     * @var int
     */
    protected $relatedTransactionIndex;
        
    /**
     * @var DateTime
     */
    protected $hostedExpirationTime;
    
    /**
	 * @var string
	 */
    protected $ipAddress;
    
    /**
	 * @var Request
	 */
    protected $request;
    
    /**
	 * @var Response
	 */
    protected $response;
        
    /**
	 * @var Order
	 */
    protected $previousOrder;
    
    /**
	 * @var Order
	 */
    protected $currentOrder;
    
    /**
	 * @var Invoice[]
	 */
    protected $invoices;
    
    /**
	 * @var Discount[]
	 */
    protected $customerDiscounts;
    
    /**
     * @var iDeal
     */
    protected $iDeal;
    /**
     * @var PayPal
     */
    protected $payPal;
    /**
     * @var SofortBanking
     */
    protected $sofortBanking;
    /**
     * @var SEPAbanktransfer
     */
    protected $sepaBanktransfer;
    
    /**
     * @var Creditcard
     */
    protected $creditcard;
                             
    /**
     * @var Bancontact
     */
    protected $bancontact;
    
    /**
     * @var bool
     */
    protected $processedOffline;

    /**
    * @var string
    */
    protected $statisticsSpecifier;
    
    /** 
	 * Create new transaction info
	 */
    public function __construct()
    {
        $this->invoices             = array();
        $this->customerDiscounts    = array();
    }
        
    /**
	 * @return int|string
	 */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
         
    /**
	 * @return int|string
	 */
    public function getTraceReference()
    {
        return $this->traceReference;
    }
        
    /**
	 * @return DateTime
	 */
    public function getLastUpdateTime()
    {
        return $this->lastUpdateTime;
    }
        
    /**
	 * @return int
	 */
    public function getAction()
    {
        return $this->action;
    }
    
	/**
	 * @return int
	 */
    public function getReservationMutationAmount()
    {
        return $this->reservationMutationAmount;
    }
    
	/**
	 * @return int
	 */
    public function getBalanceMutationAmount()
    {
        return $this->balanceMutationAmount;
    }
    
    /**
	 * @return int
	 */
    public function getStatus()
    {
        return $this->status;
    }
    
    /**
     * @return int
     */
    public function getPaymentStatus()
    {
        return $this->paymentStatus;
    }
    
    /**
     * @return string
     */
    public function getSubStatus()
    {
        return $this->subStatus;
    }
    
	/**
	 * @return int
	 */
    public function getAccountAction()
    {
        return $this->accountAction;
    }
    
	/**
     * @return int
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }
    
	/**
     * @return string
     */
    public function getPaymentMethodDescription()
    {
        return $this->paymentMethodDescription;
    }
    
    /**
	 * @return int|string
     */
    public function getRelatedPaymentReference()
    {
        return $this->relatedPaymentReference;
    }
    
    /**
     * @return int
     */
    public function getRelatedTransactionIndex()
    {
        return $this->relatedTransactionIndex;
    }
        
    /**
     * @return DateTime
     */
    public function getHostedExpirationTime()
    {
        return $this->hostedExpirationTime;
    }
        
    /**
	 * @return string
	 */
    public function getIpAddress()
    {
        return $this->ipAddress;
    }
        
    /**
	 * @return Request
	 */
    public function getRequest()
    {
        return $this->request;
    }
    
	/**
	 * @return Response
	 */
    public function getResponse()
    {
        return $this->response;
    }
            
	/**
	 * @return Order
	 */
    public function getPreviousOrder()
    {
        return $this->previousOrder;
    }
    
	/**
	 * @return Order
	 */
    public function getCurrentOrder()
    {
        return $this->currentOrder;
    }
        
    /**
	 * @return Invoice[]
	 */
    public function getInvoices()
    {
        return $this->invoices;
    }
        
    /**
	 * @return Discount[]
	 */
    public function getCustomerDiscounts()
    {
        return $this->customerDiscounts;
    }
        
    /**
     * @return bool
     */
    public function getProcessedOffline()
    {
        return $this->processedOffline;
    }
                             
    /**
     * @return string
     */
    public function getStatisticsSpecifier()
    {
        return $this->statisticsSpecifier;
    }
    
    /**
     * @return IDeal
     */
    public function getIDeal()
    {
        return $this->iDeal;
    }
    
    /**
     * @return PayPal
     */
    public function getPayPal()
    {
        return $this->payPal;
    }
    
    /**
     * @return SofortBanking
     */
    public function getSofortBanking()
    {
        return $this->sofortBanking;
    }  
    
    /**
     * @return SEPAbanktransfer
     */
    public function getSEPAbanktransfer()
    {
        return $this->sepaBanktransfer;
    }  
    
    /**
     * @return Creditcard
     */
    public function getCreditcard()
    {
        return $this->creditcard;
    }
    
    /**
     * @return Bancontact
     */
    public function getBancontact()
    {
        return $this->bancontact;
    }
    
    /**
	 * {@inheritDoc}
	 */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'lastUpdateTime':
                $this->lastUpdateTime = new DateTime($value);
                return;
            case 'hostedExpirationTime':
                $this->hostedExpirationTime = new DateTime($value);
                return;
            case 'request':
                $this->request = new Request();
                $this->request->jsonDeserialize($value);
                return;
            case 'response':
                $this->response = new Response();
                $this->response->jsonDeserialize($value);
                return;
            case 'previousOrder':
                $this->previousOrder = new Order();
                $this->previousOrder->jsonDeserialize($value);
                return;
            case 'currentOrder':
                $this->currentOrder = new Order();
                $this->currentOrder->jsonDeserialize($value);
                return;
            case 'invoices':
                // Invoices needs to an array (list of invoices)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new Invoice();
                            $item->jsonDeserialize($itemValues);
                            $this->invoices[] = $item;
                        }
                    }
                }
                return;
            case 'customerDiscounts':
                // Customer discounts needs to an array (list of discounts)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new Discount();
                            $item->jsonDeserialize($itemValues);							
                            $this->customerDiscounts[] = $item;
                        }
                    }
                }
                return;
            case 'iDeal':
                $this->iDeal = new IDeal();
                $this->iDeal->jsonDeserialize($value);
                return;
            case 'payPal':
                $this->payPal = new PayPal();
                $this->payPal->jsonDeserialize($value);
                return;
            case 'sofortBanking':
                $this->sofortBanking = new SofortBanking();
                $this->sofortBanking->jsonDeserialize($value);
                return;
            case 'sEPAbanktransfer':
                $this->sepaBanktransfer = new SEPAbanktransfer();
                $this->sepaBanktransfer->jsonDeserialize($value);
                return;
            case 'creditcard':
                $this->creditcard = new Creditcard();
                $this->creditcard->jsonDeserialize($value);
                return;
            case 'bancontact':
                $this->bancontact = new Bancontact();
                $this->bancontact->jsonDeserialize($value);
                return;
        }
		
        parent::setJsonData($name, $value);
    }
}     

Json.PaymentInfo.SplitOutpaymentInfo

Field Name Description
Currency Currency the currency of the payment that is suitable for splitoutpayment.
TotalAmountReceived The total amount available for outpayment, converted to an integer value (for example eurocents).
TotalAmountScheduledForCollection The total amount that has been scheduled for collection, converted to an integer value (for example eurocents).
TotalAmountScheduledForOutpayment The total amount that has been scheduled for outpayment, converted to an integer value (for example eurocents).
TotalAmountCollected The total amount that has been succesfully collected, converted to an integer value (for example eurocents).
TotalAmountOutpaid The total amount that has been succesfully outpaid, converted to an integer value (for example eurocents).
AmountRemainingToCollectOrOutpay The total amount that is available for collection or outpayment api calls, converted to an integer value (for example eurocents).
Balance The total remaining amount which is calculated from TotalAmountReceived minus all collects and outpayments that are processed, converted to an integer value (for example eurocents).
SplitoutpaymentDetails Collection of SplitoutpaymentDetail classes.
CollectDetails Collection of CollectDetail classes.

using Newtonsoft.Json;
using System.Collections.Generic;
using PayCheckout.Json.PaymentInfo.SplitOutpayment;

namespace PayCheckout.Json.PaymentInfo
{
	public class SplitOutpaymentInfo
	{
		[JsonProperty]
		public PayCheckout.Currency			Currency							{ get; internal set; }

		[JsonProperty]
		public int							TotalAmountReceived					{ get; internal set; }

		[JsonProperty]
		public int							TotalAmountScheduledForCollection	{ get; internal set; }
	
		[JsonProperty]
		public int							TotalAmountScheduledForOutpayment	{ get; internal set; }

		[JsonProperty]
		public int							TotalAmountCollected				{ get; internal set; }

		[JsonProperty]
		public int							TotalAmountOutpaid					{ get; internal set; }

		[JsonProperty]
		public int							AmountRemainingToCollectOrOutpay	{ get; internal set; }

		[JsonProperty]
		public int							Balance								{ get; internal set; }
		
		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public List<splitoutpaymentdetail>	SplitoutpaymentDetails		        { get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public List<collectdetail>			CollectDetails				        { get; internal set;}
	}
}

<?php

namespace PayCheckout\Json\PaymentInfo;

use PayCheckout\Json\JsonBase;
use PayCheckout\Json\PaymentInfo\SplitOutpayment\CollectDetail;
use PayCheckout\Json\PaymentInfo\SplitOutpayment\SplitOutpaymentDetail;

class SplitOutpaymentInfo extends JsonBase
{
    /**
     * @var int
     */
    protected $currency;
    
    /**
     * @var int
     */
    protected $totalAmountReceived;
    
    /**
     * @var int
     */
    protected $totalAmountScheduledForCollection;
    
    /**
     * @var int
     */
    protected $totalAmountScheduledForOutpayment;
    
    /**
     * @var int
     */
    protected $totalAmountCollected;
    
    /**
     * @var int
     */
    protected $totalAmountOutpaid;
    
    /**
     * @var int
     */
    protected $amountRemainingToCollectOrOutpay;
    
    /**
     * @var int
     */
    protected $balance;
    /**
     * @var SplitOutpaymentInfo[]
     */
    protected $splitoutpaymentDetails;
    
    /**
     * @var CollectDetail[]
     */
    protected $collectDetails;
    
    /**
     * @return integer
     */
    public function getCurrency()
    {
        return $this->currency;
    }
    
    /**
     * @return integer
     */
    public function getTotalAmountReceived()
    {
        return $this->totalAmountReceived;
    }
    
    /**
     * @return integer
     */
    public function getTotalAmountScheduledForCollection()
    {
        return $this->totalAmountScheduledForCollection;
    }
    
    /**
     * @return integer
     */
    public function getTotalAmountScheduledForOutpayment()
    {
        return $this->totalAmountScheduledForOutpayment;
    }
    
    /**
     * @return integer
     */
    public function getTotalAmountCollected()
    {
        return $this->totalAmountCollected;
    }
    
    /**
     * @return integer
     */
    public function getTotalAmountOutpaid()
    {
        return $this->totalAmountOutpaid;
    }
    
    /**
     * @return integer
     */
    public function getAmountRemainingToCollectOrOutpay()
    {
        return $this->amountRemainingToCollectOrOutpay;
    }
    
    /**
     * @return integer
     */
    public function getBalance()
    {
        return $this->balance;
    }
    
    /**
     * @return SplitOutpaymentInfo[]
     */
    public function getSplitoutpaymentDetails()
    {
        return $this->splitoutpaymentDetails;
    }
    
    /**
     * @return CollectDetail[]
     */
    public function getCollectDetails()
    {
        return $this->collectDetails;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'splitoutpaymentDetails':
                // Create an array of details
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new SplitoutpaymentDetail();
                            $item->jsonDeserialize($itemValues);
                            $this->splitoutpaymentDetails[] = $item;
                        }
                    }
                }
                return;
            case 'collectDetails':
                // Create an array of details
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new CollectDetail();
                            $item->jsonDeserialize($itemValues);							
                            $this->collectDetails[] = $item;
                        }
                    }
                }
                return;
            default:
                break;
        }
		
        parent::setJsonData($name, $value);
    }
}			

Json.PaymentInfo.SplitOutpayment.SplitoutpaymentDetails

Field Name Description
SplitOutpaymentOutpaymentReference The unique reference of this splitoutpayment action.
CreatedUTC Timestamp this outpayment request was created.
CustomerReference The customerreference that is pointing to the customer that is targeted for this outpayment.
CustomerName The Name attribute value of the customer referenced by customerreference and that is targeted for this outpayment.
BankAccountReference The BankAccountReference of the bank information that is used from the customer for this outpayment.
NameOnBankAccount The Name on the bank account as it is registered for the selected bankreference.
BICcode The BIC/Swift code of the bank account as it is registered for the selected bankreference.
BankAccount The IBAN/Bankaccount number of the bank as it is registered for the selected bankreference.
TextOnBankStatement The text as it displayed on the bankstatement of the targeted payee.
BundleKey The bundlekey used to compress outpayments to a single amount. When not specified this value is null.
Amount The amount to be outpaid, calculated as integer (example eurocents).
Currency The Currency of the outpayment.
ScheduledOutpaymentDate The requested outpayment date, the actual date is this date or the first bank working day following this date.
ActualOutpaymentDate The date that the outpayment request was send to the bank for processing, null if not processed yet
ReversedDate The date that the outpayment was reversed by the bank if applicable, null if not reversed.
CancelledUTC The timestamp the outpayment was cancelled if appliable, null if not cancelled.
TotalBundledAmount If an outpayment had a bundlekey the compressed amount that has been outpaid, calculated as integer (example eurocents). Null if not bundled.
OutpaymentBatch The batch filename as it was sent to the bank. (Displayed for communication with PayCheckout if any problems arise).
Status One of status "Pending","Paid","Cancelled","Reversed" as defined in TransactionStatus.

                         using Newtonsoft.Json;
using System;
namespace PayCheckout.Json.PaymentInfo.SplitOutpayment
{
	public class SplitOutpaymentDetail
	{
		[JsonProperty]
		public Int64				SplitOutpaymentOutpaymentReference	{ get; internal set; }

		[JsonProperty]
		public DateTime				CreatedUTC							{ get; internal set; }

		[JsonProperty]
		public Int64				CustomerReference					{ get; internal set; }

		[JsonProperty]
		public String				CustomerName						{ get; internal set; }

		[JsonProperty]
		public Int64				BankAccountReference				{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				NameOnBankAccount					{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				BICcode								{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				BankAccount							{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				TextOnBankStatement					{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				BundleKey							{ get; internal set; }
		
		[JsonProperty]
		public int					Amount								{ get; internal set; }

		[JsonProperty]
		public PayCheckout.Currency	Currency							{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			ScheduledOutpaymentDate				{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			ActualOutpaymentDate				{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			ReversedDate						{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			CancelledUTC						{ get; internal set; }

		[JsonProperty]
		public int?					TotalBundledAmount					{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				OutpaymentBatch						{ get; internal set; }

		[JsonProperty]  // Can be Pending,Cancelled,Paid or Reversed
		public TransactionStatus	Status								{ get; internal set;}
	}
}

<?php

namespace PayCheckout\Json\PaymentInfo\SplitOutpayment;

use \PayCheckout\Json\JsonBase;
use DateTime;

class SplitOutpaymentDetail extends JsonBase
{
    /**
     * @var string|int
     */
    protected $splitOutpaymentOutpaymentReference;
    
    /**
     * @var DateTime
     */
    protected $createdUTC;
    
    /**
     * @var string|int
     */
    protected $customerReference;
    
    /**
     * @var string
     */
    protected $customerName;
    
    /**
     * @var string|int
     */
    protected $bankAccountReference;
    
    /**
     * @var string
     */
    protected $nameOnBankAccount;
    
    /**
     * @var string
     */
    protected $bICcode;
    
    /**
     * @var string
     */
    protected $bankAccount;
    
    /**
     * @var string
     */
    protected $textOnBankStatement;
    
    /**
     * @var string
     */
    protected $bundleKey;
    
    /**
     * @var int
     */
    protected $amount;
    /**
     * @var int
     */
    protected $currency;
    
    /**
     * @var DateTime
     */
    protected $scheduledOutpaymentDate;
    
    /**
     * @var DateTime
     */
    protected $actualOutpaymentDate;
    
    /**
     * @var DateTime
     */
    protected $reversedDate;
    
    /**
     * @var DateTime
     */
    protected $cancelledUTC;
    
    /**
     * @var int
     */
    protected $totalBundledAmount;
    
    /**
     * @var string
     */
    protected $outpaymentBatch;
    
    /**
     * @var int
     */
    protected $status;
    
    /**
     * @return \integer|string
     */
    public function getSplitOutpaymentOutpaymentReference()
    {
        return $this->splitOutpaymentOutpaymentReference;
    }
    
    /**
     * @return DateTime
     */
    public function getCreatedUTC()
    {
        return $this->createdUTC;
    }
    
    /**
     * @return \integer|string
     */
    public function getCustomerReference()
    {
        return $this->customerReference;
    }
    
    /**
     * @return string
     */
    public function getCustomerName()
    {
        return $this->customerName;
    }
    
    /**
     * @return \integer|string
     */
    public function getBankAccountReference()
    {
        return $this->bankAccountReference;
    }
    /**
     * @return string
     */
    public function getNameOnBankAccount()
    {
        return $this->nameOnBankAccount;
    }
    
    /**
     * @return string
     */
    public function getBICcode()
    {
        return $this->bICcode;
    }
    
    /**
     * @return string
     */
    public function getBankAccount()
    {
        return $this->bankAccount;
    }
    
    /**
     * @return string
     */
    public function getTextOnBankStatement()
    {
        return $this->textOnBankStatement;
    }
    
    /**
     * @return string
     */
    public function getBundleKey()
    {
        return $this->bundleKey;
    }
    
    /**
     * @return integer
     */
    public function getAmount()
    {
        return $this->amount;
    }
    
    /**
     * @return integer
     */
    public function getCurrency()
    {
        return $this->currency;
    }
    
    /**
     * @return DateTime
     */
    public function getScheduledOutpaymentDate()
    {
        return $this->scheduledOutpaymentDate;
    }
    
    /**
     * @return DateTime
     */
    public function getActualOutpaymentDate()
    {
        return $this->actualOutpaymentDate;
    }
    
    /**
     * @return DateTime
     */
    public function getReversedDate()
    {
        return $this->reversedDate;
    }
    
    /**
     * @return DateTime
     */
    public function getCancelledUTC()
    {
        return $this->cancelledUTC;
    }
    
    /**
     * @return integer
     */
    public function getTotalBundledAmount()
    {
        return $this->totalBundledAmount;
    }
    
    /**
     * @return string
     */
    public function getOutpaymentBatch()
    {
        return $this->outpaymentBatch;
    }
    
    /**
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }
    
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'createdUTC':
                $this->createdUTC = new DateTime($value);
                return;
            case 'scheduledOutpaymentDate':
                $this->scheduledOutpaymentDate = new DateTime($value);
                return;
            case 'actualOutpaymentDate':
                $this->actualOutpaymentDate = new DateTime($value);
                return;
            case 'reversedDate':
                $this->reversedDate = new DateTime($value);
                return;
            case 'cancelledUTC':
                $this->cancelledUTC = new DateTime($value);
                return;
            default:
                break;
        }	
        parent::setJsonData($name, $value);
    }
}

Json.PaymentInfo.SplitOutpayment.CollectDetails

Field Name Description
SplitOutpaymentCollectReference The unique reference of this collect action.
CreatedUTC Timestamp this outpayment request was created.
Amount The amount to be outpaid, calculated as integer (example eurocents).
CollectDescription A free text field which hold the collectdescription as send with the api collect api call.
ScheduledCollectDate The requested collect date. The actual collect date is depending on the settings for outpayment in the portal voor the app.
ActualCollectDate The date that the request was colleced, null if not processed yet
AcutalDate The date that the collect was reversed by the bank if applicable. Reversal may occur if the collect bankaccount settings point to a bankaccount that can not receive payments, null if not reversed.
CancelledUTC The timestamp the collect request was cancelled if appliable, null if not cancelled.
TotalBundledAmount Collects are always compressed/bundled and this nummber shows the actual amount that has been outpaid, calculated as integer (example eurocents).
OutpaymentBatch The batch filename as it was sent to the bank. (Displayed for communication with PayCheckout if any problems arise).
Status One of status "Pending","Paid","Cancelled","Reversed" as defined in TransactionStatus.

using Newtonsoft.Json;
using System;
using PayCheckout;

namespace PayCheckout.Json.PaymentInfo.SplitOutpayment
{
	public class CollectDetail
	{
		[JsonProperty]
		public Int64				SplitOutpaymentCollectReference { get; internal set; }

		[JsonProperty]
		public DateTime				CreatedUTC						{ get; internal set; }
		
		[JsonProperty]
		public int					Amount							{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				CollectDescription				{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			ScheduledCollectDate			{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			ActualCollectDate				{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			ReversedDate					{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public DateTime?			CancelledUTC					{ get; internal set; }

		[JsonProperty]
		public Int32				TotalBundledAmount				{ get; internal set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String				OutpaymentBatch					{ get; internal set; }

		[JsonProperty] // Status can be Pending, Paid, Cancelled or Reversed
		public TransactionStatus	Status							{ get; internal set;}
	}
}

<?php

namespace PayCheckout\Json\PaymentInfo\SplitOutpayment;

use \PayCheckout\Json\JsonBase;
use DateTime;

class CollectDetail extends JsonBase
{
    /**
     * @var int|string
     */
    protected $splitOutpaymentCollectReference;
    
    /**
     * @var DateTime
     */
    protected $createdUTC;
    
    /**
     * @var int
     */
    protected $amount;
    
    /**
     * @var string
     */
    protected $collectDescription;
    
    /**
     * @var DateTime
     */
    protected $scheduledCollectDate;
    
    /**
     * @var DateTime
     */
    protected $actualCollectDate;
    
    /**
     * @var DateTime
     */
    protected $reversedDate;
    
    /**
     * @var DateTime
     */
    protected $cancelledUTC;
    
    /**
     * @var int
     */
    protected $status;
    
    /**
     * @return \integer|string
     */
    function getSplitOutpaymentCollectReference()
    {
        return $this->splitOutpaymentCollectReference;
    }
    
    /**
     * @return DateTime
     */
    function getCreatedUTC()
    {
        return $this->createdUTC;
    }
    
    /**
     * @return integer
     */
    function getAmount()
    {
        return $this->amount;
    }
    
    /**
     * @return string
     */
    function getCollectDescription()
    {
        return $this->collectDescription;
    }
    
    /**
     * @return DateTime
     */
    function getScheduledCollectDate()
    {
        return $this->scheduledCollectDate;
    }
    
    /**
     * @return DateTime
     */
    function getActualCollectDate()
    {
        return $this->actualCollectDate;
    }
    
    /**
     * @return DateTime
     */
    function getReversedDate()
    {
        return $this->reversedDate;
    }
    
    /**
     * @return DateTime
     */
    function getCancelledUTC()
    {
        return $this->cancelledUTC;
    }
    
    /**
     * @return integer
     */
    function getStatus()
    {
        return $this->Status;
    }
    
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'createdUTC':
                $this->createdUTC = new DateTime($value);
                return;
            case 'scheduledCollectDate':
                $this->scheduledCollectDate = new DateTime($value);
                return;
            case 'actualCollectDate':
                $this->actualCollectDate = new DateTime($value);
                return;
            case 'reversedDate':
                $this->reversedDate = new DateTime($value);
                return;
            case 'cancelledUTC':
                $this->cancelledUTC = new DateTime($value);
                return;
            default:
                break;
        }	
        parent::setJsonData($name, $value);
    }
}

Json.Request.Request

Field Name Description
Transaction Contains a Transaction class or "null".
Order Contains an order class or "null"
PaymentReference If the transaction needs to reference another payment the refererence to indicate this can be placed here. Might be "null"
Parameters A generic json class that can contain necessary parameters for the wanted transaction. Can be "null"

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Request
{
	public class Request
	{
		public Request()
		{
		}

		public Request(Transaction.Transaction transaction)
		{
			Transaction	= transaction;
		}

		#region Json
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Transaction.Transaction Transaction { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Generic.Order.Order  Order { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64? PaymentReference { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Newtonsoft.Json.Linq.JObject Parameters { get; set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Request;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Request\Transaction\Transaction;
use PayCheckout\Json\Generic\Order\Order;

class Request extends JsonBase
{
    /**
     * @var Transaction|null
     */
    protected $transaction;
    
    /**
     * @var Order|null
     */
    protected $order;
    
    /**
     * @var string
     */
    protected $paymentReference;
    
    /**
     * @var mixed
     */
    protected $parameters;
    
    /**
     * Create new request with the given parameters
     * 
     * @param Transaction|null $transaction
     * @param Order|null $order
     * @param string $paymentReference
     * @param mixed $parameters 
     */
    public function __construct(Transaction $transaction = null, Order $order = null, $paymentReference = null, $parameters = null)
    {
        $this->transaction      = $transaction;
        $this->order            = $order;
        $this->paymentReference = $paymentReference;
        $this->parameters       = $parameters;
    }
    
    /**
     * @return Transaction|null
     */
    public function getTransaction()
    {
        return $this->transaction;
    }

    /**
     * @param Transaction|null $transaction
     */
    public function setTransaction(Transaction $transaction = null)
    {
        $this->transaction = $transaction;
    }
    
    /**
     * @return Order|null
     */
    public function getOrder()
    {
        return $this->order;
    }

    /**
     * @param Order|null $order
     */
    public function setOrder(Order $order = null)
    {
        $this->order = $order;
    }
    
    /**
     * @return string
     */
    public function getPaymentReference()
    {
        return $this->paymentReference;
    }

    /**
     * @param string $paymentReference
     */
    public function setPaymentReference($paymentReference)
    {
        $this->paymentReference = $paymentReference;
    }

    /**
     * @return mixed
     */
    public function getParameters()
    {
        return $this->parameters;
    }

    /**
     * @param mixed $parameters
     */
    public function setParameters($parameters)
    {
        $this->parameters = $parameters;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'transaction':
                    $this->transaction = new Transaction();
                    $this->transaction->jsonDeserialize($value);
                    break;
                case 'order':
                    $this->order = new Order();
                    $this->order->jsonDeserialize($value);
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
			

Json.Request.Transaction.Transaction

Field Name Description
PaymentMethod Contains "null" or a PaymentMethod.
Currency Contains "null" or a Currency to use in this transaction.
Amount Contains "null" or the transaction amount for this transaction. The amount is converted, according to the currency, to an integer value.
PaymentCostInclVat Contains "null" or the payment cost inclusive VAT for this transaction. The payment cost is converted, according to the currency, to an integer value.
PaymentCostExclVat Contains "null" or the payment cost exclusive VAT for this transaction. The payment cost is converted, according to the currency, to an integer value.
PaymentCostVatDisplayPercentage Contains "null" or the VAT percentage * 100 to display where and if the VAT percentage is shown.
MerchantOrderReference Contains "null" or the order reference supplied by the caller of a payment.
Description Contains "null" or the order description supplied by the caller of a payment.
CustomerIpAddress Contains "null" or the cusomer's IP address.
ConfiguredCultureOverride Contains "null" or the supplied culture override string. If supplied a string looks like "en-US" etc.
ReturnUrlSuccessOverride Contains "null" or the return URL for a successful payment to override the default.
ReturnUrlCancelledOverride Contains "null" or the return URL for a cancelled payment to override the default.
ReturnUrlFailedOverride Contains "null" or the return URL for a failed payment to override the default.
NotificationUrlOverride When "null" the configured notificationUrl will be used, when set this url will be used as the notificationurl for this payment.
HostedMethods Contains "null" or the supplied list of hosted methods requested to present to the user. After validation the actual number of methods shown to the user can be less than requested if limits are hit.
IDeal Contains "null" or an IDeal class that specifies iDEAL specific information
Klarna Contains "null" or a Klarna class that specifies klarna specific information.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Request.Transaction
{
	public class Transaction
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PaymentMethod? PaymentMethod { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Currency? Currency { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? Amount { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentCostInclVat { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentCostExclVat { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentCostVatDisplayPercentage { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String  MerchantOrderReference { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String  Description { get; set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String  CustomerIpAddress { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String  ConfiguredCultureOverride { get; set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ReturnUrlSuccessOverride { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ReturnUrlCancelledOverride { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ReturnUrlFailedOverride { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String NotificationUrlOverride { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<PaymentMethod> HostedMethods { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public IDeal IDeal { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Klarna Klarna { get; set; }
	
		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Request\Transaction;
use DateTime;
use PayCheckout\Json\Generic\Order\Identity\Address;
use PayCheckout\Json\Generic\Order\Identity\Identity;
use PayCheckout\Json\Generic\Order\Item\Item;
use PayCheckout\Json\Generic\Order\Order;
use PayCheckout\Json\JsonBase;

class Transaction extends JsonBase
{
    /**
     * @var int
     */
    protected $paymentMethod;
    
    /**
     * @var int
     */
    protected $currency;
    
    /**
     * @var int
     */
    protected $amount;
	
    /**
     * @var int
     */
    protected $paymentCostInclVat;

    /**
     * @var int
     */
    protected $paymentCostExclVat;
	
    /**
     * @var int
     */
    protected $paymentCostVatDisplayPercentage;
    
    /**
     * @var string
     */
    protected $merchantOrderReference;
    
    /**
     * @var string
     */
    protected $description;

    /**
     * @var string
     */
    protected $customerIpAddress;
    
    /**
     * @var string
     */
    protected $configuredCultureOverride;
    
    /**
     * @var string
     */
    protected $returnUrlSuccessOverride;

    /**
     * @var string
     */
    protected $returnUrlCancelledOverride;
    
    /**
     * @var string
     */
    protected $returnUrlFailedOverride;
	
    /**
     * @var string
     */
    protected $notificationUrlOverride;

    /**
     * @var int[]|null
     */
    protected $hostedMethods;
    
    /**
     * @var IDeal
     */
    protected $iDeal;
    
    /**
     * @var Klarna
     */
    protected $klarna;
    
    /**
     * Create new payment request
     * 
     * @param int $paymentMethod 
     * @param int $currency 
     * @param int $amount 
     * @param string $merchantOrderReference 
     * @param string $description 
     * @param string $configuredCultureOverride
     * @param array|null $hostedMethods 
     */
    public function __construct($paymentMethod = null, $currency = null, $amount = null, $merchantOrderReference = null, $description = null, $customerIpAddress = null, $configuredCultureOverride = null, array $hostedMethods = null)
    {
        $this->paymentMethod                = $paymentMethod;
        $this->currency                     = $currency;
        $this->amount                       = $amount;
        $this->merchantOrderReference       = $merchantOrderReference;
        $this->description                  = $description;
        $this->customerIpAddress            = $customerIpAddress;
        $this->configuredCultureOverride    = $configuredCultureOverride;
        $this->hostedMethods                = $hostedMethods;
    }
        
    /**
     * @return int
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }
    
    /**
     * @param int $paymentMethod
     */
    public function setPaymentMethod($paymentMethod)
    {
        $this->paymentMethod = $paymentMethod;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }
    
    /**
     * @param int $currency
     */
    public function setCurrency($currency)
    {
        $this->currency = $currency;
    }
    
    /**
     * @return int
     */
    public function getAmount()
    {
        return $this->amount;
    }
    
    /**
     * @param int $amount
     */
    public function setAmount($amount)
    {
        $this->amount = $amount;
    }
    	
    /**
     * @return int
     */
    public function getPaymentCostInclVat()
    {
        return $this->paymentCostInclVat;
    }
    
    /**
     * @param int $paymentCostInclVat
     */
    public function setPaymentCostInclVat($paymentCostInclVat)
    {
        $this->paymentCostInclVat = $paymentCostInclVat;
    }

    /**
     * @return int
     */
    public function getPaymentCostExclVat()
    {
        return $this->paymentCostExclVat;
    }
    
    /**
     * @param int $paymentCostExclVat
     */
    public function setPaymentCostExclVat($paymentCostExclVat)
    {
        $this->paymentCostExclVat = $paymentCostExclVat;
    }
    	
    /**
     * @return int
     */
    public function getPaymentCostVatDisplayPercentage()
    {
        return $this->paymentCostVatDisplayPercentage;
    }
    
    /**
     * @param int $paymentCostInclusiveVat
     */
    public function setPaymentCostVatDisplayPercentage($paymentCostVatDisplayPercentage)
    {
        $this->paymentCostVatDisplayPercentage = $paymentCostVatDisplayPercentage;
    }
    
    /**
     * @return string
     */
    public function getMerchantOrderReference()
    {
        return $this->merchantOrderReference;
    }
    
    /**
     * @param string $merchantOrderReference
     */
    public function setMerchantOrderReference($merchantOrderReference)
    {
        $this->merchantOrderReference = $merchantOrderReference;
    }
    
    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }
    
    /**
     * @param string $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }
    
    /**
     * @return int[]|null
     */
    public function getHostedMethods()
    {
        return $this->hostedMethods;
    }
    
    /**
     * @param int[]|null $hostedMethods
     */
    public function setHostedMethods(array $hostedMethods = null)
    {
        $this->hostedMethods = $hostedMethods;
    }

    /**
     * @return string
     */
    public function getCustomerIpAddress()
    {
        return $this->customerIpAddress;
    }
    
    /**
     * @return string
     */
    public function getConfiguredCultureOverride()
    {
        return $this->configuredCultureOverride;
    }
    
    /**
     * @param string $configuredCultureOverride
     */
    public function setConfiguredCultureOverride($configuredCultureOverride)
    {
        $this->configuredCultureOverride = $configuredCultureOverride;
    }

    /**
     * @return string
     */
    public function getReturnUrlSuccessOverride()
    {
        $this->returnUrlSuccessOverride;
    }
    
    /**
     * @return string
     */
    public function getReturnUrlCancelledOverride()
    {
        $this->returnUrlCancelledOverride;
    }
        
    /**
     * @return string
     */
    public function getReturnUrlFailedOverride()
    {
        $this->returnUrlFailedOverride;
    }
    
    /**
     * Summary of setReturnUrlsOverride
     * @param string $returnUrlSuccessOverride 
     * @param string $returnUrlCancelledOverride 
     * @param string $returnUrlFailedOverride 
     */
    public function setReturnUrlsOverride($returnUrlSuccessOverride, $returnUrlCancelledOverride, $returnUrlFailedOverride)
    {
        $this->returnUrlSuccessOverride     = $returnUrlSuccessOverride;
        $this->returnUrlCancelledOverride   = $returnUrlCancelledOverride;
        $this->returnUrlFailedOverride      = $returnUrlFailedOverride;
    }
					 						    
    /**
     * @return string
     */
    public function getNotificationUrlOverride()
    {
        $this->notificationUrlOverride;
    }
    
    /**
     * @param string $notificationUrlOverride 
     */
    public function setNotificationUrlOverride($notificationUrlOverride)
    {
        $this->notificationUrlOverride = $notificationUrlOverride;
    }  

    /**
     * @return IDeal
     */
    public function getIDeal()
    {
        return $this->iDeal;
    }
    
    /**
     * @param IDeal $iDeal
     */
    public function setIDeal(IDeal $iDeal)
    {
        $this->iDeal = $iDeal;
    }
    
    /**
     * @return Klarna
     */
    public function getKlarna()
    {
        return $this->klarna;
    }
    
    /**
     * @param Klarna $klarna
     */
    public function setKlarna(Klarna $klarna)
    {
        $this->klarna = $klarna;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'iDeal':
                    $this->iDeal = new IDeal();
                    $this->iDeal->jsonDeserialize($value);
                    break;
                case 'klarna':
                    $this->klarna = new Klarna();
                    $this->klarna->jsonDeserialize($value);
                    break;
                case 'order':
                    $this->order = new Order();
                    $this->order->jsonDeserialize($value);
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
			

Json.Request.Transaction.IDeal

Field Name Description
IssuingBank Contains the BIC code of the bank to use in an iDEAL payment. Use the service call IDealGetDirectory to retrieve a list of available BIC codes.

using Newtonsoft.Json;
namespace PayCheckout.Json.Request.Transaction
{
	public class IDeal
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string IssuingBank { get; set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Request\Transaction;
use PayCheckout\Json\JsonBase;

class IDeal extends JsonBase
{
    /**
     * @var string
     */
    protected $issuingBank;
    
    /**
     * Create new iDEAL request
     * 
     * @param string $issuingBank 
     */
    public function __construct($issuingBank = null)
    {
        $this->issuingBank = $issuingBank;
    }
    
    /**
     * @return string
     */
    public function getIssuingBank()
    {
        return $this->issuingBank;
    }
    /**
     * @param string $issuingBank
     */
    public function setIssueingBank($issuingBank)
    {
        $this->issuingBank = $issuingBank;
    }
}
			

Json.Request.Transaction.Klarna

Field Name Description
PClassId If this value is "null" or -1 then KlarnaInvoice is selected, else the PClassId represents a Klarna campaign number.

using Newtonsoft.Json;
using System;
namespace PayCheckout.Json.Request.Transaction
{
	public class Klarna
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PClassId { get; set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Request\Transaction;
use PayCheckout\Json\JsonBase;

class Klarna extends JsonBase
{
    /**
     * @var int
     */
    protected $pClassId;
    
    /**
     * Create new Klarna request
     * 
     * @param int $pClassId 
     */
    public function __construct($pClassId = null)
    {
        $this->pClassId = $pClassId;
    }
    
    /**
     * @return int
     */
    public function getPClassId()
    {
        return $this->pClassId;
    }
    
    /**
     * @param int $pClassId
     */
    public function setPClassId($pClassId)
    {
        $this->pClassId = $pClassId;
    }
}			

Json.Parameter.RefundCost

Field Name Description Limits
CostName Name of the cost. May not contain control characters or tags
CostDescription Description of the cost. May not contain control characters or tags
CostExclusiveVat The cost excluding VAT. Value is converted from amount and currency into an integer. A negative value is allowed and indicates a refund amount. Limits: -21474863648 till 21474863647. Amount must be related to AmountInclVat and VatDisplayPercentage.
CostInclusiveVat The cost including VAT. Value is converted from amount and currency into an integer. A negative value is allowed and indicates a refund amount. Limits: -21474863648 till 21474863647. If this is null, VatDisplayPercentage must also be null.
VatDisplayPercentage Must be in accordance with the amounts supplied otherwise validation will fail. Integer between 1 and 9900. MultiplyFactor = 100, example: 2100 implies 21.00% . If this is null, CostInclusiveVat must also be null.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Parameter
{
	public class RefundCost
	{
		#region Json

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string CostName {  get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string CostDescription {  get; set; }

		[JsonProperty]
		public Int32 CostExclusiveVat { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? CostInclusiveVat { get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? VatDisplayPercentage { get; set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Parameter;
use PayCheckout\Json\JsonBase;

class RefundCost extends JsonBase
{
    /**
     * @var string
     */
    protected $costName;
    
    /**
     * @var string
     */
    protected $costDescription;
    
    /**
     * @var int
     */
    protected $costExclusiveVat;
    
    /**
     * @var int
     */
    protected $costInclusiveVat;
    
    /**
     * @var int
     */
    protected $vatDisplayPercentage;
    
    /**
     * @return string
     */
    public function getCostName()
    {
        return $this->costName;
    }
    
    /**
     * @param string $costName 
     */
    public function setCostName($costName)
    {
        $this->costName = $costName;
    }
    
    /**
     * @return string
     */
    public function getCostDescription()
    {
        return $this->costDescription;
    }
    
    /**
     * @param string $costDescription
     */
    public function setCostDescription($costDescription)
    {
        $this->costDescription = $costDescription;
    }
    
    /**
     * @return int
     */
    public function getCostExclusiveVat()
    {
        return $this->costExclusiveVat;
    }
    
    /**
     * @param int $costExclusiveVat
     */
    public function setCostExclusiveVat($costExclusiveVat)
    {
        $this->costExclusiveVat = $costExclusiveVat;
    }
    
    /**
     * @return int
     */
    public function getCostInclusiveVat()
    {
        return $this->costInclusiveVat;
    }
    
    /**
     * @param int $costInclusiveVat
     */
    public function setCostInclusiveVat($costInclusiveVat)
    {
        $this->costInclusiveVat = $costInclusiveVat;
    }
    
    /**
     * @return int
     */
    public function getVatDisplayPercentage()
    {
        return $this->vatDisplayPercentage;
    }
    
    /**
     * @param int $vatDisplayPercentage
     */
    public function setVatDisplayPercentage($vatDisplayPercentage)
    {
        $this->vatDisplayPercentage = $vatDisplayPercentage;
    }
}
			

Json.Response.Response

Field Name Description
ApiResult The ApiResult of this action
ActionPerformed The ApiAction performed or "null" when not clear what action is involved.
TraceReference If not "null", the saved trace of this action. (Can be viewed in the portal)
PaymentReference The generated payment reference or "null" if no payment reference is generated. (PaymentReference can be viewed or searched for in the portal)
TransactionReference The generated transaction reference or "null" if no transaction reference is generated. (TransactionReference can be viewed or searched for in the portal)
ErrorCode The ErrorCode if ApiResult indicates the action has failed. On success the value will be "null".
Errors List of strings containing the encountered errors. Can be "null" when no errors were encountered.
Warnings List of strings containing the encountered warnings. Can be "null" when no warnings were encountered.
ErrorToShowToConsumer If this field is not "null" this field contains a string that should be shown to the consumer using the transaction system. For iDEAL and Klarna it is a requirement to handle this correctly for certification.
RedirectInfo Is "null" or contains a valid URL to redirect to.
TransactionResult Contains a TransactionResult class if the API call was a payment or else it is "null".
ApiReturnValues (Not intented for direct use, extraction functions exist to extract return relevant values)

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Response
{
	public class Response
	{
		#region Json

		[JsonProperty]
		public ApiResult ApiResult { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public ApiAction? ActionPerformed { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64? TraceReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64? PaymentReference { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64? TransactionReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public ErrorCode? ErrorCode { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<String> Errors { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<string> Warnings { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String ErrorToShowToConsumer { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String RedirectInfo { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public TransactionResult TransactionResult { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		internal Newtonsoft.Json.Linq.JObject ApiReturnValues { get; set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Response;
use PayCheckout\ApiResult;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Request\Transaction;
use PayCheckout\Json\Generic\Order;
use PayCheckout\Json\Response\TransactionResult;
use PayCheckout\Json\Generic\PaymentCost\PaymentCost;
use stdClass;

class Response extends JsonBase
{
    /**
     * @var int
     */
    protected $apiResult;
    
    /**
     * @var int
     */
    protected $actionPerformed;
    
    /**
     * @var string
     */
    protected $traceReference;
    
    /**
     * @var string
     */
    protected $paymentReference;
    
    /**
     * @var string
     */
    protected $transactionReference;
    
    /**
     * @var int
     */
    protected $errorCode;
    
    /**
     * @var string[]
     */
    protected $errors;
    
    /**
     * @var string[]
     */
    protected $warnings;
    
    /**
     * @var string
     */
    protected $errorToShowToConsumer;
    
    /**
     * @var string
     */
    protected $redirectInfo;
    
    /**
     * @var TransactionResult
     */
    protected $transactionResult;
    
    /**
     * @var mixed
     */
    protected $apiReturnValues;
    
    /**
     * Create new response
     * 
     * @param int $apiResult 
     * @param int $errorCode 
     * @param array $errors 
     */
    public function __construct($apiResult = null, $errorCode = null, array $errors = array())
    {
        $this->apiResult    = $apiResult;
        $this->errorCode    = $errorCode;
        $this->errors       = $errors;
        $this->warnings     = array();
    }
    
    /**
     * @return int
     */
    public function getApiResult()
    {
        return $this->apiResult;
    }
    
    /**
     * @param int $apiResult
     */
    public function setApiResult($apiResult)
    {
        $this->apiResult = $apiResult;
    }
    
    /**
     * @return int
     */
    public function getActionPerformed()
    {
        return $this->actionPerformed;
    }
    
    /**
     * @param int $actionPerformed 
     */
    public function setActionPerformed($actionPerformed)
    {
        $this->actionPerformed = $actionPerformed;
    }
    
    /**
     * @return string
     */
    public function getTraceReference()
    {
        return $this->traceReference;
    }
    
    /**
     * @param string $traceReference
     */
    public function setTraceReference($traceReference)
    {
        $this->traceReference = $traceReference;
    }
    
    /**
     * @return string
     */
    public function getPaymentReference()
    {
        return $this->paymentReference;
    }
    
    /**
     * @param string $paymentReference
     */
    public function setPaymentReference($paymentReference)
    {
        $this->paymentReference = $paymentReference;
    }

    /**
     * @return string
     */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
    
    /**
     * @return int
     */
    public function getErrorCode()
    {
        return $this->errorCode;
    }
    
    /**
     * @param int $errorCode
     */
    public function setErrorCode($errorCode)
    {
        $this->errorCode = $errorCode;
    }
    
    /**
     * @return string[]
     */
    public function getErrors()
    {
        return $this->errors;
    }
    
    /**
     * @param string[] $errors
     */
    public function setErrors(array $errors)
    {
        $this->errors = $errors;
    }
	
    /**
     * Add an error
     * 
     * @param string $error 
     * @param array|null $args 
     */
    public function AddError($error, array $args = null)
    {
        if ($args == null)
        {
            $this->errors[] = $error;
        }
        else
        {
            $this->errors[] = sprintf($error, $args);
        }
	}
    
    /**
     * @return string[]
     */
    public function getWarnings()
    {
        return $this->warnings;
    }
    
    /**
     * @param string[] $warnings
     */
    public function setWarnings(array $warnings)
    {
        $this->warnings = $warnings;
    }
	
    /**
     * Add a warning
     * 
     * @param string $error 
     * @param array|null $args 
     */
    public function AddWarning($error, array $args = null)
    {
        if ($args == null)
        {
            $this->errors[] = $error;
        }
        else
        {
            $this->errors[] = sprintf($error, $args);
        }
    }

    /**
     * @return string
     */
    public function getErrorToShowToConsumer()
    {
        return $this->errorToShowToConsumer;
    }
    
    /**
     * @param string $errorToShowToConsumer
     */
    public function setErrorToShowToConsumer($errorToShowToConsumer)
    {
        $this->errorToShowToConsumer = $errorToShowToConsumer;
    }
    
    /**
     * @return string
     */
    public function getRedirectInfo()
    {
        return $this->redirectInfo;
    }
    
    /**
     * @param string $redirectInfo
     */
    public function setRedirectInfo($redirectInfo)
    {
        $this->redirectInfo = $redirectInfo;
    }
    
    /**
     * @return TransactionResult
     */
    public function getTransactionResult()
    {
        return $this->transactionResult;
    }
    
    /**
     * @param TransactionResult $transactionResult
     */
    public function setTransactionResult(TransactionResult $transactionResult)
    {
        $this->transactionResult = $transactionResult;
    }
    
    /**
     * @return mixed
     */
    public function getApiReturnValues()
    {
        return $this->apiReturnValues;
    }
    
    /**
     * @param mixed $apiReturnValues
     */
    public function setApiReturnValues($apiReturnValues)
    {
        $this->apiReturnValues = $apiReturnValues;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'transactionResult':
                    $this->transactionResult = new TransactionResult();
                    $this->transactionResult->jsonDeserialize($value);
                    break;
                case 'paymentCost':
                    $this->paymentCost = new PaymentCost();
                    $this->paymentCost->jsonDeserialize($value);
                    break;
                case 'apiReturnValues':
                    $this->setApiReturnValues($value);
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
			

Json.Response.Result

Field Name Description
ApiResult The ApiResult of this action
ActionPerformed The ApiAction performed or "null" when not clear what action is involved.
TraceReference If not "null", the saved trace of this action. (Can be viewed in the portal)
ErrorCode The ErrorCode if ApiResult indicates the action has failed. On success the value will be "null".
Errors List of strings containing the encountered errors. Can be "null" when no errors were encountered.
Warnings List of strings containing the encountered warnings. Can be "null" when no warnings were encountered.
ApiReturnValues (Not intented for direct use, extraction functions exist to extract return relevant values)

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Response
{
	public class Response
	{
		#region Json

		[JsonProperty]
		public ApiResult ApiResult { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public ApiAction? ActionPerformed { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64? TraceReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public ErrorCode? ErrorCode { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<String> Errors { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<string> Warnings { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		internal Newtonsoft.Json.Linq.JObject ApiReturnValues { get; set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Response;
use PayCheckout\ApiResult;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Request\Transaction;
use PayCheckout\Json\Generic\Order;
use PayCheckout\Json\Response\TransactionResult;
use PayCheckout\Json\Generic\PaymentCost\PaymentCost;
use stdClass;

class Response extends JsonBase
{
    /**
     * @var int
     */
    protected $apiResult;
    
    /**
     * @var int
     */
    protected $actionPerformed;
    
    /**
     * @var string
     */
    protected $traceReference;
         
    /**
     * @var int
     */
    protected $errorCode;
    
    /**
     * @var string[]
     */
    protected $errors;
    
    /**
     * @var string[]
     */
    protected $warnings;
    
    /**
     * @var mixed
     */
    protected $apiReturnValues;
    
    /**
     * Create new response
     * 
     * @param int $apiResult 
     * @param int $errorCode 
     * @param array $errors 
     */
    protected function __construct($apiResult = null, $errorCode = null, array $errors = array())
    {
        $this->apiResult    = $apiResult;
        $this->errorCode    = $errorCode;
        $this->errors       = $errors;
        $this->warnings     = array();
    }
    
    /**
     * @return int
     */
    public function getApiResult()
    {
        return $this->apiResult;
    }
    
    /**
     * @param int $apiResult
     */
    public function setApiResult($apiResult)
    {
        $this->apiResult = $apiResult;
    }
    
    /**
     * @return int
     */
    public function getActionPerformed()
    {
        return $this->actionPerformed;
    }
       
    /**
     * @return string
     */
    public function getTraceReference()
    {
        return $this->traceReference;
    }
        
    /**
     * @return int
     */
    public function getErrorCode()
    {
        return $this->errorCode;
    }
        
    /**
     * @return string[]
     */
    public function getErrors()
    {
        return $this->errors;
    }
    	    
    /**
     * @return string[]
     */
    public function getWarnings()
    {
        return $this->warnings;
    }   
    
    /**
     * @return mixed
     */
    public function getApiReturnValues()
    {
        return $this->apiReturnValues;
    }
       
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'apiReturnValues':
                    $this->apiReturnValues = $value;
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
			

Json.Response.TransactionResult

Field Name Description
TransactionReference The transaction reference of the Transaction that has been performed.
Status The TransactionStatus of this transaction.
PaymentMethodReporting The PaymentMethod that this transaction is about or "null" if this transaction is not about a payment.
Klarna Contains a Klarna class if Klarna data is available else it will contain "null".
PayPal Contains a PayPal class if PayPal data is available else it will contain "null".
SofortBanking Contains a Sofort class if Sofort banking data is available else it will contain "null".

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Response
{
	public class TransactionResult
	{
		#region Json

		[JsonProperty]
		public Int64 TransactionReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PayCheckout.TransactionStatus? Status { get; internal set; }
		
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PaymentMethod? PaymentMethodReporting { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Json.Generic.PaymentSpecific.Klarna Klarna { get; internal set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Json.Generic.PaymentSpecific.PayPal PayPal { get; internal set; }

   		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Json.Generic.PaymentSpecific.SofortBanking SofortBanking { get; internal set; }

		#endregion
	}
}

<?php
 
namespace PayCheckout\Json\Response;

use PayCheckout\Json\Generic\PaymentSpecific\Klarna;
use PayCheckout\Json\Generic\PaymentSpecific\PayPal;
use PayCheckout\Json\Generic\PaymentSpecific\SofortBanking;
use PayCheckout\Json\JsonBase;

class TransactionResult extends JsonBase
{
    /**
     * @var string
     */
    protected $transactionReference;
    
    /**
     * @var int
     */
    protected $status;
    
    /**
     * @var int|null
     */
    protected $paymentMethodReporting;
    
    /**
     * @var Klarna
     */
    protected $klarna;
        
    /**
     * @var PayPal
     */
    protected $paypal;
    
    /**
     * @var SofortBanking
     */
    protected $sofortBanking;
    
    /**
     * @return string
     */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
    
    /**
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }
       
    /**
     * @return int
     */
    public function getPaymentMethodReporting()
    {
        return $this->paymentMethodReporting;
    }
    
    /**
     * @return Klarna
     */
    public function getKlarna()
    {
        return $this->klarna;
    }
    
    /**
     * @return PayPal
     */
    public function getPayPal()
    {
        return $this->paypal;
    }
    
    /**
     * @return SofortBanking
     */
    public function getSofortBanking()
    {
        return $this->sofortBanking;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'klarna':
                    $this->klarna = new Klarna();
                    $this->klarna->jsonDeserialize($value);
                    break;
                case 'payPal':
                    $this->paypal = new PayPal();
                    $this->paypal->jsonDeserialize($value);
                    break;
                case 'sofortBanking':
                    $this->sofortBanking = new SofortBanking();
                    $this->sofortBanking->jsonDeserialize($value);
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
                 

Json.Mandate.MandateHistory

Field Name Description
CreateTimeUTC The time this history entry was created in UTC.
ApiAction One of the enum ApiActions.
MandateStatus One of the enum MandateStatuses.
Remark String describing the action that was performed.
TransactionId The transactionId, given by the issuing bank, that is used to identify this action on the mandate.
TraceReference TraceReference where the history action can be viewed.
IncassoInfo If present the MandateIncassoInfo that has been returned by the Bank
MandateRequest If present the MandateRequest thas has been used to do the ApiAction.
Request If present the Request that was executed.
Response The Response that was returned when the apiaction was executed.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Mandate
{
	public class MandateHistory
	{
		public MandateHistory(	DateTime									createTimeUTC,
								PayCheckout.ApiAction						apiAction,
								PayCheckout.MandateStatus					status,
								String										remark,
								String										transactionId,
								Int64										transactionReference,
								Int64										traceReference,
								PayCheckout.Json.Mandate.MandateIncassoInfo incassoInfo,
								PayCheckout.Json.Mandate.MandateRequest		mandateRequest,
								PayCheckout.Json.Request.Request			request,
								PayCheckout.Json.Response.Response			response)
		{
			CreateTimeUTC			= createTimeUTC;
			ApiAction				= apiAction;
			Status					= status;
			Remark					= remark;
			TransactionId			= transactionId;
			TransactionReference	= transactionReference;
			TraceReference			= traceReference;
			IncassoInfo				= incassoInfo;
			MandateRequest			= mandateRequest;
			Request					= request;
			Response				= response;
		}

		[JsonProperty]
		public DateTime CreateTimeUTC { get; private set; }

		[JsonProperty]
		public PayCheckout.ApiAction ApiAction { get; private set;}

		[JsonProperty]
		public PayCheckout.MandateStatus Status	{ get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String Remark { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String TransactionId	{ get; private set; }

		[JsonProperty]
		public Int64 TransactionReference { get; private set; }

		[JsonProperty]
		public Int64 TraceReference	{ get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public PayCheckout.Json.Mandate.MandateIncassoInfo IncassoInfo {get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public PayCheckout.Json.Mandate.MandateRequest MandateRequest { get; private set; }

		// Request
		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public PayCheckout.Json.Request.Request Request { get; private set;}

		// Response
		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public PayCheckout.Json.Response.Response Response { get; private set;}
	}
}

<?php

namespace PayCheckout\Json\Mandate;

use DateTime;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Mandate\MandateIncassoInfo;
use PayCheckout\Json\Mandate\MandateRequest;
use PayCheckout\Json\Response\Response;
use PayCheckout\Json\Request\Request;
use PayCheckout\MandateStatus;

class MandateHistory extends JsonBase
{
    /**
    * @var DateTime
    */
    protected $createTimeUTC;
    
    /**
    * @var PayCheckout\ApiAction
    */
    protected $apiAction;
    
    /**
    * @var PayCheckout\MandateStatus
    */
    protected $status;
        
    /**
     * @var string
     */
    protected $remark;
    
    /**
     * @var string
     */   
	protected $transactionId;
    
    /**
     * @var string
    */
    protected $transactionReference;
    
    /**
     * @var string
     */
    protected $traceReference;
    
    /**
     * @var MandateIncassoInfo
     */
    protected $incassoInfo;
    
    /**
     * @var MandateRequest
     */
	protected $mandateRequest;
    
    /**
	 * @var Request
     */
    protected $request;
    
    /**
     * @var Response
     */
	protected $response;
    
    // Getters
    
    /**
     * @return DateTime
     */
    public function getCreateTimeUTC()
    {
        return $this->createTimeUTC;
    }
    
    /**
     * @return PayCheckout\ApiAction
     */
    public function getApiAction()
    {
        return $this->apiAction;
    }
    
    /**
     * @return PayCheckout\MandateStatus
     */
    public function getStatus()
    {
        return $this->status;
    }
    
    /**
     * @return string
     */
    public function getRemark()
    {
        return $this->remark;
    }
    
    /**
     * @return string
     */
    public function getTransactionId()
    {
        return $this->transactionId;
    }
    
    /**
     * @return string
     */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
    
    /**
     * @return string
     */
    public function getTraceReference()
    {
        return $this->traceReference;
    }
    
    /**
     * @return PayCheckout\Json\Mandate\MandateIncassoInfo
     */
    public function getIncassoInfo()
    {
        return $this->incassoInfo;
    }
    
    /**
     * @return PayCheckout\Api\Mandates\MandateRequest
     */
    public function getMandateRequest()
    {
        return $this->mandateRequest;
    }
    
    /**
     * @return PayCheckout\Json\Request\Request
     */
    public function getRequest()
    {
        return $this->request;
    }
    
    /**
     * @return PayCheckout\Json\Response\Response
     */
    public function getResponse()
    {
        return $this->response;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {        
        switch($name)
        {
            case 'createTime':
                $this->createTimeUTC = new DateTime($value);
                return;
            case 'incassoInfo':
                $this->incassoInfo = new MandateIncassoInfo();
                $this->incassoInfo->jsonDeserialize($value);
                return;
            case 'mandateRequest':
                $this->mandateRequest = new MandateRequest();
                $this->mandateRequest->jsonDeserialize($value);
                return;
            case 'request':
                $this->request = new Request();
                $this->request->jsonDeserialize($value);
                return;
            case 'response':
                $this->response = new Response();
                $this->response->jsonDeserialize($value);
                return;
        }	
        parent::setJsonData($name, $value);
    }
}
						

Json.Mandate.MandateIncassoInfo

Field Name Description
MandateId The mandateId (Machtigingskenmerk).
SignatureLocalDateTime Timestamp (local time of bank) that the mandate was signed.
DebtorBIC The BIC code of the bank that will be targeted for direct debit requests.
DebtorIBAN The IBAN account that will be targeted for direct debit requests.
DebtorAccountName The name on the bank account that will be targeted for direct debit requests.
DebtorAddressLine1 If present will show street and housenumber of the bankacccount holder that is the target for this mandate.
DebtorAddressLine2 If present will show zip code and city of the bank account holder that is the target for this mandate.
MaxAmount For core this value will never be set, For B2B the maximum debit amount allowed by the signer of this mandate.
ElectronicSignature A signature that is given by the issuing bank confirming that signing took place. In case of iDEAL fall back it will state 'iDEAL' and IsoPain012Xml will be null.
SignerName If present the name of who did sign the mandate.
IsoPain012Xml The complete xml response, which is the evidence of the mandate being signed.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Mandate
{
	public class MandateIncassoInfo
	{
		public MandateIncassoInfo(string mandateId,DateTime signatureDate,string debtorBIC,string debtorIBAN,string debtorAccountName,string debtorAddressLine1,string debtorAddressLine2,Decimal? maxAmount,string electronicSignature,string signerName,string isoPain12Xml)
		{
			MandateId				= mandateId;
			SignatureLocalDateTime	= signatureDate;
			DebtorBIC				= debtorBIC;
			DebtorIBAN				= debtorIBAN;
			DebtorAccountName		= debtorAccountName;
			DebtorAddressLine1		= debtorAddressLine1;
			DebtorAddressLine2		= debtorAddressLine2;
			MaxAmount				= maxAmount;
			ElectronicSignature		= electronicSignature;
			SignerName				= signerName;
			IsoPain012Xml			= isoPain12Xml;
		}

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string MandateId { get; private set; }

		[JsonProperty]
		public DateTime SignatureLocalDateTime { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string DebtorAccountName { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string DebtorAddressLine1 { get; private set; }
	
		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string DebtorAddressLine2 { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string DebtorBIC { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string DebtorIBAN { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public Decimal? MaxAmount { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string ElectronicSignature { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string SignerName { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public string IsoPain012Xml { get; private set; }
	}
}

<?php

namespace PayCheckout\Json\Mandate;

use DateTime;
use PayCheckout\Json\JsonBase;

class MandateIncassoInfo extends JsonBase
{
    /**
     * @var string
     */
    protected $mandateId;
    
    /**
     * @var DateTime
     */
    protected $signatureLocalDateTime;
        
    /**
     * @var string
     */
    protected $debtorAccountName;
        
    /**
     * @var string
     */
    protected $debtorAddressLine1;
        
    /**
     * @var string
     */
    protected $debtorAddressLine2;
        
    /**
     * @var string
     */
    protected $debtorBIC;
        
    /**
     * @var string
     */
    protected $debtorIBAN;
    
    /**
     * @var null | number
     */
    protected $maxAmount;
    
    /**
     * @var string
     */
    protected $electronicSignature;
        
    /**
     * @var string
     */
    protected $signerName;
        
    /**
     * @var string
     */
    protected $isoPain012Xml;
    
    // Getters
    
    public function getMandateId()
    {
        return $this->mandateId;        
    }
        
    /**
     * @return DateTime
     */
    public function getSignatureLocalDateTime()
    {
        return $this->signatureLocalDateTime;       
    }
    
    /**
     * @return string
     */
    public function getDebtorAccountName()
    {
        return $this->debtorAccountName;
    }
    
    /**
     * @return string
     */
    public function getDebtorAddressLine1()
    {
        return $this->debtorAddressLine1;
    }
    
    /**
     * @return string
     */
    public function getDebtorAddressLine2()
    {
        return $this->debtorAddressLine2;
    }
    
    /**
     * @return string
     */
    public function getDebtorBIC()
    {
        return $this->debtorBIC;
    }
        
    /**
     * @return string
     */
    public function getDebtorIBAN()
    {
        return $this->debtorIBAN;
    }
    
    /**
     * @return null|integer
     */
    public function getMaxAmount()
    {
        return $this->maxAmount;
    }
        
    /**
     * @return string
     */
    public function getElectronicSignature()
    {
        return $this->electronicSignature;
    }
    
    /**
     * @return string
     */
    public function getSignerName()
    {
        return $this->signerName;
    }
    
    /**
     * @return string
     */
    public function getIsoPain012Xml()
    {
        return $this->isoPain012Xml;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {        
        switch($name)
        {
            case 'signatureLocalDateTime':
                $this->signatureLocalDateTime = new DateTime($value);
                return;
        }	
        parent::setJsonData($name, $value);
    }
}			

Json.Mandate.MandateInfo

Field Name Description
CreateTimeUTC The timestamp this mandate was created in UTC.
LastUpdateTimeUTC The timestamp this mandate was last updated in UTC.
MandateReference The reference of this mandate.
MandateId The mandateId of this mandate.
IsCore When true this is a core mandate, else this is a B2B mandate.
MandateIncassoInfo Null or contains a reference to MandateIncassoInfo.
History A list of history entries of type MandateHistory.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Mandate
{
	public class MandateInfo
	{
		public MandateInfo(DateTime createUtc,DateTime updateUtc,Int64 mandateReference,String mandateId,bool isCore,bool isValid,MandateIncassoInfo mandateIncassoInfo)
		{
			CreateTimeUTC		= createUtc;
			LastUpdateTimeUTC	= updateUtc;
			MandateReference	= mandateReference;
			MandateId			= mandateId;
			IsCore				= isCore;
			IsValid				= isValid;
			History				= new List<mandatehistory>();
			MandateIncassoInfo  = mandateIncassoInfo;
		}

		[JsonProperty]
		public DateTime CreateTimeUTC { get; private set;}

		[JsonProperty]
		public DateTime LastUpdateTimeUTC { get; private set;}

		[JsonProperty]
		public Int64 MandateReference	{ get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public String MandateId	{ get; private set; }

		[JsonProperty]
		public bool IsCore	{ get; private set; }

		[JsonProperty]
		public bool IsValid { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public MandateIncassoInfo MandateIncassoInfo { get; private set; }

		[JsonProperty(NullValueHandling=NullValueHandling.Ignore)]
		public List<mandatehistory> History { get; private set; }
	}
}

<?php

namespace PayCheckout\Json\Mandate;

use DateTime;
use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Mandate\MandateIncassoInfo;
use PayCheckout\Json\Mandate\MandateHistory;

class MandateInfo extends JsonBase
{
    /**
     * @var DateTime
     */
    protected $createTimeUTC;
    
    /**
     * @var DateTime
     */
    protected $lastUpdateTimeUTC;
    
    /**
     * @var string
     */
    protected $mandateReference;
    
    /**
     * @var string
     */
    protected $mandateId;
    
    /**
     * @var boolean
     */
    protected $isCore;
    
    /**
     * @var boolean
     */
    protected $isValid;
    
    /**
     * @var PayCheckout\Json\Mandate\MandateIncassoInfo
     */
    protected $mandateIncassoInfo;
    
    /**
     * Summary of $history
     * @var PayCheckout\Json\Mandate\MandateHistory[]
     */
    protected $history;
    
    protected function addHistory($historyRecord)
    {
        $this->history[] = $historyRecord;
    }
    
    /** Get functions */
    
    /**
     * @return DateTime
     */
    public function getCreateTimeUTC()
    {
        return $this->createTimeUTC; 
    }
    
    /**
     * @return DateTime
     */
    public function getLastUpdateTimeUTC()
    {
        return $this->lastUpdateTimeUTC;
    }
    
    /**
     * @return string
     */
    public function getMandateReference()
    {
        return $this->mandateReference;
    }
    
    /**
     * @return string
     */
    public function getMandateId()
    {
        return $this->mandateId;
    }
    
    /**
     * @return boolean
     */
    public function getIsCore()
    {
        return $this->isCore;
    }
    
    /**
     * @return boolean
     */
    public function getIsValid()
    {
        return $this->isValid;
    }
    
    /**
     * @return PayCheckout\Json\Mandate\MandateIncassoInfo
     */
    public function getMandateIncassoInfo()
    {
        return $this->mandateIncassoInfo;
    }
    
    /**
     * @return PayCheckout\Json\Mandate\MandateHistory []
     */
    public function getHistory()
    {
        return $this->history;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {        
        switch($name)
        {
            case 'createTimeUTC':
                $this->createTimeUTC = new DateTime($value);
                return;
            case 'lastUpdateTimeUTC':
                $this->lastUpdateTimeUTC = new DateTime($value);
                return;
            case 'history':
                // Transactions needs to an array (list of transactions)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new MandateHistory();
                            $item->jsonDeserialize($itemValues);
							
                            $this->addHistory($item);
                        }
                    }
                }
                return;
        }	
        parent::setJsonData($name, $value);
    }
}			

Json.Mandate.MandateRequest

Field Name Description
MandateReference The reference of the mandate.
MandateId The mandateId (Machtigingskenmerk).
SequenceType One of the enum SequenceTypes.
MandateReason The reason this mandate exists.
BicCodeBank BIC code of the bank.
LangIso639 2 char Iso639 language code.
DebtorReference The reference that will be shown on the debtors bank account when debited
PurchaseId The purchaseId that is related to this mandate
Max EURO amount The maximum amount that is allowed to debit per transaction.
OriginalIBAN When altering a mandate this value should be send with the request (PayCheckout will retrieve this value automatically).
OriginalBIC When altering a mandate this value should be send with the request (PayCheckout will retrieve this value automatically).
ReturnURL The return URL used when returning from the bank.
NotificationURL The URL that will be used to inform of an updated status of a mandate.

using Newtonsoft.Json;
using System;
using PayCheckout.Api.Mandates;

namespace PayCheckout.Json.Mandate
{
	public class MandateRequest
	{
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int64?			MandateReference	{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			MandateId			{ get; set; }

		[JsonProperty]
		public SequenceType		SequenceType		{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			MandateReason		{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			BicCodeBank			{ get; set; }
			
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			LangIso639			{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			DebtorReference		{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			PurchaseId			{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public int?				MaxEuroAmount		{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			OriginalIBAN		{ get; set; }
	
		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			OriginalBIC			{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			ReturnURL			{ get; set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public string			NotificationURL		{ get; set; }
	}
}

<?php

namespace PayCheckout\Json\Mandate;

use DateTime;
use PayCheckout\Json\JsonBase;
use PayCheckout\Api\Mandates\SequenceType;

class MandateRequest extends JsonBase
{
    /**
     * @var string|int
     */
    protected $mandateReference;
    
    /**
     * @var string
     */
    protected $mandateId;
    
    /**
    /* @var PayCheckout\Api\Mandates\SequenceType
     */
    protected $sequenceType;
        
    /**
     * @var string
     */
    protected $mandateReason;		
    
    /**
     * @var string
     */
    protected $bicCodeBank;		
    
    /**
     * @var string
     */
    protected $langIso639;	
    
    /**
     * @var string
     */   
    protected $debtorReference;
    
    /**
     * @var string
     */
    protected $purchaseId;	
    
    /**
     * @var null|int
     */
    protected $maxEuroAmount;
    
    /**
     * @var string
     */
    protected $originalIBAN;	
        
    /**
     * @var string
     */
    protected $originalBIC;		
        
    /**
     * @var string
     */
    protected $returnURL;		
    
    /**
     * @var string
     */
    protected $notificationURL;
    
    /** Setters */
        
    /**
     * @param string|integer $mandateRef 
     */
    public function setMandateReference( $mandateRef)
    {
        $this->mandateReference = $mandateRef;
    }
    
	/**
	 * @param string $mandateId 
	 */
	public function setMandateId($mandateId)
    {
        $this->mandateId = $mandateId;
    }
    
	/**
	 * @param PayCheckout\Api\Mandates\SequenceyType $sequenceType 
	 */
	public function setSequenceType($sequenceType)
    {
        $this->sequenceType = $sequenceType;
    }
    
	/**
	 * @param string $mandateReason 
	 */
	public function setMandateReason($mandateReason)
    {
        $this->mandateReason = $mandateReason;
    }
    
	/**
	 * @param string $bicCodeBank 
	 */
	public function setBicCodeBank($bicCodeBank)
    {
        $this->bicCodeBank = $bicCodeBank;
    }
    
	/**
	 * @param string $langIso639 
	 */
	public function setLangIso639($langIso639)
    {
        $this->langIso639 = $langIso639;
    }
    
	/**
	 * @param string $debtorReference 
	 */
	public function setDebtorReference($debtorReference)
    {
        $this->debtorReference = $debtorReference;
    }
    
	/**
	 * @param string $purchaseId 
	 */
	public function setPurchaseId($purchaseId)
    {
        $this->purchaseId = $purchaseId;
    }
    
	/**
	 * @param null|integer $maxEuroAmount 
	 */
	public function setMaxEuroAmount($maxEuroAmount)
    {
        $this->maxEuroAmount = $maxEuroAmount;
    }
    
	/**
	 * @param string $originalIBAN 
	 */
	public function setOriginalIBAN($originalIBAN)
    {
        $this->originalIBAN = $originalIBAN;
    }
    
	/**
	 * @param string $originalBIC 
	 */
	public function setOriginalBIC($originalBIC)
    {
        $this->originalBIC = $originalBIC;
    }
    
	/**
	 * @param string $returnURL 
	 */
	public function setReturnURL($returnURL)
    {
        $this->returnURL = $returnURL;
    }
    
	/**
	 * @param string $notificationURL 
	 */
	public function setNotificationURL($notificationURL)
    {
        $this->notificationURL = $notificationURL;
    }
    
    /*  Getters */
    
    /**
     * Summary of getMandateReference
     * @return string
     */
    public function getMandateReference()
    {
        return $this->mandateReason; 
    }
        
	/**
	 * @return string
	 */
	public function getMandateId()
    {
        return $this->mandateId;
    }
    
	/**
	 * @return PayCheckout\Api\Mandates\SequenceType
	 */
	public function getSequenceType()
    {
        return $this->sequenceType;
    }
    
	/**
	 * @return string
	 */
	public function getMandateReason()
    {
        return $this->mandateReason;
    }
    
	/**
	 * @return string
	 */
	public function getBicCodeBank()
    {
        return $this->bicCodeBank;
    }
    
	/**
	 * @return string
	 */
	public function getLangIso639()
    {
        return $this->langIso639;
    }
    
	/**
	 * @return string
	 */
	public function getDebtorReference()
    {
        return $this->debtorReference;
    }
    
	/**
	 * @return string
	 */
	public function getPurchaseId()
    {
        return $this->purchaseId;
    }
    
	/**
	 * @return integer|null
	 */
	public function getMaxEuroAmount()
    {
        return $this->maxEuroAmount;
    }
        
	/**
	 * @return string
	 */
	public function getOriginalIBAN()
    {
        return $this->originalIBAN;
    }
        
	/**
	 * @return string
	 */
	public function getOriginalBIC()
    {
        return $this->originalBIC;
    }
        
	/**
	 * @return string
	 */
	public function getReturnURL()
    {
        return $this->returnURL;
    }
        
	/**
	 * @return string
	 */
	public function getNotificationURL()
    {
        return $this->notificationURL;
    }
}			

Json.Notification.Notification

Field Name Description
NotificationType The NotificationType of this notification.
TraceReference The traceReference that points to the trace of the action that generated this notification.
PaymentStatusChange The PaymentStatusChange if NotificationType equals PaymentStatusChange else "null".
OrderChange The OrderChange if NotificationType equals OrderChange else "null".
RefundInformation The RefundInformation if NotificationType equals RefundInformation else "null".
Mandate The Mandate if NotificationType equals MandateStatusChanged else "null".
VerifiedBankAccount The VerifiedBankAccount if NotificationType equals VerifiedBankAccount else "null".
ProcessedOffline True or False, depended how it was processed.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Notification
{
	public class Notification
	{
		#region Json

		[JsonProperty]
		public NotificationType NotificationType { get; internal set; }

		[JsonProperty]
		public Int64 TraceReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public PaymentStatusChange PaymentStatusChange { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public OrderChange OrderChange { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public RefundInformation RefundInformation { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Mandate Mandate { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public VerifiedBankAccount VerifiedBankAccount { get; internal set; }

		[JsonProperty]
		public bool ProcessedOffline { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Notification;

use PayCheckout\Json\JsonBase;
use PayCheckout\Json\Notification\PaymentStatusChange;
use PayCheckout\Json\Notification\OrderChange;
use PayCheckout\Json\Notification\Refund;
use PayCheckout\Json\Notification\RefundInformation;
use PayCheckout\Json\Notification\VerifiedBankAccount;
use PayCheckout\Json\Notification\Mandate;
class Notification extends JsonBase
{
    /**
     * @var int
     */
    protected $notificationType;
        
    /**
     * @var int|string
     */
    protected $traceReference;
    
    /**
     * @var PaymentStatusChange
     */
    protected $paymentStatusChange;
    
    /**
     * @var OrderChange
     */
    protected $orderChange;
    
    /**
     * @var RefundInformation
     */
    protected $refundInformation;
    
    /**
     * @var Mandate
     */
    protected $mandate;
    
    /**
     * @var VerifiedBankAccount
     */
    protected $verifiedBankAccount;
    /**
     * @var bool
     */
    protected $processedOffline;
   
    /**
     * @return int
     */
    public function getNotificationType()
    {
        return $this->notificationType;
    }
    
    /**
	 * @return int|string
     */
    public function getTraceReference()
    {
        return $this->traceReference;
    }
    
    /**
     * @return PaymentStatusChange
     */
    public function getPaymentStatusChange()
    {
        return $this->paymentStatusChange;
    } 
    
    /**
     * @return OrderChange
     */
    public function getOrderChange()
    {
        return $this->orderChange;
    } 
    
    /**
     * @return RefundInformation
     */
    public function getRefundInformation()
    {
        return $this->refundInformation;
    } 
    /**
     * @return bool
     */
    public function getProcessedOffline()
    {
        return $this->processedOffline;
    }
    
    /**
     * @return Mandate
     */
    public function getMandate()
    {
        return $this->mandate;
    }
						 	    
    /**
     * @return VerifiedBankAccount
     */
    public function getVerifiedBankAccount()
    {
        return $this->verifiedBankAccount;
    }
	
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'paymentStatusChange':
                    $this->paymentStatusChange = new PaymentStatusChange();
                    $this->paymentStatusChange->jsonDeserialize($value);
                    break;
                case 'orderChange':
                    $this->orderChange = new OrderChange();
                    $this->orderChange->jsonDeserialize($value);
                    break;
                case 'refundInformation':
                    $this->refundInformation = new RefundInformation();
                    $this->refundInformation->jsonDeserialize($value);
                    break;
                case 'mandate':
                    $this->mandate = new Mandate();
                    $this->mandate->jsonDeserialize($value);
                    break;
                case 'verifiedBankAccount':
                    $this->verifiedBankAccount = new VerifiedBankAccount();
                    $this->verifiedBankAccount->jsonDeserialize($value);
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
			

Json.Notification.PaymentStatusChange

Field Name Description
PaymentReference The paymentReference of the payment.
TransactionReference The transactionReference of the payment that reports the status change.
PaymentMethod The PaymentMethod that reports a new status.
Status The new PaymentStatus of the payment.
Currency The Currency the payment is in.
MerchantOrderReference The merchant orderreference if known else "null".
PaymentAmount The payment amount, integer value with respect to appicable currency.
PaymentCostInclVat If no order has been specified and an additonal cost has been configured this value contains the integer cost inclusive VAT calculated, with respect to the applicable currency. Is null if VAT is also null.
PaymentCostExlVat If no order has been specified and an additonal cost has been configured this value contains the integer cost exclusive VAT calculated, with respect to the applicable currency.
PaymentCostVatDisplayPercentage If no order has been specified and an additonal cost has been configured this value contains the VAT display percentage * 100.If this is null, PaymentCostInclVat is also null.
Order The order involved in the payment, any configured surcharge is added as a new order item, so use this order to update the initial order to reflect any applied surcharges.

using Newtonsoft.Json;
using PayCheckout.Json.Generic.Order;
using System;

namespace PayCheckout.Json.Notification
{
	public class PaymentStatusChange
	{
		#region Json

		[JsonProperty]
		public Int64 PaymentReference { get; internal set; }

		[JsonProperty]
		public Int64 TransactionReference { get; internal set; }

		[JsonProperty]
		public PaymentMethod PaymentMethod { get; internal set; }

		[JsonProperty]
		public PaymentStatus Status { get; internal set; }

		[JsonProperty]
		public Currency Currency { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String MerchantOrderReference { get; internal set; }

		[JsonProperty]
		public Int32 PaymentAmount { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentCostInclVat { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentCostExclVat { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? PaymentCostVatDisplayPercentage { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Order Order { get; internal set; }

		#endregion
	}
}

<?php
				 	
namespace PayCheckout\Json\Notification;

use PayCheckout\Json\Generic\Order;
use PayCheckout\Json\JsonBase;

class PaymentStatusChange extends JsonBase
{
    /**
     * @var string
     */
    protected $paymentReference;
    
    /**
     * @var string
     */
    protected $transactionReference;
    
    /**
     * @var int
     */
    protected $paymentMethod;
    
    /**
     * @var int
     */
    protected $status;

    /**
     * @var int
     */
    protected $currency;

    /**
     * @var string
     */
    protected $merchantOrderReference;
	
    /**
     * @var int
     */
    protected $paymentAmount;
    
    /**
     * @var int
     */
    protected $paymentCostInclVat;
    
    /**
     * @var int
     */
    protected $paymentCostExclVat;
    
    /**
     * @var int
     */
    protected $paymentCostVatDisplayPercentage;
    
    /**
     * @var Order
     */
    protected $order;

    /**
     * @return string
     */
    public function getPaymentReference()
    {
        return $this->paymentReference;
    }
    
    /**
     * @return string
     */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
    
    /**
     * @return int
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }
    
    /**
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * @return string
     */
    public function getMerchantOrderReference()
    {
        return $this->merchantOrderReference;
    }

    /**
     * @return int
     */
    public function getPaymentAmount()
    {
        return $this->getPaymentAmount;
    }
    
    /**
     * @return int
     */
    public function getPaymentCostInclVat()
    {
        return $this->paymentCostInclVat;
    }
    
    /**
     * @return int
     */
    public function getPaymentCostExclVat()
    {
        return $this->paymentCostExclVat;
    }
    
    /**
     * @return int
     */
    public function getPaymentCostVatDisplayPercentage()
    {
        return $this->paymentCostVatDisplayPercentage;
    }
    
    /**
     * @return order
     */
    public function getOrder()
    {
        return $this->order;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'order':
                    $this->order = new Order();
                    $this->order->jsonDeserialize($value);
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }    
}
			

Json.Notification.OrderChange

Field Name Description
PaymentReference The paymentReference of the payment.
TransactionReference The transactionReference of the payment that reports the status change.
PaymentMethod The PaymentMethod that reports a new status.
Status The new PaymentStatus of the payment.
Currency The Currency the payment is in.
MerchantOrderReference The merchant orderreference if known else "null".
Order The order modified order, so use this order to update/verify the applied changes.

using Newtonsoft.Json;
using System;
using PayCheckout.Json.Generic.Order;

namespace PayCheckout.Json.Notification
{
	public class OrderChange
	{
		#region Json

		[JsonProperty]
		public Int64 PaymentReference { get; internal set; }

		[JsonProperty]
		public Int64 TransactionReference { get; internal set; }

		[JsonProperty]
		public PaymentMethod PaymentMethod { get; internal set; }

		[JsonProperty]
		public PaymentStatus Status { get; internal set; }

		[JsonProperty]
		public Currency Currency { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String MerchantOrderReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Order Order { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Notification;
use PayCheckout\Json\Generic\Order\Order;
use PayCheckout\Json\JsonBase;

class OrderChange extends JsonBase
{
    /**
     * @var string
     */
    protected $paymentReference;
    
    /**
     * @var string
     */
    protected $transactionReference;
    
    /**
     * @var int
     */
    protected $paymentMethod;
    
    /**
     * @var int
     */
    protected $status;

    /**
     * @var int
     */
    protected $currency;
    				 						    
    /**
     * @var string
     */
    protected $merchantOrderReference;
 
    /**
     * @var Order
     */
    protected $order;

    /**
     * @return string
     */
    public function getPaymentReference()
    {
        return $this->paymentReference;
    }
    
    /**
     * @return string
     */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
    
    /**
     * @return int
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }
    
    /**
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * @return string
     */
    public function getMerchantOrderReference()
    {
        return $this->merchantOrderReference;
    }
					    
    /**
     * @return order
     */
    public function getOrder()
    {
        return $this->order;
    }
    
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value))
        {
            switch($name)
            {
                case 'order':
                    $this->order = new Order();
                    $this->order->jsonDeserialize($value);
                    break;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }    
}
			

Json.Notification.RefundInformation

Field Name Description
PaymentReference The payment reference the refund is related to.
TransactionReference The transaction reference the refund is related to.
Currency The Currency the refund(s) is/are in.
MerchantOrderReference The merchant orderreference if known else "null".
Refunds Collection of all refunds that are applied up to this moment.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace PayCheckout.Json.Notification
{
	public class RefundInformation
	{
		#region Json

		[JsonProperty]
		public Int64 PaymentReference { get; internal set; }

		[JsonProperty]
		public Int64 TransactionReference { get; internal set; }

		[JsonProperty]
		public Currency Currency { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String MerchantOrderReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public List<Refund> Refunds { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Notification;
use PayCheckout\Json\JsonBase;

class RefundInformation extends JsonBase
{
    /**
     * @var string
     */
    protected $paymentReference;
       
    /**
     * @var string
     */
    protected $transactionReference;
    
    /**
     * @var int
     */
    protected $currency;
	    
    /**
     * @var string
     */
    protected $merchantOrderReference;

    /**
     * @var Refund[]
     */
    protected $refunds;
    
    /** 
     * Create new RefundInformation
     */
    public function __construct()
    {
        $this->refunds = array();
    }
    
    /**
     * @return string
     */
    public function getPaymentReference()
    {
        return $this->paymentReference;
    }
    
    /**
     * @return string
     */
    public function getTransactionReference()
    {
        return $this->transactionReference;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * @return string
     */
    public function getMerchantOrderReference()
    {
        return $this->merchantOrderReference;
    }
    
    /**
     * @return Refund[]
     */
    public function getRefunds()
    {
        return $this->refunds;
    }
   
    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        switch($name)
        {
            case 'refunds':
                // Refunds needs to translated into an array (list of refunds)
                if (is_array($value))
                {
                    foreach ($value as $itemValues)
                    {
                        // Check if item is an object
                        if (is_object($itemValues))
                        {
                            // Create new item and add to items
                            $item = new Refund();
                            $item->jsonDeserialize($itemValues);
							
                            $this->refunds[] = $item;
                        }
                    }
                }
                return;
        }
		
        parent::setJsonData($name, $value);
    }    
}
			

Json.Notification.Refund

Field Name Description
CreateTime Time the refund was created.
RefundAmountInclVat The amount refunded including VAT. Amount is the translated amount according to the currency used.
RefundAmountExclVat The amount refunded excluding VAT. Amount is the translated amount according to the currency used.
RefundNote A note describing the refund.
RefundReference A system generated description of the refund.

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Notification
{
	public class Refund
	{
		#region Json

		[JsonProperty]
		public DateTime CreateTime { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public Int32? RefundAmountInclVat { get; internal set; }

		[JsonProperty]
		public Int32 RefundAmountExclVat { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String RefundNote { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String RefundReference { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Notification;
use PayCheckout\Json\JsonBase;

class Refund extends JsonBase
{
    /**
     * @var DateTime
     */
    protected $createTime;
       
    /**
     * @var int
     */
    protected $refundAmountInclVat;

    /**
     * @var int
     */
    protected $refundAmountExclVat;
    
    /**
     * @var string
     */
    protected $refundNote;
    
    /**
     * @var string
     */
    protected $refundReference;
    
    /**
     * @return DateTime
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }
    
    /**
     * @return int
     */
    public function getRefundAmountInclVat()
    {
        return $this->refundAmountInclVat;
    }
    
    /**
     * @return int
     */
    public function getRefundAmountExclVat()
    {
        return $this->refundAmountExclVat;
    }
    
    /**
     * @return string
     */
    public function getRefundNote()
    {
        return $this->refundNote;
    }
    
    /**
     * @return string
     */
    public function getRefundReference()
    {
        return $this->refundReference;
    }
}
			

Json.Notification.Mandate

Field Name Description
CustomerReference The customer reference of the mandate that has changed.
MandateReference The mandate reference of the mandate that has changed.
MandateId The mandate id of the mandate that has changed.
MandateStatus The mandate status.

using Newtonsoft.Json;
using System;
using PayCheckout.Api.Customer.Mandate;

namespace PayCheckout.Json.Notification
{
	public class Mandate
	{
		#region Json

		[JsonProperty]
		public Int64		CustomerReference		{ get; internal set; }

		[JsonProperty]
		public Int64		MandateReference		{ get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String		MandateId				{ get; internal set; }

		[JsonProperty]
		public MandateStatus MandateStatus			{ get; internal set; }

		#endregion
	}
}

<?php
					 
namespace PayCheckout\Json\Notification;

class Mandate
{
    /**
     * @var string
     */
    protected $customerReference;
    
    /**
     * @var string
     */
    protected $mandateReference;
    
    /**
     * @var string
     */
    protected $mandateId;
    
    /**
     * MandateStatus
     * @var int
     */
    protected $mandateStatus;
    
    // Getters
    
    /**
     * @return string
     */
    public function getCustomerReference()
    {
        return $this->customerReference;
    }
    
    /**
     * @return string
     */
    public function getMandateReference()
    {
        return $this->mandateReference;
    }
    
    /**
     * @return string
     */
    public function getMandateId()
    {
        return $this->mandateId;
    }
    
    /**
     * @return int
     */
    public function getMandateStatus()
    {
        return $this->mandateStatus;   
    }
}
			

Json.Notification.VerifiedBankAccount

Field Name Description
CustomerReference The "CustomerReference" on behalf of which the verification took place.
BankAccountReference The "BankAccountReference" the verification was succesfull on.
NamOnBankAccount The name that is on the bank statement.
Bic Bic code of the bank verified.
IBAN IBAN account of the bank verified.
DateTimeVerified The time (UTC) the verification took place.
@Html.Partial("_CodeTabs")

using Newtonsoft.Json;
using System;

namespace PayCheckout.Json.Notification
{
	public class VerifiedBankAccount
	{
		#region Json

		[JsonProperty]
		public Int64 CustomerReference { get; internal set; }

		[JsonProperty]
		public Int64 BankAccountReference { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String NameOnBankAccount { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String BIC { get; internal set; }

		[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
		public String IBAN { get; internal set; }

		[JsonProperty]
		public DateTime DateTimeVerified { get; internal set; }

		#endregion
	}
}

<?php

namespace PayCheckout\Json\Notification;

use DateTime;

class VerifiedBankAccount
{
    /**
     * @var int|string
     */
    protected $customerReference;
    
    /**
     * @var int|string
     */
    protected $bankAccountReference;
    
    /**
     * @var string
     */
    protected $nameOnBankAccount;
    
    /**
     * @var string
     */
    protected $bic;
    
    /**
     * @var string
     */
    protected $iBAN;
    
    /**
     * @var DateTime
     */
    protected $dateTimeVerified;
    
    /**
     * @return integer|string
     */
    public function getCustomerReference()
    {
        return $this->customerReference;
    }
    
    /**
     * @return integer|string
     */
    public function getBankAccountReference()
    {
        return $this->bankAccountReference;
    }
    
    /**
     * @return string
     */
    public function getNameOnBankAccount()
    {
        return $this->nameOnBankAccount;
    }
    
    /**
     * @return string
     */
    public function getBic()
    {
        return $this->bic;
    }
    
    /**
     * @return string
     */
    public function getIBAN()
    {
        return $this->iBAN;
    }
    
    /**
     * @return DateTime
     */
    public function getDateTimeVerified()
    {
        return $this->dateTimeVerified;
    }
}
			

Api.Service.GetAvailablePaymentMethods.AvailablePaymentMethod

Field Name Description Note
PaymentMethod Enumeration of the payment method.
Currency Enumeration of the currency the payment method will use.
PaymentMethodName The textual name of the payment method.
AvailabilityInfo 'null' if no availability information is present, else information about disruptions or maintenance.
PaymentMethodDescription Description of the payment method, either the standard text or one that is configured in the portal.
UrlPaymentMethodLogo The url that referes to the logo that should be used to grafically display the payment method.
PaymentCost Integer amount of the payment cost including VAT or excluding VAT depending on what is configured. Cost is calculated as an integer value according to the applied currency. When no paymentcost value = 0 (zero!)
PaymentCostExclVat Integer amount of the payment excluding VAT if cost applied else value is null. Cost is calculated as an integer value according to the applied currency.
PaymentCostInclVat Integer amount of the payment including VAT if VAT and cost are applied else value is null. Cost is calculated as an integer value according to the applied currency.
PaymentCostVatDisplayPercentage Integer amount of the VAT percentage if VAT and cost are applied else value is null. Percentage is calculated as an integer (ex. 21% = 2100).
isPreferred When true the user of this payment has this paymentmethod as a preferred method. New from version 1.2.0.2
IssuerList For iDEAL additional information showing a list/array of IsuerInformation. New from version 1.2.0.2

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace PayCheckout.Api.Service
{
	public class GetAvailablePaymentMethods
	{
		public class AvailablePaymentMethod
		{
			#region Json

			public PaymentMethod	PaymentMethod				    { get; internal set; }

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public Currency			Currency					    { get; internal set; }

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public String			PaymentMethodName			    { get; internal set; }

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public String			AvailabilityInfo			    { get; internal set; }

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public String			PaymentMethodDescription	    { get; internal set; }

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public String			UrlPaymentMethodLogo		    { get; internal set; }

			public Int32			PaymentCost					    { get; internal set; }

   			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public Int32?			PaymentCostExclVat  		    { get; internal set; }

            [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public Int32?			PaymentCostInclVat			    { get; internal set; }

            [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public Int32?	        PaymentCostVatDisplayPercentage { get; internal set; }

   			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public List<Issuer>     IssuerList					    { get; internal set; }

			[JsonProperty]
			public Boolean			isPreferred						{ get; internal set; }

			#endregion
		}
	}
}

<?php
				 	
namespace PayCheckout\Api\Service\AvailablePaymentMethod;

use PayCheckout\Json\JsonBase;

class AvailablePaymentMethod extends JsonBase
{
    /** 
     *  @var int
     */
    protected $paymentMethod;   
    /** 
     *  @var int
     */
    protected $currency;   
    
    /**
     * @var string
     */
    protected $paymentMethodName;
    
    /**
     * @var string
     */
    protected $availabilityInfo;
    
    /**
     * @var string
     */
    protected $paymentMethodDescription;
    
    /**
     * @var string
     */
    protected $urlPaymentMethodLogo;
    
    /**
     * @var int
     */
    protected $paymentCost;
    
    /**
     * @var int
     */
    protected $paymentCostExclVat;
    
    /**
     * @var int
     */
    protected $paymentCostInclVat;
    
    /**
     * @var int
     */
    protected $paymentCostVatDisplayPercentage;
    
    /**
     * @var Issuer[]
     */
    protected $issuerList;

    /**
     * @var Boolean
     */
    protected $isPreferred;

    /**
     * @return int
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }
        
    /**
     * @return string
     */
    public function getPaymentMethodName()
    {
        return $this->paymentMethodName;
    }   
    
    /**
     * @return string
     */
    public function getAvailabilityInfo()
    {
        return $this->availabilityInfo;
    }   
    
    /**
     * @return string
     */
    public function getPaymentMethodDescription()
    {
        return $this->paymentMethodDescription;
    }   
    
    /**
     * @return string
     */
    public function getUrlPaymentMethodLogo()
    {
        return $this->urlPaymentMethodLogo;
    }   
    
    /**
     * @return int
     */
    public function getPaymentCost()
    {
        return $this->paymentCost;
    }
    
    /**
     * @return int
     */
    public function getPaymentCostExclVat()
    {
        return $this->paymentCostExclVat;
    }
    
    /**
     * @return int
     */
    public function getPaymentCostInclVat()
    {
        return $this->paymentCostInclVat;
    }

    /**
     * @return int
     */
    public function getPaymentCostVatDisplayPercentage()
    {
        return $this->paymentCostVatDisplayPercentage;
    }
                         
    /**
     * @return Issuer[]
     */
    public function getIssuerList()
    {
        return $this->issuerList;
    }

    /**
     * @return boolean
     */
    public function getIsPreferred()
    {
        if ($this->isPreferred === null)
        {
            return FALSE;
        }
        else
        {
            return $this->isPreferred;
        }
    }

    /**
     * {@inheritDoc}
     */
    protected function setJsonData($name, $value)
    {
        if (is_object($value) || is_array($value))
        {
            switch($name)
            {
                case 'issuerList':
                    // (list of issuers)
                    if (is_array($value))
                    {
                        foreach ($value as $itemValues)
                        {
                            // Check if item is an object
                            if (is_object($itemValues))
                            {
                                // Create new issuer and add to issuer
                                $issuer = new Issuer();
                                $issuer->jsonDeserialize($itemValues);

                                $this->issuerList[] = $issuer;
                            }
                        }
                    }
                    return;
            }
        }
        else
        {
            parent::setJsonData($name, $value);
        }
    }
}
			

Api.Service.GetAvailablePaymentMethods.Issuer

Field Name Description
IssuingBankCode The BIC code of this bank.
DisplayName The display name of this bank.
UrlIssuerLogo The url of a logo of this bank.
isPreferred True if this bank is the users preferred bank for a payment.

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace PayCheckout.Api.Service
{
	public class GetAvailablePaymentMethods
	{
        public class Issuer
		{
			[JsonProperty]
			public String IssuingBankCode	{ get; internal set; }

			[JsonProperty]
			public String DisplayName		{ get; internal set; }

			[JsonProperty]
			public String UrlIssuerLogo		{ get; internal set; }

			[JsonProperty]
			public Boolean isPrefered		{ get; internal set;}
		}
	}
}

<?php
		
namespace PayCheckout\Api\Service\AvailablePaymentMethod;
use PayCheckout\Json\JsonBase;

class Issuer extends JsonBase
{
    /**
     * @var string
     */
    protected $issuingBankCode;
    
    /**
     * @var string
     */
    protected $displayName;
    
    /**
     * @var string
     */
    protected $urlIssuerLogo;
    
    /**
     * @var boolean
     */
    protected $isPreferred;
    
    /**
     * @return string
     */
    function getIssuingBankCode()
    {
        return $this->issuingBankCode;
    }
    
    /**
     * @return string
     */
    function getDisplayName()
    {
        return $this->displayName;
    }
    
    /**
     * @return string
     */
    function getUrlIssuerLogo()
    {
        return $this->urlIssuerLogo;
    }
    
    /**
     * @return boolean
     */
    function getIsPreferred()
    {
        if ($this->isPreferred === null)
        {
            return FALSE;
        }
        else
        {
            return $this->isPreferred;
        }
    }
}			

API.Service.IDealGetDirectory.Country

Field Name Description
Name The name of the country.
Issuers Collection of Issuer classes.

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;

namespace PayCheckout.Api.Service
{
	public class IDealGetDirectory
	{
		public class Country
		{
			public string		Name;
			public List<Issuer>	Issuers;
		}
	}
)

<?php
				 	
namespace PayCheckout\Api\Service\Ideal;

class Country
{
    /**
     * @var string
     */
    private $name;
    
    /**
     * @var Issuer[]
     */
    private $issuers;
    
    /**
     * Create new country
     * 
     * @param string $name 
     * @param Issuer[] $issuers 
     */
    public function __construct($name, array $issuers)
    {
        $this->name		= $name;
        $this->issuers	= $issuers;
    }
    
    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return Issuer[]
     */
    public function getIssuers()
    {
        return $this->issuers;
    }
}			

Api.Service.IDealGetDirectory.Issuer

Field Name Description
Name The name of the issuing bank.
Id The Id of the issuing bank, for now in all known cases, this is the BIC-code of the bank.

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;

namespace PayCheckout.Api.Service
{
	public class IDealGetDirectory
	{
		public class Issuer
		{
			public string Name;
			public string Id;
		}
	}
}

<?php
				 	
namespace PayCheckout\Api\Service\Ideal;

class Issuer
{
    /**
     * @var string
     */
    private $name;
    
    /**
     * @var int
     */
    private $id;
    
    /**
     * Create new issuer
     * 
     * @param string $name 
     * @param int $id 
     */
    public function __construct($name, $id)
    {
        $this->name	= $name;
        $this->id	= $id;
    }
    
    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    
    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }
}			

Api.Service.KlarnaAccountGetInstallmentsInfo.InstallmentInfo

Field Name Description
CampaignName The campaign name for this installment.
TotalInstallments The (integer) number of installments before the full amount is considered paid.
MonthlyAmount The (integer) converted amount using the currency to pay each month.
PClassId The (integer) PClassId that identifies this installment.
Currency The Currency of this installment.

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;

namespace PayCheckout.Api.Service
{
	public class KlarnaAccountGetInstallmentsInfo
	{
		public class InstallmentInfo
		{
			public InstallmentInfo(String campaignName,Int32 totalInstallments,Int32 monthlyAmount,Int32 pClassId,Currency currency)
			{
				CampaignName        = campaignName;
				TotalInstallments   = totalInstallments;
				MonthlyAmount       = monthlyAmount;
				PClassId            = pClassId;
				Currency            = currency;
			}
			public String	CampaignName        { get; private set; }
			public Int32	TotalInstallments   { get; private set; }
			public Int32	MonthlyAmount       { get; private set; }
			public Int32	PClassId            { get; private set; }
			public Currency Currency            { get; private set; }
		}
	}
}

<?php
				 	
namespace PayCheckout\Api\Service\Klarna;

class InstallmentInfo
{
    /**
     * @var string
     */
    private $campaignName;
    
    /**
     * @var int
     */
    private $totalInstallments;
    
    /**
     * @var int
     */
    private $monthlyAmount;
    
    /**
     * @var int
     */
    private $pClassId;
    
    /**
     * @var int
     */
    private $currency;
    
    /**
     * Create new installment info
     * 
     * @param string $campaignName 
     * @param int $totalInstallments 
     * @param int $monthlyAmount 
     * @param int $pClassId 
     * @param int $currency
     */
    public function __construct($campaignName, $totalInstallments, $monthlyAmount, $pClassId, $currency)
    {
        $this->campaignName         = $campaignName;
        $this->totalInstallments    = $totalInstallments;
        $this->monthlyAmount        = $monthlyAmount;
        $this->pClassId             = $pClassId;
        $this->currency             = $currency;
    }
        
    /**
     * @return string
     */
    public function getCampaignName()
    {
        return $this->campaignName;
    }
    
    /**
     * @return int
     */
    public function getTotalInstallments()
    {
        return $this->totalInstallments;
    }
    
    /**
     * @return int
     */
    public function getMonthlyAmount()
    {
        return $this->monthlyAmount;
    }
    
    /**
     * @return int
     */
    public function getPClassId()
    {
        return $this->pClassId;
    }
    
    /**
     * @return int
     */
    public function getCurrency()
    {
        return $this->currency;
    }
}			

Api.Service.KlarnaGetAddresses.KlarnaAddress

Field Name Description
FirstName FirstName if available, else an empty string.
LastOrCompanyName LastName or, in case it's a company, the company name.
Address The address line containing street and house number.
PostalCode The zip-code.
City The city.
Country The ISO-3166 two character country name.

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;

namespace PayCheckout.Api.Service
{
	public class KlarnaGetAddresses
	{
		public class KlarnaAddress
		{
			public String	FirstName          { get; internal set; }
			public String	LastOrCompanyName  { get; internal set; }
			public String	Address            { get; internal set; }
			public String	PostalCode         { get; internal set; }
			public String	City               { get; internal set; }
			public String	Country            { get; internal set; }
		}
	}
}

<?php
				 	
namespace PayCheckout\Api\Service\Klarna;

class KlarnaAddress
{
    /**
     * @var string
     */
    private $firstName;
    
    /**
     * @var string
     */
    private $lastOrCompanyName;
    
    /**
     * @var string
     */
    private $address;
    
    /**
     * @var string
     */
    private $postalCode;
    
    /**
     * @var string
     */
    private $city;
    
    /**
     * @var string
     */
    private $country;
    
    /**
     * Create new Klarna address
     *
     * @param string $firstName 
     * @param string $lastOrCompanyName 
     * @param string $address 
     * @param string $postalCode 
     * @param string $city 
     * @param string $country 
     */
    public function __construct($firstName, $lastOrCompanyName, $address, $postalCode, $city, $country)
    {
        $this->firstName            = $firstName;
        $this->lastOrCompanyName    = $lastOrCompanyName;
        $this->address              = $address;
        $this->postalCode           = $postalCode;
        $this->city                 = $city;
        $this->country              = $country;
    }
    
    /**
     * @return string
     */
    public function getFirstName()
    {
        return $this->firstName;
    }
    
    /**
     * @return string
     */
    public function getLastOrCompanyName()
    {
        return $this->lastOrCompanyName;
    }
    
    /**
     * @return string
     */
    public function getAddress()
    {
        return $this->address;
    }
    
    /**
     * @return string
     */
    public function getPostalCode()
    {
        return $this->postalCode;
    }
    
    /**
     * @return string
     */
    public function getCity()
    {
        return $this->city;
    }
    
    /**
     * @return string
     */
    public function getCountry()
    {
        return $this->country;
    }
}			

Api.Service.GetModuleVersion.ModuleVersionInfo

Field Name Description
VersionIsCurrent Bool/Integer When false(0) then NewestVersion contains the newest version, when true(1) then version is valid and NewestVersion contains 'null'.
NewestVersion If version offered for comparison differs this contains the version that is considered the best version to use.

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace PayCheckout.Api.Service
{
	public class GetModuleVersion
	{
		public class ModuleVersionInfo
		{
			#region Json

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public bool		VersionIsCurrent	{ get; internal set; }

			[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
			public String	NewestVersion		{ get; internal set; }

			#endregion
		}
	}
}

<?php
				 	
namespace PayCheckout\Api\Service\ModuleVersionInfo;

use PayCheckout\Json\JsonBase;

class ModuleVersionInfo extends JsonBase
{
    /** 
     *  @var int
     */
    protected $versionIsCurrent;   
    
    /**
     * @var string
     */
    protected $newestVersion;
       
    /**
     * @return int
     */
    public function getVersionIsCurrent()
    {
        return $this->versionIsCurrent;
    }
    
    /**
     * @return string
     */
    public function getNewestVersion()
    {
        return $this->newestVersion;
    }   
}
			

Api Enumerations

Below are the enumerations used in the api.

PaymentMethod

Enumeration Value
iDEAL 1
PayPal 2
Creditcard 3
SEPAbanktransfer 4
KlarnaInvoice 5
KlarnaAccount 6
SofortBanking 11
Bancontact 13
Hosted 62

namespace PayCheckout
{
	public enum PaymentMethod
	{
		iDEAL            = 1,
        PayPal           = 2,
        Creditcard       = 3,
		SEPAbanktransfer = 4
		KlarnaInvoice    = 5,
		KlarnaAccount    = 6,
        SofortBanking    = 11;
		Bancontact       = 13;
		Hosted           = 62,
	}
}

<?php
				 	
namespace PayCheckout;

class PaymentMethod
{
    const IDEAL             = 1;
    const PAYPAL            = 2;
    const CREDITCARD        = 3;
	const SEPABANKTRANSFER  = 4;
    const KLARNAINVOICE     = 5;
    const KLARNAACCOUNT     = 6; 
    const SOFORTBANKING     = 11; 
	const BANCONTACT        = 13; 
    const HOSTED            = 62;
}
			

Currency

Enumeration Value Multiply factor Currency
AED 6 100Emirati Dirham
AFN 7 100Afghani
ALL 8 100Albanian Lek
AMD 9 100Armenian Dram
ANG 10 100Dutch Guilder
ARS 11 100Argentine Peso
AUD 12 100Australian Dollar
AWG 13 100Aruban Guilder
AZN 14 100Azerbaijani New Manat
BAM 15 100Bosnian Convertible Marka
BBD 16 100Bajan Dollar
BDT 17 100Bangladeshi Taka
BGN 18 100Bulgarian Lev
BHD 191000Bahraini Dinar
BMD 20 100Bermudian Dollar
BND 21 100Bruneian Dollar
BOB 22 100Bolivian Boliviano
BRL 23 100Brazillian Real
BSD 24 100Bahamian Dollar
BWP 25 100Botswana Pula
BYR 26 1Belarusian Ruble
BZD 27 100Belizean Dollar
CAD 28 100Canadian Dollar
CHF 29 100Swiss Franc
CLP 30 100Chilean Peso
CNY 31 100China Yuan Renminbi
COP 32 100Colombian Peso
CRC 33 100Costa Rica Colon
CVE 34 1Cape Verdean Escudo
CZK 35 100Czech Koruna
DJF 36 1Djiboutian Franc
DKK 5 100Danish Krone
DOP 37 100Dominican Peso
DZD 38 100Algerian Dinar
EGP 39 100Egyptian Pound
ETB 40 100Ethiopian Birr
EUR 0 100Euro
FJD 41 100Fijian Dollar
FKP 42 100Falkland Island Pound
GBP 2 100Britisch Pound
GEL 43 100Georgian Lari
GGP 44 100Guernsey Pound
GHS 45 100Ghanaian Cedi
GIP 46 100Gibraltar Pound
GMD 47 100Gambian Dalasi
GNF 48 1Guinean Franc
GTQ 49 100Guatemalan Quetzal
GYD 50 100Guyanese Dollar
HKD 51 100Hong Kong Dollar
HNL 52 100Hondurian Lempira
HRK 53 100Croatian Kuna
HTG 54 100Haitian Gourde
HUF 55 100Hungarian Forint
IDR 56 1Indonesian Rupiah
ILS 57 100Israeli Shekel
IMP 58 100Isle of Man Pound
INR 59 100Indian Rupee
ISK 60 100Icelandic Krona
JEP 61 100Jersey Pound
JMD 62 100Jamaican Dollar
JOD 631000Jordanian Dinar
JPY 64 1Japanese Yen
KES 65 100Kenyan Shilling
KGS 66 100Kyrgyzstani Som
KHR 67 100Cambodian Riel
KMF 68 1Camoran Franc
KRW 69 1South Korean Won
KWD 701000Kuwaiti Dinar
KYD 71 100Caymanian Dollar
KZT 72 100Kazakhstani Tenge
LAK 73 100Laotian Kip
LBP 74 100Lebanese Pound
LKR 75 100Sri Lankan Rupee
LYD1411000Libyan Dinar
MAD 76 100Moroccan Dirham
MDL 77 100Moldovan Leu
MKD 78 100Macedonian Denar
MMK 79 100Burmese Kyat
MNT 80 100Mongolian Tughrik
MOP 81 100Macau Pataca
MRO 82 10Mauritanian Ouguiya
MUR 83 100Mauritian Rupee
MVR 84 100Maldivian Rufiyaa
MWK 85 100Malawian Kwacha
MXN 86 100Mexican Peso
MYR 87 100Malaysian Ringgit
MZN 88 100Mozambican Metical
NAD 89 100Namibian Dollar
NGN 90 100Nigerian Naira
NIO 91 100Nicaraguan Cordoba
NOK 4 100Norwegian Krone
NPR 92 100Nepalese Rupee
NZD 93 100Dollar
OMR 941000Omani Rial
PAB 95 100Panamanian Balboa
PEN 96 100Peruvian Nuevo Sol
PGK 97 100Papua New Guinean Kina
PHP 98 100Philippine Peso
PKR 99 100Pakistani Rupee
PLN100 100Polish Zloty
PYG101 1Paraguayan Guarani
QAR102 100Qatari Riyal
RON103 100Romanian New Leu
RSD104 100Serbian Dinar
RUB105 100Russian Ruble
RWF106 1Rwandan Franc
SAR107 100Saudi Arabian Riyal
SBD108 100Solomon Islander Dollar
SCR109 100Seychellois Rupee
SEK 3 1Swedish Krona
SGD110 100Singapore Dollar
SHP111 100Saint Helenian Pound
SLL112 100Sierra Leonean Leone
SOS113 100Somali Shilling
SRD114 100Dollar
STD115 100Sao Tomean Dobra
SVC116 100Salvadoran Colon
SZL117 100Swazi Lilangeni
THB118 100Thai Baht
TND1191000Tunisian Dinar
TOP120 100Tongan Pa'anga
TRY121 100Turkish Lira
TTD122 100Trinidadian Dollar
TVD123 100Tuvaluan Dollar
TWD124 100Taiwan New Dollar
TZS125 100Tanzanian Shilling
UAH126 100Ukrainian Hryvnia
UGX127 1Ugandan Shilling
USD 1 100US Dollar
UYU128 100Uruguayan Peso
UZS129 100Uzbekistani Som
VEF130 100Venezuelan Bolivar
VND131 1Vietnamese Dong
VUV132 1Ni-Vanuatu Vatu
WST133 100Samoan Tala
XAF134 1Central African CFA Franc
XCD135 100East Caribbean Dollar
XOF136 1CFA Franc
XPF137 1CFP Franc
YER138 100Yemeni Rial
ZAR139 100South African Rand
ZMW140 100Zambian Kwacha

using System;
namespace PayCheckout
{
	public enum Currency
	{
		AED =   6,
		AFN =   7,
		ALL =   8,
		AMD =   9,
		ANG =  10,
		ARS =  11,
		AUD =  12,
		AWG =  13,
		AZN =  14,
		BAM =  15,
		BBD =  16,
		BDT =  17,
		BGN =  18,
		BHD =  19,
		BMD =  20,
		BND =  21,
		BOB =  22,
		BRL =  23,
		BSD =  24,
		BWP =  25,
		BYR =  26,
		BZD =  27,
		CAD =  28,
		CHF =  29,
		CLP =  30,
		CNY =  31,
		COP =  32,
		CRC =  33,
		CVE =  34,
		CZK =  35,
		DJF =  36,
		DKK =   5,
		DOP =  37,
		DZD =  38,
		EGP =  39,
		ETB =  40,
		EUR =   0,
		FJD =  41,
		FKP =  42,
		GBP =   2,
		GEL =  43,
		GGP =  44,
		GHS =  45,
		GIP =  46,
		GMD =  47,
		GNF =  48,
		GTQ =  49,
		GYD =  50,
		HKD =  51,
		HNL =  52,
		HRK =  53,
		HTG =  54,
		HUF =  55,
		IDR =  56,
		ILS =  57,
		IMP =  58,
		INR =  59,
		ISK =  60,
		JEP =  61,
		JMD =  62,
		JOD =  63,
		JPY =  64,
		KES =  65,
		KGS =  66,
		KHR =  67,
		KMF =  68,
		KRW =  69,
		KWD =  70,
		KYD =  71,
		KZT =  72,
		LAK =  73,
		LBP =  74,
		LKR =  75,
		LYD = 141,
		MAD =  76,
		MDL =  77,
		MKD =  78,
		MMK =  79,
		MNT =  80,
		MOP =  81,
		MRO =  82,
		MUR =  83,
		MVR =  84,
		MWK =  85,
		MXN =  86,
		MYR =  87,
		MZN =  88,
		NAD =  89,
		NGN =  90,
		NIO =  91,
		NOK =   4,
		NPR =  92,
		NZD =  93,
		OMR =  94,
		PAB =  95,
		PEN =  96,
		PGK =  97,
		PHP =  98,
		PKR =  99,
		PLN = 100,
		PYG = 101,
		QAR = 102,
		RON = 103,
		RSD = 104,
		RUB = 105,
		RWF = 106,
		SAR = 107,
		SBD = 108,
		SCR = 109,
		SEK =   3,
		SGD = 110,
		SHP = 111,
		SLL = 112,
		SOS = 113,
		SRD = 114,
		STD = 115,
		SVC = 116,
		SZL = 117,
		THB = 118,
		TND = 119,
		TOP = 120,
		TRY = 121,
		TTD = 122,
		TVD = 123,
		TWD = 124,
		TZS = 125,
		UAH = 126,
		UGX = 127,
		USD =   1,
		UYU = 128,
		UZS = 129,
		VEF = 130,
		VND = 131,
		VUV = 132,
		WST = 133,
		XAF = 134,
		XCD = 135,
		XOF = 136,
		XPF = 137,
		YER = 138,
		ZAR = 139,
		ZMW = 140,
	}

    public class Help
	{
		public static Decimal GetCurrencyMultiplyFactorDecimal(Currency currency)
		{
			switch (currency)
			{
				// Times 1
				case Currency.BYR:
				case Currency.CVE:
				case Currency.DJF:
				case Currency.GNF:
				case Currency.IDR:
				case Currency.JPY:
				case Currency.KMF:
				case Currency.KRW:
				case Currency.PYG:
				case Currency.RWF:
				case Currency.SEK:
				case Currency.UGX:
				case Currency.VND:
				case Currency.VUV:
				case Currency.XAF:
				case Currency.XOF:
				case Currency.XPF:
					return 0;
				// Times 10
				case Currency.MRO:
					return 1;
				// Times 1000
				case Currency.BHD:
				case Currency.JOD:
				case Currency.KWD:
				case Currency.LYD:
				case Currency.OMR:
				case Currency.TND:
					return 3;
				default:
				// Times 100
					return 2;
			}
		}

		public static int GetCurrencyMultiplyFactor(Currency currency)
		{
			switch (currency)
			{
				case Currency.BYR:
				case Currency.CVE:
				case Currency.DJF:
				case Currency.GNF:
				case Currency.IDR:
				case Currency.JPY:
				case Currency.KMF:
				case Currency.KRW:
				case Currency.PYG:
				case Currency.RWF:
				case Currency.SEK:
				case Currency.UGX:
				case Currency.VND:
				case Currency.VUV:
				case Currency.XAF:
				case Currency.XOF:
				case Currency.XPF:
					return GetMultiplyConstant(0);
				case Currency.MRO:
					return GetMultiplyConstant(1);
				case Currency.BHD:
				case Currency.JOD:
				case Currency.KWD:
				case Currency.LYD:
				case Currency.OMR:
				case Currency.TND:
					return GetMultiplyConstant(3);
				default:
					return GetMultiplyConstant(2);
			}
		}
	}
}

<?php
				 	
namespace PayCheckout;

class Currency
{     
    const  EUR =   0;
    const  USD =   1;
    const  GBP =   2;
    const  SEK =   3;
    const  NOK =   4;
    const  DKK =   5;

    // Due to keyword TRY inclusion a C_ was prepended
    const C_AED =   6;
    const C_AFN =   7;
    const C_ALL =   8;
    const C_AMD =   9;
    const C_ANG =  10;
    const C_ARS =  11;
    const C_AUD =  12;
    const C_AWG =  13;
    const C_AZN =  14;
    const C_BAM =  15;
    const C_BBD =  16;
    const C_BDT =  17;
    const C_BGN =  18;
    const C_BHD =  19;
    const C_BMD =  20;
    const C_BND =  21;
    const C_BOB =  22;
    const C_BRL =  23;
    const C_BSD =  24;
    const C_BWP =  25;
    const C_BYR =  26;
    const C_BZD =  27;
    const C_CAD =  28;
    const C_CHF =  29;
    const C_CLP =  30;
    const C_CNY =  31;
    const C_COP =  32;
    const C_CRC =  33;
    const C_CVE =  34;
    const C_CZK =  35;
    const C_DJF =  36;
    const C_DKK =   5;
    const C_DOP =  37;
    const C_DZD =  38;
    const C_EGP =  39;
    const C_ETB =  40;
    const C_EUR =   0;
    const C_FJD =  41;
    const C_FKP =  42;
    const C_GBP =   2;
    const C_GEL =  43;
    const C_GGP =  44;
    const C_GHS =  45;
    const C_GIP =  46;
    const C_GMD =  47;
    const C_GNF =  48;
    const C_GTQ =  49;
    const C_GYD =  50;
    const C_HKD =  51;
    const C_HNL =  52;
    const C_HRK =  53;
    const C_HTG =  54;
    const C_HUF =  55;
    const C_IDR =  56;
    const C_ILS =  57;
    const C_IMP =  58;
    const C_INR =  59;
    const C_ISK =  60;
    const C_JEP =  61;
    const C_JMD =  62;
    const C_JOD =  63;
    const C_JPY =  64;
    const C_KES =  65;
    const C_KGS =  66;
    const C_KHR =  67;
    const C_KMF =  68;
    const C_KRW =  69;
    const C_KWD =  70;
    const C_KYD =  71;
    const C_KZT =  72;
    const C_LAK =  73;
    const C_LBP =  74;
    const C_LKR =  75;
    const C_LYD = 141;
    const C_MAD =  76;
    const C_MDL =  77;
    const C_MKD =  78;
    const C_MMK =  79;
    const C_MNT =  80;
    const C_MOP =  81;
    const C_MRO =  82;
    const C_MUR =  83;
    const C_MVR =  84;
    const C_MWK =  85;
    const C_MXN =  86;
    const C_MYR =  87;
    const C_MZN =  88;
    const C_NAD =  89;
    const C_NGN =  90;
    const C_NIO =  91;
    const C_NOK =   4;
    const C_NPR =  92;
    const C_NZD =  93;
    const C_OMR =  94;
    const C_PAB =  95;
    const C_PEN =  96;
    const C_PGK =  97;
    const C_PHP =  98;
    const C_PKR =  99;
    const C_PLN = 100;
    const C_PYG = 101;
    const C_QAR = 102;
    const C_RON = 103;
    const C_RSD = 104;
    const C_RUB = 105;
    const C_RWF = 106;
    const C_SAR = 107;
    const C_SBD = 108;
    const C_SCR = 109;
    const C_SEK =   3;
    const C_SGD = 110;
    const C_SHP = 111;
    const C_SLL = 112;
    const C_SOS = 113;
    const C_SRD = 114;
    const C_STD = 115;
    const C_SVC = 116;
    const C_SZL = 117;
    const C_THB = 118;
    const C_TND = 119;
    const C_TOP = 120;
    const C_TRY = 121;
    const C_TTD = 122;
    const C_TVD = 123;
    const C_TWD = 124;
    const C_TZS = 125;
    const C_UAH = 126;
    const C_UGX = 127;
    const C_USD =   1;
    const C_UYU = 128;
    const C_UZS = 129;
    const C_VEF = 130;
    const C_VND = 131;
    const C_VUV = 132;
    const C_WST = 133;
    const C_XAF = 134;
    const C_XCD = 135;
    const C_XOF = 136;
    const C_XPF = 137;
    const C_YER = 138;
    const C_ZAR = 139;
    const C_ZMW = 140;  
}
			

PaymentStatus

Enumeration Value Remarks
Pending 10
ApprovalPending 20
Paid 30
PaidUnexpectedAmount 31
PaidCancelledPayment 32
PaidExpiredPayment 33
Cancelled 40
Failed 50
Rejected 60
Expired 70
Refunded 80
Reserved 90
HostedInitiated 100
HostedExpired 110
Reversed 200

namespace PayCheckout
{
	public enum PaymentStatus
	{
  		Pending					= 10, 
 		ApprovalPending			= 20,
		Paid					= 30,
		PaidUnexpectedAmount	= 31,	// Introduced from version 1.2.0.1. and higher
		PaidCancelledPayment	= 32,	// Introduced from version 1.2.0.1. and higher
		PaidExpiredPayment		= 33,	// Introduced from version 1.2.0.1. and higher
		Cancelled				= 40,
		Failed					= 50,
		Rejected				= 60,
		Expired					= 70,
		Refunded				= 80,
		Reserved				= 90,
		HostedInitiated			= 100,
		HostedExpired			= 110,
		Reversed				= 200
	}
}

<?php
				 	
namespace PayCheckout;
    
class PaymentStatus
{
    const PENDING			        = 10;
    const APPROVAL_PENDING          = 20;
    const PAID			            = 30;
	const PAID_UNEXPECTED_AMOUNT    = 31;	// Introduced from version 1.2.0.1. and higher
	const PAID_CANCELLED_PAYMENT    = 32;	// Introduced from version 1.2.0.1. and higher
	const PAID_EXPIRED_PAYMENT      = 33;	// Introduced from version 1.2.0.1. and higher
    const CANCELLED		            = 40;
    const FAILED			        = 50;
    const REJECTED		            = 60;
    const EXPIRED			        = 70;
    const REFUNDED                  = 80;
    const RESERVED                  = 90;
    const HOSTED_INITIATED          = 100;
    const HOSTED_EXPIRED            = 110;
}
			

ApiAction

Enumeration Value
Payment 0
StatusRequest 10
Notify 1000
CancelOrder 2000
UpdateOrder 2001
Refund 3000
GetPaymentInfo 4000
GetTransactionInfo 4001
GetCurrentConfiguration 4010
KlarnaUpdatePClasses 10000
KlarnaAccountGetInstallmentsInfo 10001
KlarnaGetAddresses 10002
KlarnaHasAccount 10003
IDealGetDirectory 11000
Customer_Insert 30000
Customer_Update 30010
Customer_Get 30020
Customer_AddBankAccount 30100
Customer_Mandate_Core_GetDirectory 30200
Customer_Mandate_Core_Add 30210
Customer_Mandate_Core_Alter 30220
Customer_Mandate_B2B_GetDirectory 30300
Customer_Mandate_B2B_Alter 30320
Customer_Mandate_B2B_Cancel 30330
Customer_SEPA_DirectDebit 30400
SplitOutpayment_AddOutpayment 40000
SplitOutpayment_CancelOutpayment 40010
SplitOutpayment_AddCollect 40020
SplitOutpayment_CancelCollect 40030
				 	
namespace PayCheckout
{
	public enum ApiAction
	{
		NotSpecified						= -1,
		Payment								= 0,
		StatusRequest						= 10,
		Notify								= 1000,
		ManualNotify						= 1001,
		GetLastNotificationContent			= 1002,
		CancelOrder							= 2000,
		UpdateOrder							= 2001,
		Refund								= 3000,
		IncludedInSEPAbatch					= 3001,

		// Queries
		GetPaymentInfo						= 4000,
		GetTransactionInfo					= 4001,
		GetCurrentConfiguration				= 4010,
		GetAvailablePaymentMethods			= 4020,
		GetModuleVersion					= 4030,

		// Payment Specific functions
		KlarnaUpdatePClasses				= 10000,
		KlarnaAccountGetInstallmentsInfo	= 10001,
		KlarnaGetAddresses					= 10002,
		KlarnaHasAccount					= 10003,
		IDealGetDirectory					= 11000,

		// Customer Api
		Customer_Insert						= 30000,
		Customer_Update						= 30010,
		Customer_Get						= 30020,

		// Customer bankaccount
		Customer_AddBankAccount				= 30100,

		// Customer Mandates Core
		Customer_Mandate_Core_GetDirectory	= 30200,
		Customer_Mandate_Core_Add			= 30210,
		Customer_Mandate_Core_Alter			= 30220,

		// Customer Mandates B2B
		Customer_Mandate_B2B_GetDirectory	= 30300,
		Customer_Mandate_B2B_Add			= 30310,
		Customer_Mandate_B2B_Alter			= 30320,
		Customer_Mandate_B2B_Cancel			= 30330,

		// Customer SEPA direct debit
		Customer_SEPA_Direct_Debit			= 30400,

		// SplitOutpayment Api
		SplitOutpayment_AddOutpayment		= 40000,
		SplitOutpayment_CancelOutpayment	= 40010,
		SplitOutpayment_AddCollect			= 40020,
		SplitOutpayment_CancelCollect		= 40030,
	}
}

<?php
				 	
namespace PayCheckout;
    
class ApiAction
{
	const NOTSPECIFIED							= -1;
    const PAYMENT                               = 0; 
    const STATUSREQUEST                         = 10;
    
    const NOTIFY                                = 1000;
    const MANUAL_NOTIFY                         = 1001;
    const GET_LAST_NOTIFICATION_CONTENT         = 1002;
    
    const CANCEL_ORDER                          = 2000;
    const UPDATE_ORDER                          = 2001;
    
    const REFUND                                = 3000;
    const INCLUDED_IN_SEPA_BATCH                = 3001;
    
    // Queries
	const GET_PAYMENT_INFO					    = 4000;
	const GET_TRANSACTION_INFO        		    = 4001;
    
    const GET_CURRENT_CONFIGURATION             = 4010;
    const GET_AVAILABLE_PAYMENT_METHODS         = 4020;
    const GET_MODULE_VERSION                    = 4030;
    
	// Payment Specific functions
    const KLARNA_UPDATE_P_CLASSES               = 10000;
    const KLARNA_ACCOUNT_GET_INSTALLMENTS_INFO  = 10001;
    const KLARNA_GET_ADDRESSES					= 10002;
	const KLARNA_HAS_ACCOUNT                	= 10003;
    
    const IDEAL_GET_DIRECTORY                   = 11000;

	// Customer Api
	const CUSTOMER_INSERT                       = 30000;
	const CUSTOMER_UPDATE                       = 30010;
	const CUSTOMER_GET                          = 30020;

    // Customer bankaccount
	const CUSTOMER_ADDBANKACCOUNT               = 30100;

	// Customer MandateCore
	const CUSTOMER_MANDATE_CORE_GETDIRECTORY    = 30200;
	const CUSTOMER_MANDATE_CORE_ADD             = 30210;
	const CUSTOMER_MANDATE_CORE_ALTER           = 30220;

	// Customer MandateB2B
	const CUSTOMER_MANDATE_B2B_GETDIRECTORY     = 30300;
	const CUSTOMER_MANDATE_B2B_ADD              = 30310;
	const CUSTOMER_MANDATE_B2B_ALTER            = 30320;
	const CUSTOMER_MANDATE_B2B_CANCEL           = 30330;

	// Customer SEPA Direct debit
	const CUSTOMER_SEPA_DIRECT_DEBIT			= 30400;
 
	// SplitOutpayment Api
	const SPLITOUTPAYMENT_ADDOUTPAYMENT 		= 40000;
	const SPLITOUTPAYMENT_CANCELOUTPAYMENT      = 40010;
	const SPLITOUTPAYMENT_ADDCOLLECT            = 40020;
	const SPLITOUTPAYMENT_CANCELCOLLECT         = 40030;
}
								

ApiResult

Enumeration Value
Success 0
PartialOk 1
Failed 2

namespace PayCheckout
{
	public enum ApiResult
	{
		Success     = 0,
		PartialOk   = 1,
		Failed      = 2
	}
}

<?php
				 	
namespace PayCheckout;

class ApiResult
{
    const SUCCESS       = 0;
    const PARTIAL_OK    = 1;
    const FAILED        = 2;
}
			

TransactionStatus

Enumeration Value Remarks
Pending 10
ApprovalPending 20
Paid 30
Cancelled 40
Failed 50
Rejected 60
Expired 70
Refunded 80
Reserved 90
Reversed 200
ApiSuccess 1000
ApiPartialOk 1010
ApiFailed 1020

namespace PayCheckout
{
	public enum TransactionStatus
	{
		Pending                 = 10,
 		ApprovalPending         = 20,
		Paid                    = 30,
		Cancelled               = 40,
		Failed                  = 50,
		Rejected                = 60,
		Expired                 = 70,
		Refunded                = 80,
		Reserved                = 90,
        Reversed                = 200,
		ApiSuccess              = 1000,
		ApiPartialOk            = 1010,
		ApiFailed               = 1020
	}
}

<?php
				 	
namespace PayCheckout;
    
class TransactionStatus
{
    const PENDING                 = 10;
    const APPROVAL_PENDING        = 20;
    const PAID                    = 30;
    const CANCELLED               = 40;
    const FAILED                  = 50;
    const REJECTED                = 60;
    const EXPIRED                 = 70;
    const REFUNDED                = 80;
    const RESERVED                = 90;
    const REVERSED                = 200;
    const API_SUCCESS             = 1000;
    const API_PARTIAL_OK          = 1010;
    const API_FAILED              = 1020;
}
			

Gender

Enumeration Value
Female 0
Male 1

namespace PayCheckout
{
	public enum Gender
	{
		Female  = 0,
		Male    = 1
	}
}

<?php
				 	
namespace PayCheckout;

class Gender
{
    const FEMALE    = 0;
    const MALE      = 1;
}
			

IdentityType

Enumeration Value
Unknown 0
Person 1
Organisation 2

namespace PayCheckout
{
	public enum IdentityType
	{
		Unknown         = 0,
		Person          = 1,
		Organisation    = 2
	}
}

<?php
				 	
namespace PayCheckout;

class IdentityType
{
    const UNKNOWN       = 0;
    const PERSON        = 1;
    const ORGANISATION  = 2;
}
			

ItemType

Enumeration Value
Article 0
ShippingCost 1
PaymentCost 2
Discount 3
AdditionalCost 4
RefundCost 5

namespace PayCheckout
{
	public enum ItemType
	{
		Article         = 0,
		ShippingCost    = 1,
		PaymentCost     = 2,
		Discount        = 3,
		AdditionalCost  = 4,
		RefundCost      = 5,
	}
}

<?php
				 	
namespace PayCheckout;
    
class ItemType
{
    const ARTICLE           = 0; 
    const SHIPPING_COST     = 1;
    const PAYMENT_COST      = 2;
    const DISCOUNT          = 3;
    const ADDITIONAL_COST   = 4;
    const REFUND_COST       = 5;
}
			

ErrorCode

Enumeration Value Remark
CanNotConnectWithPayCheckout 1000
PayCheckoutApiCallTimedOut 1001
PayCheckoutApiCallInvalidResponse 1002
PayCheckoutApiCallResponseCompromised 1003
RequestContentSecurityValidationFailed 2001
RequestContentValidationFailed 2002
RequestErrorProcessingResultFromRemoteParty 2003
RequestProcessingEncounteredDatabaseProblem 2004
RequestNoSuitablePaymentMethodsFound 2500
NotAbleToConnectToRemoteParty 3000
RemotePartyResponseTimeout 3001
RemotePartyReportsValidationFailed 3002
RemotePartyReportsSecurityValidationFailed 3003
RemotePartyReportsMaintenance 3004
RemotePartyReportsBusyTryAgainLater 3005
RemotePartyReportsInternalError 3006
RemotePartyReportsCustomerNotAccepted 3007
RemotePartyReportsInsufficientFunds 3008
RemotePartyReportsCommunicationProblemThirdParty 3009
RemotePartyReportsUnspecified 3010
PaymentStatusNotValid_AlreadyPaid 4000
PaymentStatusNotValid_Expired 4001
PaymentStatusNotValid_Cancelled 4002
PaymentStatusNotValid_Rejected 4003
PaymentDataInCompleteOrUnknown 4010
PaymentTypeNotAllowedToRunLive 4011
PaymentTypeNotConfigured 4012
PaymentTypeConfiguredNotAllowed 4013

namespace PayCheckout
{
	public enum ErrorCode
	{
		// Connection problems with PayCheckout system client side
		CanNotConnectWithPayCheckout                     = 1000,
		PayCheckoutApiCallTimedOut                       = 1001,
		PayCheckoutApiCallInvalidResponse                = 1002,
		PayCheckoutApiCallResponseCompromised            = 1003,
	
		// Server generated error on content supplied
		RequestContentSecurityValidationFailed           = 2001,
		RequestContentValidationFailed                   = 2002,
		RequestErrorProcessingResultFromRemoteParty      = 2003,
		RequestProcessingEncounteredDatabaseProblem		 = 2004,
	
		// GetAvailablePaymentMethod specific
		RequestNoSuitablePaymentMethodsFound             = 2500,
	
		// Connected party issues
		NotAbleToConnectToRemoteParty                    = 3000,
		RemotePartyResponseTimeout                       = 3001,
		RemotePartyReportsValidationFailed               = 3002,
		RemotePartyReportsSecurityValidationFailed       = 3003,
		RemotePartyReportsMaintenance                    = 3004,
		RemotePartyReportsBusyTryAgainLater              = 3005,
		RemotePartyReportsInternalError                  = 3006,
		RemotePartyReportsCustomerNotAccepted            = 3007,
		RemotePartyReportsInsufficientFunds              = 3008,
		RemotePartyReportsCommunicationProblemThirdParty = 3009,
		RemotePartyReportsUnspecified                    = 3010,
	
		// Payment specific issues
		PaymentStatusNotValid_AlreadyPaid                = 4000,
		PaymentStatusNotValid_Expired                    = 4001,
		PaymentStatusNotValid_Cancelled                  = 4002,
		PaymentStatusNotValid_Rejected                   = 4003,
		PaymentDataInCompleteOrUnknown                   = 4010,
		PaymentTypeNotAllowedToRunLive                   = 4011,
		PaymentTypeNotConfigured                         = 4012,
		PaymentTypeConfiguredNotAllowed                  = 4013,
	}
}

<?php
	
namespace PayCheckout;

class ErrorCode
{
    // Connection problems with PayCheckout system client side
    const CAN_NOT_CONNECT_WITH_PAY_CHECKOUT                     = 1000;
    const PAY_CHECKOUT_API_CALL_TIMED_OUT                       = 1001;
    const PAY_CHECKOUT_API_CALL_INVALID_RESPONSE                = 1002;
    const PAY_CHECKOUT_API_CALL_RESPONSE_COMPROMISED            = 1003;
    
    // Server generated error on content supplied
    const REQUEST_CONTENT_SECURITY_VALIDATION_FAILED            = 2001;
    const REQUEST_CONTENT_VALIDATION_FAILED                     = 2002;
    const REQUEST_ERROR_PROCESSING_RESULT_FROM_REMOTE_PARTY     = 2003;
	const REQUEST_PROCESSING_ENCOUNTERED_DATABASE_PROBLEM		= 2004;
    
    // GetAvailablePaymentMethod specific
    const REQUEST_NO_SUITABLE_PAYMENTMETHOD_FOUND               = 2500;
    
    // Connected party issues
    const NOT_ABLE_TO_CONNECT_TO_REMOTE_PARTY                   = 3000;
    const REMOTE_PARTY_RESPONSE_TIME_OUT                        = 3001;
    const REMOTE_PARTY_REPORTS_VALIDATION_FAILED                = 3002;
    const REMOTE_PARTY_REPORTS_SECURITY_VALIDATION_FAILED       = 3003;
    const REMOTE_PARTY_REPORTS_MAINTENANCE                      = 3004;
    const REMOTE_PARTY_REPORTS_BUSY_TRY_AGAIN_LATER             = 3005;
    const REMOTE_PARTY_REPORTS_INTERNAL_ERROR                   = 3006;
    const REMOTE_PARTY_REPORTS_CUSTOMER_NOT_ACCEPTED            = 3007;
    const REMOTE_PARTY_REPORTS_INSUFFICIENTFUNDS                = 3008;
    const REMOTE_PARTY_REPORTS_COMMUNICATION_PROBLEM_THIRDPARTY = 3009;
    const REMOTE_PARTY_REPORTS_UNSPECIFIED                      = 3010;
    
    // Payment specific issues
    const PAYMENT_STATUS_NOT_VALID_ALREADY_PAID                 = 4000;
    const PAYMENT_STATUS_NOT_VALID_EXPIRED                      = 4001;
    const PAYMENT_STATUS_NOT_VALID_CANCELLED                    = 4002;
    const PAYMENT_STATUS_NOT_VALID_REJECTED                     = 4003;
    const PAYMENT_DATA_IN_COMPLETE_OR_UNKNOWN                   = 4010;
    const PAYMENT_TYPE_NOT_ALLOWED_TO_RUN_LIVE                  = 4011;
    const PAYMENT_TYPE_NOT_CONFIGURED                           = 4012;
    const PAYMENT_TYPE_CONFIGURED_NOT_ALLOWED                   = 4013;
}
					

AccountAction

Enumeration Value
NoAction 0
CancelOrder 1
ChangeOrder 2
CreateInvoice 4
ItemRefund 8
Refund 16

namespace PayCheckout
{
	public enum AccountAction
	{
		NoAction            = 0,
		CancelOrder         = 1,
		ChangeOrder         = 2,
		CreateInvoice       = 4,
		ItemRefund          = 8,
		Refund              = 16,
	}
}

<?php
				 	
namespace PayCheckout;

class AccountAction
{
	const NO_ACTION       = 0;
	const CANCEL_ORDER    = 1;
	const CHANGE_ORDER    = 2;
	const CREATE_INVOICE  = 4;
	const ITEM_REFUND     = 8;
	const REFUND          = 16;
}
			

KlarnaInstallmentCalculationTarget

Enumeration Value
OnCheckoutPage 0
OnProductPage 1

namespace PayCheckout.Api.Service
{
	public class KlarnaAccountGetInstallmentsInfo
	{
		public enum KlarnaInstallmentCalculationTarget
		{
			OnCheckoutPage  = 0,
			OnProductPage   = 1
		};
}

<?php
				 	
namespace PayCheckout\Api\Service\Klarna;

class KlarnaInstallmentCalculationTarget
{
    const ON_CHECKOUT_PAGE  = 0;
    const ON_PRODUCT_PAGE   = 1;
}			

NotificationType

Enumeration Value
PaymentStatusChange 0
RefundInformation 10
OrderChange 20
MandateStatusChange 30
VerifiedBankAccount 40

namespace PayCheckout
{
	public enum NotificationType
	{
		PaymentStatusChange = 0
		RefundInformation   = 10,
		OrderChange         = 20,
		MandateStatusChange	= 30,
		VerifiedBankAccount = 40,
	}
}

<?php
				 	
namespace PayCheckout;

class NotificationType
{
    const PAYMENT_STATUS_CHANGE = 0;
    const REFUND_INFORMATION    = 10;
    const ORDER_CHANGE          = 20;
    const MANDATE_STATUS_CHANGE = 30;
	const VERIFIED_BANK_ACCOUNT = 40;
}
			

PaymentFlag

Enumeration Value
NotSet 0
Deposit 1
Distributed 2
SplitOutpayment 4

namespace PayCheckout
{
	public enum PaymentFlag
	{
		NotSet			= 0,
		Deposit			= 1,
		Distributed		= 2,
		SplitOutpayment = 4,
	}
}

<?php
				 	
namespace PayCheckout;

class PaymentFlag
{
    const NOTSET            = 0;
    const DEPOSIT           = 1;
    const DISTRIBUTED       = 2;
    const SPLITOUTPAYMENT   = 4;
}
			

CreditcardBrand

Enumeration Value
Maestro 1
Mastercard 2
Visa 4
Amex 8

namespace PayCheckout
{
	public enum CreditCardBrand
	{
		Maestro		= 1, // Setup so that brands can be masked
		MasterCard	= 2,
		Visa		= 4,
		Amex		= 8,
	}
}

<?php
				 	
namespace PayCheckout;

class CreditcardBrand
{
    const MAESTRO           = 1;
    const MASTERCARD        = 2;
    const VISA              = 4;
    const AMEX              = 8;
}
			

Google Analytics

PayCheckout makes it possible to track goals, events, conversions and e-commerce transactions in Google Analytics. In order to enable cross domain tracking you need to follow the setup below.

Setup

In order to enable cross domain tracking you need to supply PayCheckout with the Google Analytics Client ID of the user. This value is only available through the Google Analytics JS API. PayCheckout supplies a small javascript-file which grabs all the active Google Analytics trackers and their corresponding Client IDs and stores this information in a session cookie. This cookie can then be read when you create an API message.

  • Add <script src="https://secure.paycheckout.com/js/gapco.min.js"></script> just before your </body>-tag in your HTML on every page.
  • Use the value of the _gapco cookie as a parameter in the PayCheckout API message. (see code example)
  • Be sure to add your Google Analytics Tracking-ID (e.g. US-12345678-1) in the PayCheckout portal under your website.
  • Add the domainname paycheckout.com to the Referral Exclusion List in Google Analytics.
  • It is also recommended to list the domainnames in your reports. For more information visit https://support.google.com/analytics/answer/1034342?hl=en#Next

if (Request.Cookies["_gapco"] != null)
{
	apiMessage.Payment_AddParameter("GoogleAnalyticsData", Request.Cookies["_gapco"]);
}
			

<?php
if (isset($_COOKIE['_gapco']))
{
	$apiMessage->payment_addParameter('GoogleAnalyticsData', $_COOKIE['_gapco']);
}
			

Events

PayCheckout sends several events to the Google Analytics API on different occurences.

Category Action Label Value Occurrence
PayCheckout PaymentMethod [method name]
(e.g. iDEAL)
none When the user selects a Payment Method on the hosted page.
PayCheckout PaymentStatus [status]
(e.g. Paid (iDEAL))
none When there is feedback from the Payment method regarding the payment status.
PayCheckout PaymentComplete none none When the payment reaches the paid or reserved status.
Transaction information is sent along with this event.

Payments

In the next part we describe how to make payments. Each payment is identified with a unique PaymentReference and all actions that are related to the payment will be registered against this PaymentReference.

It is possible to override the return URLs specified in the portal. You can do this for each payment, by calling the Payment_OverrideConfiguredReturnUrls method.

Generic

NOTE: This apicall is depricated, do not use in new implementations, use hosted instead.

Scenario: We have a website and the website is using an order system. After the user has entered information you call "GetAvailablePaymentMethods". You show the available payment options to your customer. When he/she has chosen a payment method you call the payment function "Generic". If you know specific payment details of the payment method you specify these using the key/value parameter capability. For example if you happen to know which bank the customer wants to use for an iDEAL payment you can supply this by specifying "IssuingBank"=>"ABNANL2A" as a parameter. If specific information is mandatory for the payment method a redirect link will be returned showing a hosted page to let the user supply the missing payment specific information.

In this scenario the transaction environment will decide if it can execute the payment directly or has to offer a hosted page to allow the user to enter additional mandatory information. The webshop application must be prepared to handle both responses, if a redirectlink is offered the user should be redirected to that link or else if the status is success the payment has succeeded. Be aware that for some payment methods a success may indicate that the actual status is "waiting for approval" so you may not assume a successfull payment has occurred.

Use the API function:

PayCheckout. Api. Payment. Generic

Create an ApiMessage with the following parameters:

Name Required Type Description Limits
PaymentMethod Yes PaymentMethod Payment method to be used Must be one of the PaymentMethod enumerations.
MerchantOrderReference Yes String Corresponding order in merchants system Depending on selected method (See individual payment methods) a good length limit is 35.
Description Yes String Description of order Depending on selected method (See individual payment methods) a good length limit is 35. If you enter a string containing one or more spaces only, the description will be excluded from the Transaction summary.
Amount Yes Integer Amount converted to an integer value 1..2147483647. (Maximum order amounts can be limited by the chosen payment method)
Currency Yes Currency (class) Currency used in the order. Limited by the payment methods selected
CustomerIpAddress Yes String The customer's IP address Must be a valid public IP address.
ConfiguredCultureOverride No String If you want to use a different culture than configured for the webshop, specify it here. When null use the Culture that has been configured for the webshop. In case the specified culture is not supported it is defaulted to value configured for the webshop.
ExpiryTimeInMinutesOverride No Integer (nullable) Specify the expiry time of the hosted payment in minutes if you want to override the webshop configured value. When null, zero or less than zero the value has no effect and the value configured for the webshop will be used. Range 1..259200 minutes (180 days)
Parameters No AssociatedArray (PHP), Dictionary<String,String> (C#) Specify key/value data for specific payments (See table) Key and Value must both be strings.

Payment specific key/value parameters (keys are not case sensitive) For a list of available options see ApiMessage methods, Add parameter

After the payment is created you may execute the message. If no errors are reported you can now redirect the user of your webshop to the "RedirectInfo" returned in the ApiResponse message, or if no redirect info is returned analyse the response message for payment information/status. If an error occurs check the ApiResponse errors to analyse what went wrong.

If your payment results in a hosted page being displayed you can override the configured expiration time of the hosted payment by specifying a value for the parameter "expiryTimeInMinutesOverride". For example, when you create a "PaymentLink" you want to send by E-mail, you probably want a longer expiration time then for a webshop initiated payment.

If no expiration time is configured in the portal for hosted payments, hosted payments never expire. When an expiration time is set by an override or configured in the portal the hosted payment is set to expire. Expiration is examined the first time 10 seconds after the expected expiration time. Further examination is done with progressive intervals. When polled for expiry and no payments are pending the hosted payment will expire at that point and a notification will be send to the webshop. When payments are pending the hosted payment will not expire until all pending payments have reached a final state. When all pending payments are cancelled or have expired by their own when being polled and the expiration period of the hosted payment has been reached the hosted payment will become expired. If there were no pending payments and none of the payments were successfull the hosted payment will expire at that point when polled for expiry.

When the user finishes the payment or decides to return to the webshop to change the order, the user is redirected from our transaction system to the appropriate redirect url of the webshop, with the following query parameters added to the url.

Name Description
MerchantReference Reference supplied at the start of the payment.
PayCheckoutReference The payment reference that has been assigned to this payment. Value can be used to retrieve all relevant data about this payment.
PayCheckoutTrace The trace reference that can be used to view in detail what has happened with this payment.
PaymentStatus A string representing one of the possible payment statuses as defined in the PaymentStatus enumeration.

A lot of users don't make the effort to return to the webshop, although they have paid the order. Don't worry, this is handled too.

If the selected payment is an iDEAL transaction then the transaction system will query the iDEAL system for status changes on a schedule as defined by the iDEAL specification. When the transaction system discovers a state as Paid, Expired or Cancelled it will send a Notification message with a "PaymentStatus" to the webshop to inform the webshop of this status change. A notification will always be sent if the payment results in a finalized state.


using System;

using System.Collections.Generic;
{
	// Prepare the Generic payment with iDEAL (do not override configured webshop values for expiration and culture)
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.Generic.Create(
        PayCheckout.PaymentMethod.iDEAL,
        "Order-66092",
		"PayCheckout inzake WebShop",
		85000,
		PayCheckout.Currency.EUR,
        "212.11.22.34");

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		emailAddress:"youremail@email.com",
		phoneNumber:"0612345678");

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		phoneNumber:"0612345678");

	// Set CustomerOrderNumber and/or CustomerNote
	apiMessage.Payment_SetOrderInfo("Inkoop order:20150101","Graag met spoed");

	// Add order item info
	apiMessage.Payment_AddOrderItem(
		0,
		"fiets",
		"luxe fiets",
		1,0,0,0,
		70248,
		85000,
		2100,
		Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(
		8,
		"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",
		true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, test if we should redirect etc..
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare the Generic iDEAL payment (no override of webshop configured values)
$apiMessage = PayCheckout\Api\Payment\Generic::create(\PayCheckout\PaymentMethod::IDEAL,'Order-5826','PayCheckout inzake WebShop',85000,PayCheckout\Currency::EUR,'212.12.33.4',null,null,null);

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null);

// Set CustomerOrderNumber and/or CustomerNote
$apiMessage->payment_setOrderInfo('Inkoop order:20150102','Graag met spoed leveren');

// Add order item info
$apiMessage->payment_addOrderItem(0,"Fiets","Luxe fiets",1,0,0,0,70248,85000,2100,PayCheckout\ItemType::ARTICLE,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, test if we should redirect etc..
}
else
{
	// Analyze why it failed
}
 

iDEAL (without order info)

NOTE: This apicall is depricated, do not use in new implementations, use hosted instead.

Scenario: We have a website and don't want to keep order records. We simply want to be able to perform iDEAL payments. In this situation you can use the most elementary form of paying by iDEAL. We do not advise to use this simple scenario as finding payments later on is very restricted because not much is known about the payment. Also management info is limited due to a lack of information to show.

Use the API function:

PayCheckout. Api. Payment. IDeal. Create

Create an ApiMessage with the following parameters:

Name Required Type Description Limits
merchantOrderReference Yes String Corresponding order in merchants system Max length is 35 chars
description Yes String Description of order Max length is 35 chars
amount Yes Integer Amount in cents Allowed 1 - 5000000 Max (Eur 50.000,--)
issuingBankBIC Yes String BIC code of issuing bank Must be one of the BankBIC codes returned from a call to service IDealGetDirectory
customerIpAddress Yes String The customer's IP address Must be a valid public IP address.
configuredCultureOverride No String if you want to use a different culturename than you have configured for the webshopId When null use the Culture that has been configured for the webshop. In case the specified culture is not supported it is defaulted to value configured for the webshop.
enforceNoVat No Bool (C#) String (other) Can only be true or false (null in PHP is allowed too) When set to true enforces configured surcharges to be calculated without VAT and validates order items do not have VAT applied.

After the payment is created you may execute the message. If no errors are reported you can now redirect the user of your webshop to the "RedirectInfo" returned in the ApiResponse message. If an error occurs and the ApiResponse class contains a valid string in the field "ErrorToShowToConsumer" you should show this to the user. This is a requirement for iDEAL implementations!

If the user presses the return to webshop button in the iDEAL environment the user is redirected to our transaction system and then redirected to the configured url of the webshop, with the following query parameters added to the url.

Name Description
MerchantReference Reference supplied at the start of the payment.
PayCheckoutReference The payment reference that has been assigned to this payment. Value can be used to retrieve all relevant data about this payment.
PayCheckoutTrace The trace reference that can be used to view in detail what has happened with this payment.
PaymentStatus A string representing one of the possible payment statuses as defined in the PaymentStatus enumeration.

A lot of users don't make the effort to return to the webshop, although they have paid the order. Don't worry, this is handled too.

As soon as the iDEAL transaction is started the transaction system will query the iDEAL system for status changes on a schedule as defined by the iDEAL specification. When the transaction system discovers a state as Paid, Expired or Cancelled it will send a Notification message with a "PaymentStatus" to the webshop to inform the webshop of this status change.


using System;

using System.Collections.Generic;
{
	// Prepare the iDEAL payment (100,50 Euro)
	PayCheckout.ApiMessage apiCall = PayCheckout.Api.Payment.IDeal.Create(
		"Order-76686",
		"PayCheckout inzake WebShop",
		10050,
		"RABONL2U",
        "10.10.10.100");

	// Create an executor instance supply webshopid and encryption password
	// specify we want to do a sandbox payment (true)
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(
		8,
		"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",
		true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiCall);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, test if we should redirect etc..
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare the IDeal payment (Eur 100,50)
$apiMessage = PayCheckout\Api\Payment\IDeal::create(
	'Order-76686',
	'PayCheckout inzake WebShop',
	10050,
	'RABONL2U',
    '10.10.10.100');

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(
	8,
	'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',
	true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, test if we should redirect etc..
}
else
{
	// Analyze why it failed
}

iDEAL (with order info)

NOTE: This apicall is depricated, do not use in new implementations, use hosted instead.

Scenario: We have a website and the website uses an order system. Supplying the order info is useful as this allows good searching capabilities of the payment in case there are questions. Also management information will be more extensive. This is the best and advised way of implementing iDEAL payments.

Use the API function:

PayCheckout. Api. Payment. IDeal. Create

Create the ApiMessage with the following parameters:

Name Required Type Description Limits
merchantOrderReference Yes String Corresponding order in merchants system Max length is 35 chars
description Yes String Description of order Max length is 35 chars
amount Yes Integer Amount in cents Allowed 1 - 5000000 Max (Eur 50.000,--)
issuingBankBIC Yes String BIC code of issuing bank Must be one of the BankBIC codes returned from a call to service IDealGetDirectory
customerIpAddress Yes String The customer's IP address Must be a valid public IP address.
configuredCultureOverride No String if you want to use a different culturename than you have configured for the webshopId When null use the Culture that has been configured for the webshop. In case the specified culture is not supported it is defaulted to value configured for the webshop.
enforceNoVat No Bool (C#) String (other) Can only be true or false (null in PHP is allowed too) When set to true enforces configured surcharges to be calculated without VAT and validates order items do not have VAT applied.

After the payment is created you enrich the ApiMessage with the order info by calling the methods for adding billing, shipping, info and items. For an iDEAL payment no special requirements or limitations apply for supplying orderinformation. Just simply supply the system with what you know. You may call the methods for adding information to an order in any order. To fill order information there are four methods available to supply order information:

After creation of the payment you may execute the message. If no errors are reported you can now redirect the user of your webshop to the "RedirectInfo" returned in the ApiResponse message. If an error occurs and the ApiResponse class contains a valid string in the field "ErrorToShowToConsumer" you should show this to the user. This is a requirement for iDEAL implementations!

If the user presses the return to webshop button in the iDEAL environment the user is redirected to our transaction system and then redirected to the configured url of the webshop, with the following query parameters added to the url.

Name Description
MerchantReference Reference supplied at the start of the payment.
PayCheckoutReference The payment reference that has been assigned to this payment. Value can be used to retrieve all relevant data about this payment.
PayCheckoutTrace The trace reference that can be used to view in detail what has happened with this payment.
PaymentStatus A string representing one of the possible paymentstatuses as defined in the PaymentStatus enumeration.

A lot of users don't make the effort to return to the webshop, although they have paid the order. Don't worry, this is handled too.

As soon as the iDEAL transaction is started the transaction system will query the iDEAL system for status changes on a schedule as defined by the iDEAL specification. When the transaction system discovers a state as Paid, Expired or Cancelled it will send a Notification message with a "PaymentStatus" to the webshop to inform the webshop of this status change.


using System;

using System.Collections.Generic;
{
	// Prepare the iDEAL payment
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.IDeal.Create(
		"Order-68987",
		"PayCheckout inzake WebShop",
		85000,
        "RABONL2U",
        "10.10.10.100");

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		emailAddress:"youremail@email.com",
		phoneNumber:"0612345678");

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		phoneNumber:"0612345678");

	// Set CustomerOrderNumber and/or CustomerNote
	apiMessage.Payment_SetOrderInfo("Inkoop order:20150101","Graag met spoed");
	// Add order item info
	apiMessage.Payment_AddOrderItem(
		0,
		"fiets",
		"luxe fiets",
		1,0,0,0,
		70248,
		85000,
		2100,
		Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(
		8,
		"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",
		true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, test if we should redirect etc..
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare the iDEAL payment
$apiMessage = PayCheckout\Api\Payment\IDeal::create(
	'Order-68987',
	'PayCheckout inzake WebShop',
	85000,
	'RABONL2U',
    '10.10.10.100');

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Piet','Janssen','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,null,'youremail@email.com',null,'0612345678',null,null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Piet','Janssen','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null,null);

// Set CustomerOrderNumber and/or CustomerNote
$apiMessage->Payment_setOrderInfo('Inkoop order:20150101','Graag met spoed');

// Add order item info
$apiMessage->payment_addOrderItem(0,"fiets","luxe fiets",1,0,0,0,70248,85000,2100,PayCheckout\ItemType::Article,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, test if we should redirect etc..
}
else
{
	// Analyze why it failed
}

Klarna Invoice

NOTE: This apicall is depricated, do not use in new implementations, use hosted instead.

Scenario: We have a website and the website uses an order system. You want to offer your customer a way to pay an order after it has been delivered instead of paying upfront. You have contacted Klarna and have received an Eid and Secret. In the sandbox you have added klarna as a payment method and have enabled Klarna invoice for the countries you are accepting orders from. Be aware that you can simplify entering billing and shipping information for Swedish customers by asking for their social security number during the checkout process (See service call KlarnaGetAddresses)

Use the API function:

PayCheckout. Api. Payment. KlarnaInvoice. Create

Create an ApiMessage with the following parameters:

Name Required Type Description Limits
merchantOrderReference Yes String Corresponding order in merchants system No known length limit
description Yes String Description of order No known length limit
amount Yes Integer Currency-dependent. For EUR: amount in Eurocents. For SEK, NOK, DKK: amount in Krones. Must be positive. Maximum order amounts are limited by and negotiated with Klarna Inc. May not be null.
currency Yes Currency (class) Currency used in the order. Allowed are EUR, SEK, NOK and DKK only. May not be null
customerIpAddress Yes String The customer's IP address Must be a valid public IP address.
enforceNoVat No Bool (C#) String (other) Can only be true or false (null in PHP is allowed too) When set to true enforces configured surcharges to be calculated without VAT and validates order items do not have VAT applied.

After the payment is created you enrich the ApiMessage with the order info by calling the methods for adding billing, shipping, info and items. Depending on your contract with Klarna, shipping address may be different than the billing address. See the supply order information calls for limitations and details on specific fields regarding Klarna.

You may call the methods for adding information to an order in any order. To fill order information there are four methods available to supply order information:

After executing the call, ApiResponse needs to be checked. First check the value of ApiResult, this should show "Success". If the status is "Success" this indicates we have a reservation result. This can be examined by the TransactionResult.Status value. If everything went well the status will show "Paid". In case the customer is under investigation the status can be "ApprovalPending". In this situation the transaction system will keep polling the status until a final state is detected. When the final state is known it will be communicated by sending a Notification with a "PaymentStatus" to the specified webshop url. In case ApiResult is failed, check the value of "ConsumerError", when this has a value show that error to the user.


using System;

using System.Collections.Generic;
{
	// Prepare the Klarna Invoice payment
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.KlarnaInvoice.Create(
		"Order-68987",
		"PayCheckout inzake WebShop",
		85000,
        Currency.EUR,
        "10.10.10.100");

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		emailAddress:"youremail@email.com",
		phoneNumber:"0612345678");

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress(
		"NL",
		"Piet",
		"Janssen",
		"Neherkade 1 XI",
		"2521VA",
		"'s Gravenhage",
		phoneNumber:"0612345678");

	// Set CustomerOrderNumber and/or CustomerNote
	apiMessage.Payment_SetOrderInfo("Inkoop order:20150101","Graag met spoed");

	// Add order item info
	apiMessage.Payment_AddOrderItem(
		0,
		"fiets",
		"luxe fiets",
		1,0,0,0,
		70248,
		85000,
		2100,
		Article);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(
		8,
		"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",
		true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, test if we should redirect etc..
	}
	else
	{
		// Analyze why it failed
	}
}

<?php
require_once('autoloader.php');

// Prepare the Klarna invoice payment
$apiMessage = PayCheckout\Api\Payment\KlarnaInvoice::create('Order-10100','PayCheckout inzake WebShop',85000,PayCheckout\Currency::EUR,'10.10.10.100');

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null);

// Set CustomerOrderNumber and/or CustomerNote
$apiMessage->payment_setOrderInfo('Inkoop order:20150101','Graag met spoed');

// Add order item info
$apiMessage->payment_addOrderItem(0,"fiets","luxe fiets",1,0,0,0,70248,85000,2100,PayCheckout\ItemType::ARTICLE,null,null);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, test if we should redirect etc..
}
else
{
	// Analyze why it failed
}

Klarna Account

NOTE: This apicall is depricated, do not use in new implementations, use hosted instead.

Scenario: We have a website and the website uses an order system. You want to offer your customer a way to pay an order after it has been delivered instead of paying upfront. You have contacted Klarna and have received an Eid and Secret. In the sandbox you have added Klarna as a payment method and have enabled Klarna invoice for the countries you are accepting orders from. Be aware that you can simplify entering billing and shipping information for Swedish customers by asking for their social security number during the checkout process (See service call KlarnaGetAddresses)

Before you can start a Klarna account payment you must fetch possible installments and let the user select the corresponding "PClassId" (See service call KlarnaAccountGetInstallmentsInfo). You can view this process in the demonstration program.

Use the API function:

PayCheckout. Api. Payment. KlarnaAccount. Create

Create an ApiMessage with the following parameters:

Name Required Type Description Limits
merchantOrderReference Yes String Corresponding order in merchants system No known length limit
description Yes String Description of order No known length limit
amount Yes Integer Currency-dependent. For EUR: amount in Eurocents. For SEK, NOK, DKK: amount in Krones. Must be positive. Maximum order amounts are limited by and negotiated with Klarna Inc. May not be null.
currency Yes Currency (class) Currency used in the order. Allowed are EUR, SEK, NOK and DKK only. May not be null.
customerIpAddress Yes String The customer's IP address Must be a valid public IP address.
pClassId Yes Integer PClassId of the installment option selected by the user Only use a PClassId that is selected from the collection returned from service call KlarnaAccountGetInstallmentsInfo
enforceNoVat No Bool (C#) String (other) Can only be true or false (null in PHP is allowed too) When set to true enforces configured surcharges to be calculated without VAT and validates order items do not have VAT applied.

After the payment is created you enrich the ApiMessage with the order info by calling the methods for adding billing, shipping, info and items. Depending on your contract with Klarna, shipping address may be different than the billing address. See the supply order information calls for limitations and details on specific fields regarding Klarna.

You may call the methods for adding information to an order in any order. To fill order information there are four methods available to supply order information:

After executing the call, ApiResponse needs to be checked. First check the value of ApiResult, this should show "Success". If the status is "Success" this indicates we have a reservation result. This can be examined by the TransactionResult.Status value. If everything went well the status will show "Paid". In case the customer is under investigation the status can be "ApprovalPending". In this situation the transaction system will keep polling the status until a final state is detected. When the final state is known it will be communicated by sending a Notification with a "PaymentStatus" to the specified webshop url. In case ApiResult is failed, check the value of "ConsumerError", when this has a value show that error to the user.


using System;
using System.Collections.Generic;
{
	// Fetch Klarna installments
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Service.KlarnaAccountGetInstallmentsInfo.Create("NL",EUR,85000);

	// Create an executor instance
	PayCheckout.ApiExecutor executor = new PayCheckout.ApiExecutor(8,"e8fe7ab6-8d39-4936-88dc-f27dd479bdcb",true);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, we can now retrieve the InstallmentInfo list
		List <PayCheckout.Api.Service.KlarnaAccountGetInstallmentsInfo.InstallmentInfo> listInstallments = PayCheckout.Api.Service.KlarnaAccountGetInstallmentsInfo.Response(response);
		if (listInstallments != null)
		{
			// Do something smart with the received installments
		}
	}
	else
	{
		// Analyze why it failed
	}

	// Prepare the Klarna account payment (Select first payment option)
	PayCheckout.ApiMessage apiMessage = PayCheckout.Api.Payment.KlarnaAccount.Create("Order-10100","PayCheckout inzake WebShop",85000,Currency.EUR,"10.10.10.100",listInstallments[0].PClassId);

	// Set order billing address info
	apiMessage.Payment_SetOrderBillingAddress("NL","Testperson-nl","Approved","Neherkade 1 XI","2521VA","'s Gravenhage",dateOfBirth:"10-07-1970",emailAddress:"youremail@email.com",gender:"Male",phoneNumber:"0612345678");

	// Set order shipping address info
	apiMessage.Payment_SetOrderShippingAddress("NL","Testperson-nl","Approved","Neherkade 1 XI","2521VA","'s Gravenhage",phoneNumber:"0612345678");

	// Set CustomerOrderNumber and/or CustomerNote
	apiMessage.Payment_SetOrderInfo("Inkoop order:20150101","Graag met spoed");

	// Add order item info
	apiMessage.Payment_AddOrderItem(0,"fiets","luxe fiets",1,0,0,0,70248,85000,2100,Article);

	// Execute the call and receive result
	PayCheckout.ApiResponse response = executor.Execute(apiMessage);

	// Analyze result
	if (response.ApiResult != PayCheckout.ApiResult.Failed)
	{
		// Success or Success with warning, test if we should redirect etc..
	}
	else
	{
		// Analyze why it failed
	}
}


<?php
require_once('autoloader.php');

// Fetch Klarna installments
$apiMessage = PayCheckout\Api\Service\KlarnaAccountGetInstallmentsInfo::create('NL',PayCheckout\Currency::EUR,85000);

// Create an executor instance
$apiExecutor = new PayCheckout\ApiExecutor(8,'e8fe7ab6-8d39-4936-88dc-f27dd479bdcb',true);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, we can now retrieve the InstallmentInfo list
	$installmentsData = PayCheckout\Api\Service\KlarnaAccountGetInstallmentsInfo::response($response);
}
else
{
	// Analyze why it failed
}

// Prepare the Klarna account payment using the first payment option offered
$apiMessage = PayCheckout\Api\Payment\KlarnaAccount::create('Order-10100','PayCheckout inzake WebShop',85000,PayCheckout\Currency::EUR,$installmentsData[0]->getPClassId());

// Set order billing address info
$apiMessage->payment_setOrderBillingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,DateTime::createFromFormat('d-m-Y','10-07-1970',new DateTimeZone('UTC')),'youremail@email.com',PayCheckout\Gender::MALE,'0612345678',null,null,null,null,null,null);

// Set order shipping address info
$apiMessage->payment_setOrderShippingAddress('NL','Testperson-nl','Approved','Neherkade 1 XI','2521VA','\'s Gravenhage',null,null,null,'0612345678',null,null);

// Set CustomerOrderNumber and/or CustomerNote
$apiMessage->payment_setOrderInfo('Inkoop order:20150101','Graag met spoed');

// Add order item info
$apiMessage->payment_addOrderItem(0,"fiets","luxe fiets",1,0,0,0,70248,85000,2100,PayCheckout\ItemType::ARTICLE,null,null);

// Execute the call and receive result
$response = $apiExecutor->execute($apiMessage);

// Analyze result
if ($response->getApiResult() != PayCheckout\ApiResult::FAILED)
{
	// Success or Success with warning, test if we should redirect etc..
}
else
{
	// Analyze why it failed
}