Payment API test transaction -- failing
Dim paymentUrl As String = $"https://api.sky.blackbaud.com/payments/v1/transactions"
Dim payment = New PaymentAdd()
payment.amount = 1
payment.csc = "123"
payment.comment = "Recurring donation"
payment.card_token = cardToken
payment.direct_debit_account_token = "00000000-0000-0000-0000-000000000000"
payment.tokenize = False
payment.payment_configuration_id = paymentConfig
payment.transaction_category = "donation"
payment.donor_ip = "192.168.0.1"
Dim billing_contact = New billing_contact()
billing_contact.address = "2000 Daniel Island Drive"
billing_contact.city = "Charleston"
billing_contact.country = "US"
billing_contact.first_name = "Blackbaud"
billing_contact.post_code = "29442"
billing_contact.state = "SC"
Dim credit_card = New CardTokenAdd()
credit_card.card_type = "Visa"
credit_card.Number = "4111"
credit_card.Exp_month = 2
credit_card.Exp_year = 1985
credit_card.Name = "Blackbaud"
credit_card.valid_from_month = 1
credit_card.valid_from_year = 1980
'credit_card.issue_number = 443
payment.billing_contact = billing_contact
payment.credit_card = credit_card
Using client As New HttpClient()
client.DefaultRequestHeaders.Authorization = New System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken)
client.DefaultRequestHeaders.Add("Bb-Api-Subscription-Key", skey)
Dim json = Newtonsoft.Json.JsonConvert.SerializeObject(payment)
'Dim content = New Net.Http.StringContent(json)
Dim response = Await client.PostAsync(paymentUrl, New StringContent(json, Encoding.UTF8, "application/json"))
If response.IsSuccessStatusCode Then
Dim content1 = Await response.Content.ReadAsStringAsync()
'escardToken = Newtonsoft.Json.Linq.JObject.Parse(content1)
Return content1
' Read response content
'rescardToken = response.Content.ReadAsStringAsync().Result
Else
Console.WriteLine($"Error: {response.StatusCode} - {response.ReasonPhrase}")
End If
End Using
Getting Error while posting this payment api.
[{"message":"A validation error occurred. Validation error code: <UnknownCardType> Validation error message <Unknown credit card type.>","error_name":"TransactionValidationError","error_code":4,"raw_message":"A validation error occurred. Validation error code: <{0}> Validation error message <{1}>","error_args":["UnknownCardType","Unknown credit card type."]}]
Comments
-
@Sumathi Babu Reference to Payments API document, there is no card_type property under CreditCardAdd. Removing it should help you to pass this error message.
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 210 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 649 Blackbaud Grantmaking™
- 567 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 937 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.5K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 247 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 239 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 31 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 785 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
