-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathPendingAuthenticationWithUnknownPath.cs
92 lines (82 loc) · 4.34 KB
/
PendingAuthenticationWithUnknownPath.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Collections.Generic;
using System.Globalization;
using CyberSource.Api;
using CyberSource.Model;
namespace Cybersource_rest_samples_dotnet.Samples.PayerAuthentication
{
public class PendingAuthenticationWithUnknownPath
{
public static RiskV1AuthenticationsPost201Response Run()
{
string clientReferenceInformationCode = "UNKNOWN";
Riskv1authenticationsClientReferenceInformation clientReferenceInformation = new Riskv1authenticationsClientReferenceInformation(
Code: clientReferenceInformationCode
);
string orderInformationAmountDetailsCurrency = "USD";
string orderInformationAmountDetailsTotalAmount = "10.99";
Riskv1authenticationsOrderInformationAmountDetails orderInformationAmountDetails = new Riskv1authenticationsOrderInformationAmountDetails(
Currency: orderInformationAmountDetailsCurrency,
TotalAmount: orderInformationAmountDetailsTotalAmount
);
string orderInformationBillToAddress1 = "1 Market St";
string orderInformationBillToAddress2 = "Address 2";
string orderInformationBillToAdministrativeArea = "CA";
string orderInformationBillToCountry = "US";
string orderInformationBillToLocality = "san francisco";
string orderInformationBillToFirstName = "John";
string orderInformationBillToLastName = "Doe";
string orderInformationBillToPhoneNumber = "4158880000";
string orderInformationBillToEmail = "[email protected]";
string orderInformationBillToPostalCode = "94105";
Riskv1authenticationsOrderInformationBillTo orderInformationBillTo = new Riskv1authenticationsOrderInformationBillTo(
Address1: orderInformationBillToAddress1,
Address2: orderInformationBillToAddress2,
AdministrativeArea: orderInformationBillToAdministrativeArea,
Country: orderInformationBillToCountry,
Locality: orderInformationBillToLocality,
FirstName: orderInformationBillToFirstName,
LastName: orderInformationBillToLastName,
PhoneNumber: orderInformationBillToPhoneNumber,
Email: orderInformationBillToEmail,
PostalCode: orderInformationBillToPostalCode
);
Riskv1authenticationsOrderInformation orderInformation = new Riskv1authenticationsOrderInformation(
AmountDetails: orderInformationAmountDetails,
BillTo: orderInformationBillTo
);
string paymentInformationCardType = "001";
string paymentInformationCardExpirationMonth = "12";
string paymentInformationCardExpirationYear = "2025";
string paymentInformationCardNumber = "4012001037490014";
Riskv1authenticationsPaymentInformationCard paymentInformationCard = new Riskv1authenticationsPaymentInformationCard(
Type: paymentInformationCardType,
ExpirationMonth: paymentInformationCardExpirationMonth,
ExpirationYear: paymentInformationCardExpirationYear,
Number: paymentInformationCardNumber
);
Riskv1authenticationsPaymentInformation paymentInformation = new Riskv1authenticationsPaymentInformation(
Card: paymentInformationCard
);
var requestObj = new CheckPayerAuthEnrollmentRequest(
ClientReferenceInformation: clientReferenceInformation,
OrderInformation: orderInformation,
PaymentInformation: paymentInformation
);
try
{
var configDictionary = new Configuration().GetConfiguration();
var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);
var apiInstance = new PayerAuthenticationApi(clientConfig);
RiskV1AuthenticationsPost201Response result = apiInstance.CheckPayerAuthEnrollment(requestObj);
Console.WriteLine(result);
return result;
}
catch (Exception e)
{
Console.WriteLine("Exception on calling the API : " + e.Message);
return null;
}
}
}
}