[go: nahoru, domu]

Authorisations

Authorisations require two steps to process a payment; an authorisation and a separate capture request to settle the funds. This is useful if you want to perform internal checks on your customer or the order itself prior to requesting the funds.

Use the “Defer” indicator with the Payment request to indicate that you only want to perform an authorisation. Funds can be settled using the Capture request or the authorisation can be voided using Cancel.

If you are using Cashier API, you will need to pass your customer to PayPal so they can logon. When you do that we suspend the transaction at Pay360. Once your customer has finished making their Payment at PayPal you will need to resume the transaction with us so we can complete our processing.

If you are using our Hosted Cashier, we will handle the customer redirect to PayPal for you. In order to achieve the best customer experience you may need to send us additional information depending on whether you redirect or iFrame the Hosted Cashier.

Both products allow the customer to return to the checkout (ours if you are using Hosted Cashier, yours if you are using the Cashier API) if they decide to Cancel the payment at PayPal.

Authorisations expire by default after 3 days. After this time, you won’t be able to Capture or Cancel the request.
API
API examples
PreAuth

POST /acceptor/rest/transactions/{instId}/payment
{
  "transaction": {
    "currency": "GBP",
    "amount": 1000,
    "description": "Sample Transaction",
    "merchantRef": "mer_txn_1234556",
    "commerceType": "MOTO",
    "channel": "WEB",
    "deferred": true
  },
  "paymentMethod": {
    "paypal": {
      "returnUrl": "http://merchant-returnUrl.com",
      "cancelUrl": "http://merchant-cancelUrl.com"
    }
  },
  "customer": {
    "merchantRef": "mer_cust_131241412",
    "displayName": "Mr O Whatasillyname",
    "billingAddress": {
      "line1": "Flat 1 ",
      "line2": "Cauldron house",
      "line3": "A Street",
      "line4": "Twertonia",
      "city": "Bath",
      "region": "Somerset",
      "postcode": "BA1 234",
      "countryCode": "GBR"
    },
    "email": "test@test.com",
    "telephone": "0123 456 789",
    "defaultCurrency": "GBP",
    "ip": "212.58.253.67"
  }
}

Response
HTTP/1.1 201
{
  "processing": {
    "authResponse": {
      "acquirerName": "PayPal",
      "correlationIds": [{
        "name": "SET",
        "value": "ad21dff6-faad-4fca-9d15-c90048b63336"
      }]
    },
    "route": "PAYPAL"
  },
  "clientRedirect": {
    "type": "REDIRECT",
    "url": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-19N35258J27922454&useraction=commit",
    "frame": "TOP"
  },
  "paymentMethod": {
    "paypal": {
      "checkoutToken": "e299e0b00cbd804cd50910706a9956471fde",
      "source": "PAYPAL",
      "bnCode": "bnCode1234"
    },
    "paymentClass": "PAYPAL"
  },
  "customFields": {
    "fieldState": []
  },
  "customer": {
    "id": "10503",
    "merchantRef": "mer_cust_131241412"
  },
  "transaction": {
    "transactionId": "13671062066",
    "deferred": true,
    "merchantRef": "mer_txn_1234556",
    "merchantDescription": "Sample Transaction",
    "status": "PENDING",
    "stage": "AUTHORISATION",
    "type": "PAYMENT_INITIALIZE",
    "amount": 1000.00,
    "consumerSpend": 0,
    "currency": "GBP",
    "transactionTime": "2020-01-31T14:35:48.309Z",
    "receivedTime": "2020-01-31T14:35:48.309Z"
  },
  "outcome": {
    "status": "SUCCESS",
    "reasonCode": "U103",
    "reasonMessage": "Suspended by PayPal"
  },
  "trace": "TEUr2eDAjQwP3ti1Aelg2Eg",
  "link": [{
    "rel": "transaction",
    "href": "https://api.mite.pay360.com/acceptor/rest/transactions/9999/999/13671062066"
  }]
}
API endpoint
endpoint: /acceptor/rest/transactions/{instId}/payment
method: POST
summary: process Payment

parameters:

Name
Data Type
Description
instId
The installation id
request body:
{
browserInfo {
userAgentHeader string
The Customer’s user agent.
}
sessionId string
Your reference for the Customer’s session.
transaction { Mandatory
currency string
Mandatory
The currency of your Customer’s transaction. Use the 3 character ISO-4217 code.
amount float
Mandatory
The amount of your Customer’s transaction.
channel string
Possible Values: WEB, MOBILE, SMS, RETAIL, MOTO, IVR, OTHER
The sales channel for your Customer’s transaction.
merchantRef string
Your reference for the transaction. Max length: 255. It’s recommended that you keep this unique.
description string
The description of the transaction. Maximum length: 255.
deferred boolean
Indicates if you want the Payment to be Authorised and Captured separately.
locale string
The ISO-639 code for your Customer’s locale.
customer {
id string
Our ID for the Customer where they are already registered with us.
update boolean
Indicates if you want to update the Customer’s details with the transaction.
email string
Email address for the Customer.
merchantRef string
Conditional
Your reference for the Customer. Not required if registered is set to false, mandatory otherwise.
dob string
Date of birth for the Customer.
billingAddress {
line1 string
Line 1 of the Customer’s address.
line2 string
Line 2 of the Customer’s address.
line3 string
Line 3 of the Customer’s address.
line4 string
Line 4 of the Customer’s address.
city string
City of the Customer’s address.
region string
Region of the Customer’s address.
postcode string
Post Code of the Customer’s address.
countryCode string
The 3 character ISO-3166-1 code for the Customer’s address country.
}
displayName string
Conditional
The Customer’s name. Not required if registered is set to false, mandatory otherwise.
telephone string
Telephone number for the Customer.
ip string
The Customer’s IP address.
registered boolean
Indicates if we should register your customer; false if you do not wish to register your customer, otherwise set to true, default value is true.
}
paymentMethod { Mandatory
paypal { Mandatory
Include if the payment is being made with PayPal.
returnUrl string
The location where the Customer will be redirected after he finishes the PayPal session.
cancelUrl string
The location where the Customer will be redirected if the cancels the PayPal session.
accessToken string
The PayPal access token to be used in the PayPal session for “seamless checkout”. If not provided or not valid at the time of use, the customer will be redirected to the PayPal login.
}
}
}
response:
{
clientRedirect { Information about where to send your customer in the case of 3DS or a Callback.
frame string
Possible Values: CONTAINER, TOP
The redirect type when the transaction is set to suspend and redirect to a new URL.
type string
url string
The URL the Customer should be redirected to.
}
transaction {
transactionId string
Our ID for the transaction.
merchantRef string
Your reference for the transaction.
merchantDescription string
The description of the transaction provided in the request.
status string
Possible Values: SUCCESS, FAILED, PENDING, EXPIRED, CANCELLED, VOIDED
The current state of the transaction.
type string
Possible Values: PAYMENT, PREAUTH, PAYOUT, REFUND, CAPTURE, CANCEL, REPEAT, CASH_ISSUE, CASH_PAYMENT
Indicates the type of the transaction.
amount float
Indicates the requested amount of the transaction.
consumerSpend float
Indicates the actual amount of the transaction. This will be zero for the PayPal redirect response and rejected transactions.
currency string
Indicates the currency of the transaction. Use the 3 character ISO-4217 code.
transactionTime string
The date and time we processed the transaction in ISO-8601 format.
receivedTime string
The date and time we received the transaction in ISO-8601 format.
channel string
Possible Values: WEB, MOBILE, SMS, RETAIL, MOTO, IVR, OTHER
The Sales Channel of the transaction.
}
customer { Information about the Customer.
id string
Our ID for the Customer.
merchantRef string
Your reference for the Customer.
}
outcome { Information about the overall outcome of the request.
reasonMessage string
A message indicating the overall outcome of the request. This is where we’ll provide detailed reasons for any errors.
status string
Possible Values: SUCCESS, FAILED
The overall outcome of the request.
reasonCode string
A code indicating the overall outcome of the request. Refer to Errors for more information.
}
paymentMethod { Information about the Payment Method used in the request.
paymentClass string
The classification of payment method used. Eg. Card, Cash, PayPal
}
}

Related topics