2 posts / 0 new
Last post
demianalonso11601
Never authorizing ApplePay transaction

Hello,
we are trying to use Payeezy and ApplePay following the example provided in https://github.com/payeezy/payeezy_apple_pay and we are not being able to get it running in the sandbox environment.
The integration goes up to the point of displaying the ApplePay slider and executing the "Pay with passcode" but it always return a status of AuthorizationFailed. It is worth noticing that we are running the example in the simulator with a valid sandbox test user which has the default simulated credit cards.

The code goes like this. In the AppDelegate.m we have saved the FDInAppPaymentProcessor, which is created as follows::

self.pePaymentProcessor = [[FDInAppPaymentProcessor alloc] initWithApiKey:kPayeezyApiKey
apiSecret:kPayeezyApiSecret
merchantToken:kPayeezyMerchantToken
merchantIdentifier:kApplePayMerchantId
environment:kPayeezyEnvironment];
self.pePaymentProcessor.paymentMode = FDPreAuthorization;

Then when the ‘Pay with ApplePay’ button is clicked, this code is executed:

BOOL bPaymentOK = [appDelegate.pePaymentProcessor presentPaymentAuthorizationViewControllerWithPaymentRequest:pmtRqst presentingController:controller delegate:self];

This will present the corresponding ApplePay slider with the information of the payment, credit card and shipping address.

This always returns bPaymentOK = YES, and the pmtRqst has this values:

(FDPaymentRequest) $2 = {
NSObject = {
isa = FDPaymentRequest
}
_merchantCapabilities = FDMerchantCapability3EMV
_merchantIdentifier = 0x000000010860d050 @"merchant.com.oursite"
_countryCode = 0x000000010860d2d0 @"US"
_supportedNetworks = <__NSArrayI 0x60000042d020>(
Visa,
MasterCard
)
_paymentSummaryItems = <__NSArrayI 0x60000085a3a0>(
,
,

)
_currencyCode = 0x000000010860d310 @"USD"
_applicationData = 0x00006080002d0840 88 bytes
_requiredShippingAddressFields = FDAddressFieldAll
_requiredBillingAddressFields = FDAddressFieldAll
_shippingAddress = 0x0000000000000000
_shippingMethods = nil
_merchantRef = 0x000060000042d3a0 @"order-3367"
}

After selecting ‘Pay with passcode’ the library calls the method - (void)paymentAuthorizationViewController:(UIViewController *)controller didAuthorizePayment:(FDPaymentResponse *)payment. Where the payment variable has a validation status of FDPaymentValidationStatusFailure:

(FDPaymentResponse) $30 = {
NSObject = {
isa = FDPaymentResponse
}
_validationStatus = FDPaymentValidationStatusFailure
_paymentType = FDPurchase
_cardInfo = nil
_totalAmount = nil
_transactionID = nil
_transactionType = nil
_transactionTag = nil
_transStatusMessage = 0x000000010860d3d0 @"error"
_transarmorToken = nil
_authStatus = FDPaymentAuthorizationStatusFailure
_billingAddress = 0x00007fb58840da50
_shippingAddress = 0x00007fb58840f3f0
}

Debugging the app with a proxy, we see a request to the payeezy server:

Request

URL: https://api-cert.payeezy.com/v1/transactions
Status: 500
Body:
{
"3DS": {
"merchantIdentifier": "merchant.com.oursite",
"type": "A",
"applicationData": "WkdReU9HSmhNemMwTldOa01tTTNZV0l3TWpJME16QXlaakV5TkRaa1lqUTVPV0V3TlRSaE4yWTRPVGRrWVdSaFltVTVZak5sTUROallXSmpaVFF3TUE9PQ==",
"header": {}
},
"method": "3DS",
"transaction_type": "authorize",
"merchant_ref": "order-3367"
}

Response:

{
"correlation_id": "228.1479406176151",
"Error": {
"messages": [{
"code": "internal_server_error",
"description": "Internal Server Error. Please contact application Support team"
}]
},
"transaction_status": "Not Processed"
}

Which seems strange since the body doesn’t contain all the information that is sent to the library, yet all the information was passed to the SDK properly.

It seems that for some reason either the SDK is not forming the request properly, or we are not providing all the information it needs. Is there any way of improve the logging of the SDK or having a look at the source code to debug our problem better? What do you advise us to do to solve our problem?

Thanks in advance!


riteshkumarshah...
Re: Never authorizing ApplePay transaction

Sorry for replying late. The correlation_id provided we were not able to find in our system. Can you please provide other correlation_id so we can investigate?

Regards,
Ritesh