Mastercard Hosted Checkout Integration always "Payment Unsuccessful" at the end with no error info - mastercard

I am implementing Mastercard's Hosted Checkout Integration. Detail see below.
https://ap.gateway.mastercard.com/api/documentation/integrationGuidelines/hostedCheckout/integrationModelHostedCheckout.html
For checkout.js, I am using interaction.operation: "PURCHASE"
Checkout.configure({
merchant: <xxxx>,
order: {
amount: xxxx,
currency: "AUD",
description:<xxxxx>,
id: <my own order id, unique>,
},
session: {
id: <i can successfully get the session id>,
},
interaction: {
merchant: {
name: <xxxx>,
logo:logo_url_secure
},
operation: "PURCHASE",
displayControl: {
billingAddress: "HIDE",
},
},
});
Checkout.showLightbox();
The checkout light box can load etc. with no problem. Filled in the test card info.
The "ACS Emulator" shows up as normal. see screenshot below.
After click on "Submit" on the "ACS Emulator" page, it always gives a "Payment Unsuccessful" result with no error msg etc. See below
checked the API call to the bank,
https://xxxxxxxxxx.ap.gateway.mastercard.com/checkout/api/performPayment/SESSIONxxxxxxxxxxxxxxxxxxxxx?charset=UTF-8
the response is 200, but not successful.
{
"merchantReturnUrl":false,
"success":false,
"threeDsRequired":false,
"alreadySuccessfullyProcessed":false,
"sessionId":"SESSIONxxxxxxxxxxxxx",
"receiptUrl":"/checkout/receipt/SESSIONxxxxxxxx",
"receiptData":{
"paymentMethod":null,
"paymentDetail1":null,
"orderDate":"4/09/21 7:34 PM"
},
"transactionId":"2"
}
Anything I did wrong here?
I suspect my test account might not been setup properly?
Any hints are very much appreciated?

Related

How to fix the BotError about Adaptive Cards Tab?

I want to enable SSO for Adaptive Cards Tab following the SSO pattern for message extensions.
And the type of interface TabResponsePayload includes "silentAuth".
refer to the url: https://github.com/microsoft/botbuilder-js/blob/main/libraries/botframework-schema/src/teams/index.ts#L1352
type?: "continue" | "auth" | "silentAuth"
In handleTeamsTabFetch, I return the tabResponse:
{
tab: {
type: "silentAuth",
suggestedActions: {
actions: [
{
type: "openUrl",
value: signInLink,
title: "Sign in to this app"
}
]
}
}
}
However, when I was debugging in Microsoft Teams, the error occurred:
{"errorCode":1008,"message":"Error when processing invoke response: Tab response type (silentAuth) from bot is not supported"}
Does anyone know what's going on here?

Sudden Failure Requests on Braintree Sandbox API: 'Billing state format is invalid'

We're running a UK Magento store hooked up to Braintree. All has been running smoothly for months, then suddenly, we are no longer able to complete an order on any of our staging or local test environments which are hooked up to Braintree Sandbox.
At checkout, a request is made to the 3d secure endpoint, and if we have entered a UK based county, we get the following response:
Endpoint:
https://api.sandbox.braintreegateway.com/merchants/xxx/client_api/v1/payment_methods/xxx/three_d_secure/lookup
Request billing part:
"additionalInfo": {
"billingCity": "Leeds",
"billingCountryCode": "GB",
"billingGivenName": "John",
"billingLine1": "50 Upton Road",
"billingPhoneNumber": "07733222111",
"billingPostalCode": "LE6 7TH",
"billingState": "Yorkshire",
"billingSurname": "Smith"
},
Response:
{
"error": {
"message": "Billing state format is invalid."
},
"threeDSecureInfo": {
"liabilityShiftPossible": false,
"liabilityShifted": false
}
}
If we remove the county field from the checkout (and ultimately the 'billingSate from the request), the response is valid and we are able to checkout fine.
This has only started happening recently
The same codebase works fine on production Braintree
I simulated the a request with exact same params on production and it worked OK
Raised ticket with Braintree but no response
I am able to checkout if I use a two digit US state code in the county field
Anyone have any ideas?
I did finally get an answer from Braintree regarding this. Apparently 3ds2 is now enforced on the Sandbox, and this requires the state or county to be sent as a two digit code.
On production, if the full name is sent, it will (currently) gracefully degrade to 3ds1 and complete.
In an attempt to push people to using 3ds2, the Sandbox does not switch to 3ds1 and returns the error.
Today I encountered same problem with 3DSecure in Braintree.
First of all, I made sure that I use the latest version of drop-in, client and data-collector scripts which (at the time of writing this response) are:
<script src="https://js.braintreegateway.com/web/3.71.0/js/client.min.js"></script>
<script src="https://js.braintreegateway.com/web/3.71.0/js/data-collector.min.js"></script>
<script src="https://js.braintreegateway.com/web/dropin/1.25.0/js/dropin.min.js"></script>
Then I modified/renamed two of "threeDSecure" properties "locality"->"city" and "region"->"state"
dropin.requestPaymentMethod({
threeDSecure: {
amount: '10.01',
email: 'me#mydomain.com',
billingAddress: {
givenName: 'John',
surname: 'Smith',
streetAddress: '51 East Street,
extendedAddress: 'na',
city: 'Colchester',
state: 'Essex',
postalCode: 'CO1 2QY',
countryCodeAlpha2: 'GB'
}
}
}, function (err, payload) {
if (err) {
console.log('tokenization error:');
dropin.clearSelectedPaymentMethod();
return;
}
if (!payload.liabilityShifted) {
console.log('Liability did not shift');
return;
}
console.log('verification success');
console.log(payload.nonce);
});
I hope this will help you as it works fine for me in the Sandbox environment.

Multiple response cards unable to be shown for Amazon lex chatbot

I am currently using Amazon lex to create a chatbot and want to be able to post multiple response cards at once. The question asked by the chatbot will be "Do you have an integrated Shield Plan currently?" and followed will be multiple response cards where it will show a list of plans from different brands. But if the user does not have a plan, there will be an option called "No" on the response card.
But if I publish the chatbot let's say on Slack, not even one response card is shown. How do I fix this problem?
You have not specified the Card Image URL, this is why there is no card.
I have just now tested it, without Image Card URL ResponseCard will not be shown on Facebook or Slack if we are setting it using console.
However if you are setting Response Cards in Lambda function, then we can choose not to have an image. You can check that slot is filled or not in the DialogCodeHook and display the ResponseCard accordingly.
Below is sample code to display ResponseCard without an image:
{
'dialogAction': {
'type': 'Close',
'fulfillmentState': 'Fulfilled',
'message': {
'contentType': 'PlainText',
'content': message
},
'responseCard': {
'version': '0',
'contentType': 'application/vnd.amazonaws.card.generic',
'genericAttachments': [
{
'title': 'title1',
'subTitle': 'subtitle',
"buttons":[
{
"text":"button 1",
"value":"value 1"
},
{
"text":"button 2",
"value":"value 2"
},
{
"text":"button 3",
"value":"value 3"
}
]
}
}
}
}
Hope it helps.

Mandrill templates still tracking open and click rates after disabling in API

Trying to figure out why some mandrill templates are still tracking open and click rates, when in the our API, we have disabled both track_opens and track_clicks.
Per the Mandrill, How does open tracking work? if you set these parameters it will override any account settings for tracking.
So I am trying to figure out if there is something that I am missing with possible account settings on a per template bases?
message = {
subject: subject, global_merge_vars: global_merge_vars, merge_vars: to_email_hashes.map { |hash|
hash[:merge_vars][:vars] = _hash_to_mandrill_vars(hash[:merge_vars][:vars])
hash[:merge_vars]
},
from_email: _from_email_mask(from_email), from_name: from_name, to: to_email_hashes.map { |hash| {name: hash[:name], email: hash[:email]} },
headers: {}, preserve_recipients: false, track_opens: false, track_clicks: false,
attachments: attachments.map { |hash| {name: hash[:name], type: hash[:type], content: _encode_attachment(hash[:content])} }
}

PayPal agreement approval doesn't show a price

I'm using PayPal through the REST API and I'm a bit confused with what I get.
To consume it i'm using the PayPal-Ruby-SDK
I'm creating a Plan like this:
paypal_plan = PayPal::SDK::REST::DataTypes::Plan.new(
name: 'foo',
description: 'bar',
type: 'FIXED',
payment_definitions: [
{
name: 'foo',
type: 'REGULAR',
frequency_interval: '1',
frequency: 'MONTH',
cycles: '12',
amount: {
currency: 'EUR',
value: '15'
}
}
],
merchant_preferences: {
cancel_url: 'http://foo.com/cancel',
return_url: 'http://foo.com/return'
}
)
paypal_plan.create
# Active the plan on PayPal
patch = {
path: '/',
value: {
state: 'ACTIVE'
},
op: 'replace'
}
paypal_plan.update(patch)
Then I create an Agreement related to this Plan:
PayPal::SDK::REST::DataTypes::Agreement.new(
name: 'foo',
description: 'bar',
start_date: (Time.now + 1.hour).utc.iso8601,
payer: {
payment_method: 'paypal'
},
plan: {
id: PLAN_ID
}
)
Everything seems to work but when I navigate to the approval url it give me a web page without any detail about the Plan I'm going to subscribe.
I was actually just playing with Billing Agreements in the Express Checkout API and noticed the same thing there. It seems that when working with billing agreements the PayPal checkout pages get simplified and show nothing but the billing agreement. It leaves it up to you to display a nice review page that includes the whole order in your site or application.

Resources