SF Payment Page

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Table of Contents

1. SF Payment Page Supported Functions ........................................................................................... 3


2. SF Payment Page URL ...................................................................................................................... 3
1) Using Mule API to get the URL .................................................................................................... 3
2) Headers........................................................................................................................................ 4
3) Query Parameters ....................................................................................................................... 4
4) Request Body ............................................................................................................................... 4
5) Response Body ............................................................................................................................ 6
3. SF Payment Page Look and Feel....................................................................................................... 7
1) ACH .............................................................................................................................................. 7
2) Credit Card ................................................................................................................................... 7
4. SF Payment Page Integration ........................................................................................................... 8
1) Getting the URL ........................................................................................................................... 8
2) Specifying Custom CSS and/or Chase iFrame Height .................................................................. 8
3) Receiving Response ..................................................................................................................... 8
5. SF Payment Page Response ............................................................................................................. 8
1) Posting Message to Client ........................................................................................................... 8
2) End of Process ............................................................................................................................. 8
3) Security Measures ....................................................................................................................... 8
4) Response Samples ....................................................................................................................... 9
5) Response Fields ......................................................................................................................... 10
6) Response Possible Outcomes .................................................................................................... 11

Page 1 of 13
Version Date Note
1.0.0 2023-05-20 Initial Version
1.0.1 2023-05-26 Added support for custom CSS and iFrame height (section 4.2)
1.0.2 2023-06-01 Added max length 20 for the CreatedBy field (section 2.4)
Added security measures (section 5.3)
Removed exception from the error field for security reasons (section 5.5)
1.0.3 2023-06-14 Refactored Mule API Section
Defined values of CreatedBy field ClientApps should provide (section 2.4)
1.0.4 2023-08-02 Added support for scheduled payment confirmation number (section 5.5)
Added support for forcing language (ForceLanguage in section 2.4)
1.0.5 2023-09-25 Added definition for terms used in the Outcomes table (section 6.6)
2.0.0 2024-03-01 Added support for Credit Card payment type, including MitMsgType and
ctiPINlessDebitCard features (section 2.1, 2.4, 5.4, 5.5, 5.6)
2.0.1 2024-03-25 Added support for CC ctiPrepaidCard feature (section 2.4, 5.4, 5.5)

Page 2 of 13
1. SF Payment Page Supported Functions
Function Description
TokenOnly Return a Chase Token
Onetime Immediate Payment – Process payment in PaymentTech and post it to iSigma
Scheduled Payment – Schedule onetime payment in iSigma with a Chase token
Autopay Set up autopay in iSigma with a Chase token
Combined Onetime + Autopay

Note

• Onetime or Autopay is only applicable for post enrollment customers (i.e. customer id exists in
iSigma).
• For pre-enrollments, only TokenOnly is available.
• For ACH, all these transactions will create e-check consents for associated SF contacts.

2. SF Payment Page URL


1) Using Mule API to get the URL
Client app must call the mule API (Postman) to get URL of the SF payment page.
Sample Curls below:
a. ACH

curl --location 'https://justenergy-customer-care-ux-api-dev.us-e1.cloudhub.io/api/hpp-


request?brand=Tara%20Energy&jurisdiction=Texas'

--header 'client_id: 2a234bc629ea437e92f263f62710d3e1'


--header 'client_secret: 43C3E9f386654A02B0fCE0E475B734BD'
--header 'Content-Type: application/json'
--data '{
"BillingSystemCustomerId": "2302230346",
"ClientApp": "Salesforce",
"PaymentType": "ACH",
"TransactionType": "Combined",
"PaymentAmount": 89.50,
"CreatedBy": "Agent 6"
}'

b. Credit Card

curl --location 'https://justenergy-customer-care-ux-api-dev.us-e1.cloudhub.io/api/hpp-


request?brand=Tara%20Energy&jurisdiction=Texas'

--header 'client_id: 2a234bc629ea437e92f263f62710d3e1'


--header 'client_secret: 43C3E9f386654A02B0fCE0E475B734BD'
--header 'Content-Type: application/json'
--data '{
"BillingSystemCustomerId": "2302230346",

Page 3 of 13
"ClientApp": "JE.COM",
"PaymentType": "CC",
"TransactionType": "TokenOnly",
"PaymentAmount": 0,
"CreatedBy": "Agent 6",
"MitMsgType": "CREC"
}'

2) Headers

Name Description Required Type


client_id Credential for Mule authentication. Required string
client_secret Credential for Mule authentication. Required String
Conent-Type application/json Required String

Note: The Mule API Url, client_id and client_secret will differ among environments

3) Query Parameters
Name Description Required Type
Brand Value must be one of the following: Required string
• Just Energy
• Amigo Energy
• Tara Energy
• Hudson
Jurisdiction Texas for all brands; Required string
Ohio, Illinois, Maryland for Hudson only

4) Request Body
Name Description Required Type
BillingSystemCustomerId iSigma Customer ID Conditional string
ExternalEnrollmentId CRM enrollment Id Conditional string
SFEnrollmentId SF enrollment Id, used by JE.COM Conditional string
SFAccountId SF Account Id Conditional string
ClientApp Value must be one of the following Required string
• Salesforce
• CRM Self-Serve Portal
• CRM Mobile App
• CRM
• JE.COM
• iSigma
PaymentType Value must be ACH or CC Required string
TransactionType Value must be one of the following: Required string
• TokenOnly

Page 4 of 13
• Onetime
• Autopay
• Combined
PaymentAmount Defaulted to 0. Required decimal
If transactionType is Onetime or Combined,
value must be greater than 0
ScheduledPaymentDate If provided, the transactionType must be Optional date
Onetime or Combined, and it should be a
future date
CreatedBy Maximum length: 20 characters Required String

Value provided by ClientApp as below:


• Salesforce: [Agent Name]
• CRM Self-Serve Portal:
WebJsonPortal
• CRM Mobile App: WebJsonMobile
• CRM: [Agent Name]
• JE.COM: WebJsonPortal
• iSigma: [Agent Name]
ForceLanguage Value must be English or Spanish. Optional String

If provided, content will be displayed in


specified language, otherwise it’ll be
displayed in customer preferred language.
MitMsgType Value must be CSTO or CREC Conditional String

It applies to Credit Card only (i.e.


PaymentType = 'CC')

Required when TransactionType =


TokenOnly

If other TransactionType is used, and this


value is not provided, system will derive the
value as following:

Onetime -> CSTO


Autopay -> CREC
Combined -> CSTO
ForbidPrepaidCardForAutopay It applies to Credit Card only (i.e. Optional Boolean
PaymentType = 'CC')

Set it to true to enable prepaid card check,


so post-enrollment autopay will NOT be set
up if a prepaid card is provided.

Page 5 of 13
Note

One and only one of the BillingSystemCustomerId, ExternalEnrollmentId, SFEnrollmentId and


SFAccountId fields must be provided with value, which is used to lookup Account and Contact in
Salesforce. If Account/Contact doesn’t exist, SF payment page will return an error (before Chase
form loads).

5) Response Body

Name Description Type


success Indicates if the request is successful boolean
statusCode HTTP status code string
message Message about processing result of the request. string
eventId Request id. Used for trouble shooting via Splunk. string
results If success = true, use results[0].Url as src of the iframe that array
hosts the SF payment page

Page 6 of 13
3. SF Payment Page Look and Feel
1) ACH

2) Credit Card

Page 7 of 13
4. SF Payment Page Integration
1) Getting the URL
SF Payment Page should be loaded on the frontend as an iframe. Refer to section 2 for how to
obtain the iframe’s src URL.

2) Specifying Custom CSS and/or Chase iFrame Height


If client app needs to use a custom CSS instead of the default CSS provided by the SF payment
page, and/or specify height for the Chase iFrame, it can expand the SF payment page URL with
extra query parameters cssUrl and/or height

3) Receiving Response
To receive response from the SF Payment Page, attach a message listener on the window where
iframe is hosted.

5. SF Payment Page Response


1) Posting Message to Client
SF Payment Page will post a message in JSON format to the host client page, only when it
encounters critical error before Chase iFrame loads (e.g., customer account doesn’t exist in SF),
or customer completes transaction in the Chase iFrame. If there’s error returned from the chase
iFrame before it can complete, it will display the error in the payment page itself and will not
post to the host client page.

2) End of Process
When client receives response from SF payment page, it means the page has finished processing
the current transaction. Client should call Mule to get a new URL and reset the iframe src before
using the SF payment page again.

3) Security Measures
• Max retries for each transaction in Chase iFrame. Expect to receive ‘Max retries exceeded’
error when customer keeps failing authorization attempts and reaches max retries limit.
• Usage detection and protection. Expect to receive ‘Too many requests’ error when
customer has been doing too many transactions within certain time period.

Page 8 of 13
4) Response Samples

• ACH
{
"success": true,
"eventId": "a4kDY000000GpS4YAK",
"chaseResult": {
"token": "240589415",
"transId": "648A17F22D933C3400000FFA0000EDAA415653B1",
"accountNumber": "XXXXXX8745",
"accountType": "echeck"
},
"source": "SF_HPP"
}

• Credit Card

{
"success": true,
"eventId": "a4hDC000000UafrYAC",
"confirmationNo": "2403010007",
"paymentCompleted": true,
"autopayCompleted": true,
"chaseResult": {
"token": "258473005",
"transId": "65E1DF422C20154200000FFD00014F2141565371",
"cardNumber": "XXXXXXXXXXXX0006",
"type": "Mastercard",
"expYear": "2024",
"expMonth": "10",
"name": "Test Test",
"firstName": "Test",
"lastName": "Test",
"address1": "1013 ALMOND ST",
"address2": "123#",
"city": "HICKORY CREEK",
"state": "TX",
"postalCode": "75065",
"country": "US",
"mitMsgType": "CSTO",
"ctiPINlessDebitCard": "Y",
"ctiPrepaidCard": "Y",
},
"source": "SF_HPP"
}

Page 9 of 13
• Failure Cases
{
"success": false,
"eventId": "a4kDY000000GpRyYAK",
"error": {
"message": "Customer account is not found"
},
"source": "SF_HPP"
}

{
"success": false,
"eventId": "a4hDC000000UcYXYA0",
"confirmationNo": "2403250027",
"paymentCompleted": true,
"autopayCompleted": false,
"chaseResult": {
"ctiPrepaidCard": "Y"
},
"error": {
"message": "We do not accept pre-paid cards for recurring payments.",
"isBusinessMessage": true
},
"source": "SF_HPP"
}

5) Response Fields

Name Description Type


success Indicates if all the operations are successful boolean
eventId The SF HPP_Request record id. Used for investigation string
confirmationNo Payment confirmation number. Used for Onetime string
immediate or scheduled payment only. Value will be
provided if Chase iFrame completes and onetime
payment is posted to iSigma successfully.
paymentCompleted Used for Combined transaction only. It indicates if boolean
onetime payment is successful. i.e.
• For immediate payment, it means Chase and
Orbital transactions were completed successfully
• For scheduled payment, it means payment was
scheduled in iSigma successfully
autopayCompleted Used for Combined transaction only. It indicates if boolean
autopay was set up in iSigma successfully.
chaseResult Presents when success is true object

Page 10 of 13
Name Description Type
➢ token Chase token string
➢ transId Chase Transaction ID string
➢ accountNumber ACH only. Masked ACH account number string
➢ accountType ACH only. Value is always ‘echeck’ string
➢ cardNumber CC only. Masked credit card number string
➢ type CC only. Credit card type (e.g. Visa, Mastercard, etc..) string
➢ expYear CC only. Credit card expiration year string
➢ expMonth CC only. Credit card expiration month string
➢ name CC only. Credit card holder name string
➢ firstName CC only. Credit card holder first name string
➢ lastName CC only. Credit card holder last name string
➢ address1 CC only. Credit card holder address1 string
➢ address2 CC only. Credit card holder address2 string
➢ city CC only. Credit card holder city string
➢ state CC only. Credit card holder state string
➢ postalCode CC only. Credit card holder postal code string
➢ country CC only. Credit card holder country string
➢ mitMsgType CC only. MIT message type code (‘CSTO’ or ‘CREC’) string
➢ ctiPINlessDebitCard CC only. PINless debit card indicator. string
Possible values: ‘Y’, ‘N’ or ‘X’
➢ ctiPrepaidCard CC only. Prepaid Card indicator. Client apps should NOT string
allow autopay when this flag is ‘Y’.
Possible values: ‘Y’, ‘N’ or ‘X’

Note that when this flag is ‘Y’ for autopay or combined


cases, it will be returned even when success = false due
to autopay setup failure (i.e. System will NOT call
recurring-payment API)
error Presents when success is false object
➢ message Error message string
➢ isBusinessMessage Indicates the error is due to business rules (i.e. not boolean
system errors). Presents when value is true.
source The value is always SF_HPP. string
Can be used to identify which message is from the SF
payment page if the client app receives post message
from multiple sources

6) Response Possible Outcomes


Definition of terms used in the table below:

▪ N/A: The field should not be checked when values in other fields match
▪ Empty: Field does not exist/null/'' are all considered Empty
▪ Not Empty: Field contains non-blank value

Page 11 of 13
Transaction Scheduled success payment confirmation autopay Indication
Type Payment Completed No Completed
TokenOnly N/A true N/A N/A N/A Token was successfully retrieved
via Chase iFrame
N/A false N/A N/A N/A Failed to get token
Autopay N/A true N/A N/A N/A Autopay was successfully set up
in iSigma
N/A false N/A N/A N/A Failed to set up autopay
Onetime Y true N/A Not Empty N/A Onetime scheduled payment was
successfully set up in iSigma
false N/A Empty N/A Failed to set up onetime
scheduled payment
Onetime N true N/A Not Empty N/A Onetime immediate payment was
successfully processed via Chase
iFrame, and Orbital API and
posted to iSigma for ACH, or
directly processed in iSigma for
credit card
true N/A Empty N/A This case applies to ACH only.
Onetime immediate payment was
successfully processed via Chase
iFrame and Orbital API, but failed
to post to iSigma. However, Mule
successfully pushed the request
to a durable queue so payment
should be able to push to iSigma
later by Mule.
false true N/A N/A This case applies to ACH only.
Onetime immediate payment was
successfully processed via Chase
iFrame and Orbital API, but failed
to post to iSigma, and failed to
push to the durable queue (i.e.,
when Mule is down, or AWS SQS
is down)
false false N/A N/A Onetime immediate payment
failed to process in Orbital API for
ACH, or in iSigma for Credit Card
(i.e., no payments is made)
Combined Y true true Not Empty true Both onetime scheduled payment
and autopay were set up
successfully in iSigma
false true Not Empty false Onetime scheduled payment was
successfully set up in iSigma, but
Autopay failed

Page 12 of 13
Transaction Scheduled success payment confirmation autopay Indication
Type Payment Completed No Completed
false false Empty false Both onetime scheduled payment
and autopay failed
false false Empty true Onetime scheduled payment
failed;
autopay succeeded;
Combined N true true Not Empty true Onetime immediate payment was
successfully processed via Chase
iFrame, and Orbital API and
posted to iSigma for ACH, or
directly processed in iSigma for
credit card.
Autopay succeeded.
true true Empty true This case applies to ACH only.
Onetime immediate payment was
successfully processed via Chase
iFrame and Orbital API, but failed
to post to iSigma. However, Mule
successfully pushed the request
to a durable queue so payment
should be able to push to iSigma
later by Mule.
Autopay succeeded.
false true Not Empty false Onetime immediate payment was
successfully processed via Chase
iFrame, and Orbital API and
posted to iSigma for ACH, or
directly processed in iSigma for
credit card;
Autopay failed;
false true Empty false This case applies to ACH only.
Onetime immediate payment was
successfully processed via Chase
iFrame and Orbital API, but failed
to post to iSigma. (Due to either
Mule or iSigma was down)
Autopay failed;
false false N/A false Onetime immediate payment
failed to process in Orbital API for
ACH, or in iSigma for Credit Card
(i.e., no payments is made);
Autopay failed;

Page 13 of 13

You might also like