[go: up one dir, main page]

Apple Pay Payments

Submit customer payments initiated online or over the phone using the Payment Request. Payments will authorise and capture the funds for settlement in one-step.

APIHosted

There are various stages to performing an Apple Pay payment which need to be completed in your Javascript code as documented by Apple.  Once you have checked Apple Pay is available, created an Apple Pay session and validated the merchant you can proceed to making the payment.  Once the payment has been authorised Apple will provide the payment token.  It will be provided in the Apple SDK “session.onpaymentauthorized” event.  This is the token that needs to be put in the payment request to Pay360.  To see this in the example below please look at the "paymentMethod" key below.

This is an example of how this could be used with the Apple Pay JavaScript SDK

session. event ) { 
            
    var token = event.payment.token;

    // The function authorise(token) will make an ajax call to the site server, which will in turn call 
    //the Pay360 service /acceptor/rest/transactions/{instId}/payment 
    authorise(token).done( ( response ) => { 
        // determine success by response from merchant server. In this example the response is outcome.status 
        //from the Pay360 api response returned to your server

        var success = "SUCCESS" === response;

        var authorizationResult = {
            status: ( success ? ApplePaySession.STATUS_SUCCESS : ApplePaySession.STATUS_FAILURE ),
            errors: []
        };

        session.completePayment( authorizationResult ); // hides the Apple Pay sheet
		
        if ( success ) { 
	    showConfirmation( response );
        } else {
	    showDecline( data );
        }
    } );
};
 
API examples
Process payment

POST /acceptor/rest/transactions/{instId}/payment
{
  "transaction": {
    "currency": "GBP",
    "amount": "1000.0",
    "description": "Sample Transaction",
    "merchantRef": "mer_txn_1234556",
    "commerceType": "ECOM",
    "channel": "WEB"
  },
  "paymentMethod": {
    "applepay": {
      "paymentData" : { 
        "version" : "EC_v1",
        "data" : "3+f4oOTwPa6f1UZ6tG...CE=",
        "signature" : "MIAGCSqGSIb3DQ...AAAA==",
        "header": {
          "applicationData" : "DYkwEK...Yu==",
          "ephemeralPublicKey" : "MFkwEK...Md==",
          "publicKeyHash" : "l0CnXdMv...D1I=",
          "transactionId" : "32b...4f3"
        }
      },
      "paymentMethod" : { 
        "displayName" : "Visa 1234",
        "network" : "Visa",
        "type" : "debit"
      },
      "transactionIdentifier" : "32b...4f3"
    },
    "billingAddress": {
      "line1": "Flat 1 ",
      "line2": "Cauldron house",
      "line3": "A Street",
      "line4": "Twertonia",
      "city": "Bath",
      "region": "Somerset",
      "postcode": "BA1 234",
      "countryCode": "GBR"
    }
  },
  "customer": {
    "merchantRef": "mer_cust_131241413",
    "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"
  }
}

HTTP/1.1 201
{
  "processing": {
    "authResponse": {
      "statusCode": "00",
      "message": "ACQUIRER OK",
      "authCode": "100000",
      "gatewayReference": "5896345970448890-PASS",
      "gatewaySettlement": "2014-10-29",
      "gatewayCode": "0900.000.000",
      "gatewayMessage": "Transaction succeeded",
      "avsAddressCheck": "FULL_MATCH",
      "avsPostcodeCheck": "FULL_MATCH",
      "status": "AUTHORISED"
    },
    "route": "PAYON"
  },
  "paymentMethod": {
    "applepay": {
      "cardType": "VISA_DEBIT",
      "cardUsageType": "DEBIT",
      "cardCategory": "DEBIT",
      "cardScheme": "VISA",
     },
    "billingAddress": {
      "line1": "Flat 1 ",
      "line2": "Cauldron house",
      "line3": "A Street",
      "line4": "Twertonia",
      "city": "Bath",
      "region": "Somerset",
      "postcode": "BA1 234",
      "country": "United Kingdom",
      "countryCode": "GBR"
    },
    "paymentClass": "CARD"
  },
    "billingAddress": {
      "line1": "Flat 1 ",
      "line2": "Cauldron house",
      "line3": "A Street",
      "line4": "Twertonia",
      "city": "Bath",
      "region": "Somerset",
      "postcode": "BA1 234",
      "country": "United Kingdom",
      "countryCode": "GBR"
    },
    "paymentClass": "CARD"
  },
  "transaction": {
    "transactionId": "13501566687",
    "merchantRef": "mer_txn_1234556",
    "status": "SUCCESS",
    "type": "PAYMENT",
    "amount": 1000,
    "consumerSpend": 1000,
    "currency": "GBP",
    "transactionTime": "2014-01-06T12:25:30.902Z",
    "receivedTime": "2014-01-06T12:25:30.902Z",
    "channel": "WEB",
    "customerInitiated": true,
    "stage": "COMPLETE"
  },
  "outcome": {
    "status": "SUCCESS",
    "reasonCode": "S100",
    "reasonMessage": "Authorised"
  }
}
More information about objects in the request body can be found in the Apple documentation – https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778020-onpaymentauthorized
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.
commerceType string
Mandatory
Possible Values: ECOM, MOTO, CA
The commerce type for 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.
deferred boolean
Indicates if you want the Payment to be Authorised and Captured separately.
recurring boolean
Set this field if you want to start a Continuous Authority relationship from this transaction.
description string
The description of the transaction. Maximum length: 255.
}
locale string
The ISO-639-1 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 { The address of the Customer.
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.
}
financialServices { Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
dateOfBirth string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
Date of birth of the loan recipient, in YYYYMMDD format. For example, for Jan 2nd, 1980, this would be “19800102”.
surname string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
Surname of the loan recipient; up to six characters, excluding numbers or special characters. If the name is longer than six characters, then provide the first six. For example, for “Smith”, this would be “Smith”; for “Williams”, this would be “Willia”.
accountNumber string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
Account number used to identify the customer or loan. If this is a PAN, then provide the first six and last four digits of the PAN. Otherwise, provide up to ten characters of the account number.
postCode string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
First part of the postal code of the loan recipient; up to six characters. For example, if the postal code is “EC2A 1AE”, this would be “EC2A”.
}
transactionOptions {
do3DSecure boolean
Indicates if the transaction should be processed with 3DS. This will override account configuration for 3DS.
sendEmailReceipt boolean
If true, an email receipt will be sent for this transaction. If false, no receipt will be sent. If not present, your account configuration determines if an email is sent.
}
paymentMethod { Mandatory
applepay { Mandatory
paymentData { Mandatory
These fields are supplied by the apple pay session object
version Mandatory
string
data Mandatory
string
signature Mandatory
string
header { Mandatory
string
applicationData Optional
string
ephemeralPublicKey Mandatory
string
publicKeyHash Mandatory
string
transactionId Mandatory
string
}
}
paymentMethod { Mandatory
displayName Mandatory
string
network Mandatory
string
type Mandatory
string
}
transactionIdentifier Mandatory
string
}
registered boolean
Indicates if the supplied payment method should be registered. If no value is supplied true is assumed.
billingAddress { The billing address of the Customer. We’ll save the billing address when the customer makes their first payment. Providing a billing address for subsequent payments will update the address we’ve saved if you send new, empty or no values for each field.
line1 string
Line 1 of the Customer’s billing address.
line2 string
Line 2 of the Customer’s billing address.
line3 string
Line 3 of the Customer’s billing address.
line4 string
Line 4 of the Customer’s billing address.
city string
City of the Customer’s billing address.
region string
Region of the Customer’s billing address.
postcode string
Post Code of the Customer’s billing address.
countryCode string
The 3 character ISO-3166-1 code for the Customer’s billing address country.
}
}
}
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.
pareq string
Returned when the transaction is suspended for 3DS authorisation.
url string
The URL the Customer should be redirected to.
}
fraudGuard { Information about the Payment.
score float
The score assigned by FraudGuard. Refer to FraudGuard documentation for further details.
geoLocation {
ipCountry {
country string
The three-character ISO code representing the country of origin, determined by the IP address.
ipValues string
Possible Values: PROXY, SATELLITE, EUROPE, APAC
Categorisation of the IP address used.
}
ipCity string
The origin city of the transaction request, determined by the IP address.
ipRegion string
The origin state or province of the transaction request, determined by the IP address.
distanceFromIpToBilling int
The physical distance from the billing address to the location determined from the IP address.
}
channelRisk {
freeEmailProvider boolean
Whether or not the email address provided in the transaction request is hosted by a free provider.
openProxyRisk float
A rating of how likely it is that the transaction request originated from behind an open proxy.
}
recentActivity {
last24Hours {
attemptsViaIp int
How many transaction requests have originated from this IP address in the last 24 hours.
attemptsOnCard int
How many transaction requests have used this card in the last 24 hours.
}
}
identityMorphing {
againstAddress int
Measure of identity morphing against the address.
againstEmail int
Measure of identity morphing against the email address.
againstCard int
Measure of identity morphing against the card details.
againstIp int
Measure of identity morphing against the IP address.
}
}
transaction {
transactionId string
Our ID for the transaction.
deferred boolean
Indicates if the Payment capture is deferred.
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 any type of INITIALIZE transaction, deferred transactions, 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.
commerceType string
Possible Values: ECOM, MOTO, CA
The Commerce Type of the transaction.
channel string
Possible Values: WEB, MOBILE, SMS, RETAIL, MOTO, IVR, OTHER
The Sales Channel of the transaction.
relatedTransaction { This field is not applicable for Payments. In case of Refunds it indicates the transaction that was refunded.
transactionId string
Our ID for the transaction that was original.
merchantRef string
Your reference for the transaction that was original.
}
}
processing { Information about the authorisation status of your transaction.
route string
The name of the processing engine your transaction was submitted to.
voidSuccessful boolean
Indicates if the transaction was voided by a Post Authorisation callback.
authResponse {
statusCode string
The code for the status received from the authoriser, if applicable.
acquirerReference string
The reference received from the authoriser for your transaction, if applicable.
acquirerName string
Name of the authoriser, if applicable.
message string
The message received from the authoriser, if applicable.
authCode string
The code received from the authoriser, if applicable.
gatewayReference string
The reference received from the processing engine.
gatewaySettlement string
The date the processing engine will settle the transaction. in YYYY-MM-DD format.
gatewayCode string
The code for the status received from the processing engine.
gatewayMessage string
The message received from the processing engine.
avsAddressCheck string
Possible Values: NOT_CHECKED, FULL_MATCH, NOT_MATCHED, NOT_PROVIDED
Results for the Address Verification checks, if applicable, if applicable.
avsPostcodeCheck string
Possible Values: NOT_CHECKED, FULL_MATCH, NOT_MATCHED, NOT_PROVIDED
Results for the PostCode Verification checks, if applicable.
cv2Check string
Possible Values: NOT_CHECKED, MATCHED, NOT_MATCHED
Results for the CV2 Verification checks, if applicable.
gatewayStatus string
The status received from the processing engine.
status string
Possible Values: AUTHORISED, DECLINED, REVERSED, REVERSE_FAILED, ERROR
The status received from the authoriser, if applicable.
}
}
threeDSecure { Information about the 3D Secure status of your transaction.
authenticationStatus string
Possible Values: AUTHENTICATED, ATTEMPTED, FAILED, ERROR
The status of 3DS authentication check.
authenticationIndicator string
Possible Values: Y, A, N, U
The indicator of the 3DS authentication status.
enrolmentDateTime string
The date and time the 3DS enrolment check was performed in ISO-8601 format.
scheme string
The scheme that processed the transaction for 3DS.
eci string
The eCommerce indicator for the transaction.
status string
Possible Values: AUTHENTICATED, BYPASSED, FAILED, NOT_ENROLLED, ENROLMENT_CHECK_FAILURE, INCOMPLETE, NOT_AVAILABLE, NOT_IMPLEMENTED
The overall 3DS result for the transaction.
xid string
The ID used during 3DS processing.
enrolmentIndicator string
Possible Values: Y, N, U
The indicator of the 3DS enrolment status.
enrolmentStatus string
Possible Values: ENROLLED, NOT_ENROLLED, UNABLE_TO_AUTHENTICATE
The status of the 3DS enrolment check.
}
customer { Information about the Customer.
id string
Our ID for the Customer.
merchantRef string
Your reference for the Customer.
}
financialServices { Information about the financial services.
dateOfBirth string
The Customer’s date of birth.
surname string
The Customer’s surname.
accountNumber string
The loan account number provided by the merchant, to the Customer.
postCode string
The postal code of the Customer’s billing address.
}
outcome { Information about the overal 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. In the case of a decline this message can be very general. There can be useful guidance to the cause of the decline in processing.authResponse.gatewayMessage.
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.
applepay {
displayName string
The display name Apple Pay uses for this card (e.g. VISA 1234)
cardType string
information about the type of card used by the Apple Pay transaction
cardUsageType string
The card usage type (credit or debit)
cardScheme string
The card scheme (VISA, Mastercard, Amex, etc) 
savedAccountToken string
The token for the card.
}
paymentClass string
The classification of payment method used. Eg. Card, Cash, PayPal
billingAddress { The billing address of the Customer. Will be used for AVS checks. We’ll save the billing address when the customer makes their first payment. Providing a billing address for subsequent payments will update the address we’ve saved if you send new, empty or no values for each field.
line1 string
Line 1 of the Customer’s billing address.
line2 string
Line 2 of the Customer’s billing address.
line3 string
Line 3 of the Customer’s billing address.
line4 string
Line 4 of the Customer’s billing address.
city string
City of the Customer’s billing address.
region string
Region of the Customer’s billing address.
postcode string
Post Code of the Customer’s billing address.
country string
Country name of the Customer’s billing address.
countryCode string
The 3 character ISO-3166-1 code for the Customer’s billing address country.
}
}
}
Hosted examples
Submit a payment

POST /hosted/rest/sessions/{instId}/payments
{
  "session": {
    "preAuthCallback": {
      "url": "http://www.example.com/callback/preAuth?status=SUSPEND",
      "format": "REST_XML"
    },
    "returnUrl": {
      "url": "http://www.example.com/transactionResult?MERCHANTREF=761585761585"
    }
  },
  "transaction": {
    "merchantReference": "761585761585",
    "money": {
      "amount": {
        "fixed": 100
      },
    "currency": "GBP"
    }
  },
  "customer": {
    "identity": {
      "merchantCustomerId": "1111111111111"
    },
    "details": {
      "name": "given1 Family1",
      "address": {
        "line1": "matched",
        "line2": "initialCustomer1AddresssLine2",
        "city": "initalCustomer1City",
        "region": "initalCustomer1Region",
        "postcode": "AVS111",
        "countryCode": "GBR"
      },
      "telephone": "0044111111111",
      "emailAddress": "initialCustomer1@example.com",
      "ipAddress": "1.1.1.1",
      "defaultCurrency": "GBP"
    }
  },
  "financialServices": {
    "dateOfBirth": "19870818",
    "surname": "Smith",
    "accountNumber": "123ABC",
    "postCode": "BS20"
  }
}

HTTP/1.1 200
{
  "sessionId": "5280f295-b7ea-4eaa-8e3b-ebd6fa67cc58",
  "redirectUrl": "https://secure.mite.pay360.com/hosted/8f2c9ec4-f9e6-44a7-b14a-39a47d3aeb65/begin/5280f295-b7ea-4eaa-8e3b-ebd6fa67cc58",
  "status": "SUCCESS"
}
Hosted endpoint
endpoint: /hosted/rest/sessions/{instId}/payments
method: POST
summary: process Payment

parameters:

Name
Data Type
Description
instId
The installation id
request body:
{
transaction { Mandatory
Details of the transaction you want to create.
merchantReference string
Your reference for the transaction.
money { Mandatory
currency string
Mandatory
The currency of your Customer’s transaction. Use the 3 character ISO-4217 code.
amount { Mandatory
Choose one of fixed, choice, range or suggested amount specifications.
fixed float
Choice
Use if you want your customer to only make a payment for a fixed amount. The customer can not change the amount.
choice { Choice
Use if you want your customer to select from a predefined set of amounts.
option [ array
Mandatory
Mandatory if Amount Choice included in the request.
item float
]
}
range { Choice
Use if you want your customer to choose an amount between a minimum and maximum value or within a part-bounded range. You can also provide a default amount. This can be overtyped by the customer if they want to.
min float
Mandatory if Amount Range included in the request and max value not present.
max float
Mandatory if Amount Range included in the request and min value not present.
default float
}
suggested { Choice
Use if you want to your customer to choose an amount between a minimum and maximum value or from a predefined set of amounts.
choice { Mandatory
Mandatory if Suggested included in the request.
option [ array
Mandatory
item float
]
}
range { Mandatory
Mandatory if Suggested included in the request.
min float
max float
default float
}
}
}
}
description string
The description of the transaction.
commerceType string
Possible Values: ECOM, MOTO, CNP
The commerce type for your Customer’s transaction.
channel string
Possible Values: WEB, MOBILE, SMS, RETAIL, MOTO, IVR, OTHER
The sales channel for your Customer’s transaction. If no channel is provided we’ll automatically classify the channel as WEB
deferred boolean
Indicates if you want the Payment to be Authorised and Captured separately.
recurring boolean
Indicates that the Payment should initiate a Continuous Authority relationship.
do3DSecure boolean
Indicates if the transaction should be processed with 3DS. This will override account configuration for 3DS.
}
customer {
create boolean
Deprecated. Use ‘registered’ instead, as this will be removed in the future.
registered boolean
Indicates if you wish to create or use a registered customer. False if you do not wish to register your customer, otherwise set to true. Default value is true.
identity { Conditional
Mandatory when registering a new customer, or using an already registered customer, optional otherwise.
platformCustomerId string
Choice
Our ID for your customer.
merchantCustomerId string
Choice
Your ID for the customer.
}
details { Conditional
Mandatory when registering a new customer, optional otherwise.
name string
Conditional
The Customer’s name
Mandatory when registering a new customer, optional otherwise.
address { Conditional
Mandatory when registering a new customer, optional otherwise. This is used to pre-populate the customers billing address fields.
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.
}
telephone string
Telephone number for the Customer.
emailAddress string
Email address for the Customer.
ipAddress string
The Customer’s IP address.
}
}
financialServices { Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
dateOfBirth string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
Date of birth of the loan recipient, in YYYYMMDD format. For example, for Jan 2nd, 1980, this would be “19800102”.
surname string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
Surname of the loan recipient; up to six characters, excluding numbers or special characters. If the name is longer than six characters, then provide the first six. For example, for “Smith”, this would be “Smith”; for “Williams”, this would be “Willia”.
accountNumber string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
Account number used to identify the customer or loan. If this is a PAN, then provide the first six and last four digits of the PAN. Otherwise, provide up to ten characters of the account number.
postCode string
Mandatory for UK/Europe-based MCC 6012/6051/some 7299 merchants
First part of the postal code of the loan recipient; up to six characters. For example, if the postal code is “EC2A 1AE”, this would be “EC2A”.
}
locale string
The ISO-639-1 code for your Customer’s locale.
session { Mandatory
preAuthCallback { Details of the callback made before the transaction is sent for authorisation.
url string
Mandatory
The URL you want the callback or notification to be sent to. This will override any defaults set on your account. Where a default is set and a blank URL field is specified, no callback or notification will be sent.
format string
Possible Values: REST_XML, REST_JSON
The format of the callback content.
}
postAuthCallback { Details of the callback made after the transaction is sent for authorisation.
url string
Mandatory
The URL you want the callback or notification to be sent to. This will override any defaults set on your account. Where a default is set and a blank URL field is specified, no callback or notification will be sent.
format string
Possible Values: REST_XML, REST_JSON
The format of the callback content.
}
transactionNotification { Details of the notification sent after transaction completion.
url string
Mandatory
The URL you want the callback or notification to be sent to. This will override any defaults set on your account. Where a default is set and a blank URL field is specified, no callback or notification will be sent.
format string
Possible Values: REST_XML, REST_JSON
The format of the callback content.
}
returnUrl { Mandatory
The URL that we will return your customer to after processing the transaction.
url string
Mandatory
}
cancelUrl { The URL that we will return your customer to if they cancel the hosted session. If omitted the returnUrl is used if they cancel.
url string
Mandatory
}
restoreUrl { The URL of Pay360 hosted session. We’ll take your customer to this URL in the event they cancel their PayPal payment with the “Cancel and return to….” link. You will need to use this field if you iFrame our hosted product.
url string
Mandatory
}
skin The ID of the skin used to drive look and feel for this session. Refer to Customise hosted look and feel for more information.
}
features { Holder of features that can be enabled/disabled during a hosted session.
paymentMethodRegistration string
Possible Values: always, optional
Allow the customer to choose if they wish their payment method to be registered.
sendEmailReceipt boolean
If true, an email receipt will be sent for this transaction. If false, no receipt will be sent. If not present, your account configuration determines if an email is sent.
newAccountPayoutEnabled boolean
If true, the customer requesting the payout will be able to complete it by entering a new payment account; the usual restriction of forcing payouts to go to an existing saved account won’t apply to this session. NOTE: This feature needs to be enabled on your processing account first; please contact our Implementations team if you wish to use this.
addNewPaymentMethodLink boolean
Works in conjunction with the newAccountPayoutEnabled flag. If true, the customer will always be able to enter a new payment account for the payout. If false, then the customer will be forced to use a saved account if they have one, but will still be able to enter a new payment account if they have none saved.
showResultsPage boolean
If true, after processing the transaction the user will be shown a page with the result, including key details of the transaction, including amount, transaction id, merchant reference, etc. Default is false, meaning it is up to the merchant to inform the customer of the result of the transaction.
NOTE: This option is only available when using a version 2 hosted skin, see Skin Properties
}
}
response:
{
sessionId string
Our ID for the hosted session.
redirectUrl string
The URL you should direct your customer to to start the hosted session.
status string
Possible Values: SUCCESS, FAILED
Indicates the status of the session creation.
reasonCode string
Further information about the status of the session creation.
reasonMessage string
Further information about the status of the session creation. This is where we will provide detailed information about any errors.
}

The status of a hosted session can be retrieved while it is in use, and for a limited time (up to 1 hour) afterwards. This is the recommended way to find out the id of the transaction after the user has been returned to your site. The full details of the transaction can then be retrieved using retrieve a transaction.

Retrieve session examples
Transaction is currently being processed
GET /hosted/rest/sessions/{instId}/{sessionId}/status

HTTP/1.1 200
{
    "status": "SUCCESS",
    "hostedSessionStatus": {
        "sessionId": "SMjogn8RQWJBF0ooyl1MA7p4S",
        "context": "https://secure.mite.pay360.com/hosted",
        "sessionState": "STARTED",
        "transactionState": {
            "transactionState": "PROCESSING"
        }
    }
}
Session completed with successful transaction
GET /hosted/rest/sessions/{instId}/{sessionId}/status

HTTP/1.1 200
{
    "status": "SUCCESS",
    "hostedSessionStatus": {
        "sessionId": "SMjogn8RQWJBF0ooyl1MA7p4S",
        "context": "https://secure.mite.pay360.com/hosted",
        "sessionState": "TERMINATED",
        "transactionState": {
            "id": "11802480907",
            "transactionState": "SUCCESS"
        }
    }
}
Session not found or no-longer available
GET /hosted/rest/sessions/{instId}/{sessionId}/status

HTTP/1.1 404
{
    "status": "FAILED",
    "reasonCode": "exception.sessionState.noSession",
    "reasonMessage": "Session not found"
}
Retrieve session endpoint
endpoint: /hosted/rest/sessions/{instId}/{sessionId}/status
method: GET
summary: retrieve a hosted session

parameters:

Name
Data Type
Description
instId
The installation id
sessionId
The session id
response:
{
status string
outcome of session retrieval request, SUCCESS or FAILED.
reasonCode string
code of session retrieval error.
reasonMessage string
message describing session retrieval error.
hostedSessionStatus {
sessionId string
The id of the session.
context string
web context of the hosted session.
sessionState string
session status, possible values:

  • INITIALISED – session created but not yet visited in a browser
  • STARTED – session in use but transaction not yet submitted
  • SUSPENDED – session is suspended either for 3-D Secure or merchant suspension via pre-auth callback
  • TERMINATED – session finished, it cannot be used again
  • EXPIRED – session has expired after being abandoned, it cannot be used again

 

transactionState {
id string
id of the transaction produced by the session, could change if processing retry is available, such as after PayPal cancel.
transactionState string
status of the transactions, possible values:

  • NOT_SUBMITTED – transaction request has not yet been submitted by customer
  • PROCESSING – transaction is being processed
  • PENDING – transaction is suspended, typically for 3-D Secure
  • SUCCESS – transaction was successful
  • FAILED – transaction failed
  • EXPIRED – transaction was abandoned
  • CANCELLED – transaction was cancelled
  • VOIDED – transaction was voided or reversed

 

}
}
}