Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add New Fields and Update Tests for Payment Processing #147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions payments/nas/sources/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ type (
}

requestNetworkTokenSource struct {
Type payments.SourceType `json:"type,omitempty"`
Token string `json:"token,omitempty"`
ExpiryMonth int `json:"expiry_month,omitempty"`
ExpiryYear int `json:"expiry_year,omitempty"`
TokenType payments.NetworkTokenType `json:"token_type,omitempty"`
Cryptogram string `json:"cryptogram,omitempty"`
Eci string `json:"eci,omitempty"`
Stored bool `json:"stored"`
Name string `json:"name,omitempty"`
Cvv string `json:"cvv,omitempty"`
BillingAddress *common.Address `json:"billing_address,omitempty"`
Phone *common.Phone `json:"phone,omitempty"`
Type payments.SourceType `json:"type,omitempty"`
Token string `json:"token,omitempty"`
ExpiryMonth int `json:"expiry_month,omitempty"`
ExpiryYear int `json:"expiry_year,omitempty"`
TokenType payments.NetworkTokenType `json:"token_type,omitempty"`
Cryptogram string `json:"cryptogram,omitempty"`
Eci string `json:"eci,omitempty"`
Stored bool `json:"stored"`
StoreForFutureUse bool `json:"store_for_future_use,omitempty"`
Name string `json:"name,omitempty"`
Cvv string `json:"cvv,omitempty"`
BillingAddress *common.Address `json:"billing_address,omitempty"`
Phone *common.Phone `json:"phone,omitempty"`
}

requestBankAccountSource struct {
Expand Down
2 changes: 2 additions & 0 deletions payments/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ type (
Aft bool `json:"aft,omitempty"`
MerchantCategoryCode string `json:"merchant_category_code,omitempty"`
SchemeMerchantId string `json:"scheme_merchant_id,omitempty"`
PanTypeProcessed PanProcessedType `json:"pan_type_processed,omitempty"`
CkoNetworkTokenAvailable bool `json:"cko_network_token_available,omitempty"`
}

ProviderAuthorizedPaymentMethod struct {
Expand Down
2 changes: 1 addition & 1 deletion test/hosted_payments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func getHostedPaymentRequest() *hosted.HostedPaymentRequest {
Name: Name,
City: "London",
},
DisplayName: "Test",
DisplayName: "**Test Hosted Payment**",
Reference: Reference,
Description: Description,
Customer: &common.CustomerRequest{
Expand Down
1 change: 1 addition & 0 deletions test/instruments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func TestShouldGetInstrument(t *testing.T) {
}

func TestShouldGetBankAccountFields(t *testing.T) {
t.Skip("unavailable")
cases := []struct {
name string
country common.Country
Expand Down
3 changes: 0 additions & 3 deletions test/payments_request_apm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ func TestRequestPaymentsAPM(t *testing.T) {
checkForPaymentRequest: func(response *nas.PaymentResponse, err error) {
assert.NotNil(t, err)
assert.Nil(t, response)
ckoErr := err.(errors.CheckoutAPIError)
assert.Equal(t, http.StatusUnprocessableEntity, ckoErr.StatusCode)
assert.Equal(t, "payee_not_onboarded", ckoErr.Data.ErrorCodes[0])
},
},
{
Expand Down
Loading