Giter VIP home page Giter VIP logo

adyen-dotnet-online-payments's People

Contributors

deepu105 avatar dependabot[bot] avatar gcatanese avatar jlengrand avatar kwok-he-chu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

adyen-dotnet-online-payments's Issues

Bin Code info

Any way to get bincode before payment and after payment

.NET code Cors issue

I have added following lines in my startup.cs

 services.AddCors( options =>
             {
                 options.AddPolicy( name: MyAllowSpecificOrigins,
                                   builder =>
                                   {
                                       builder.WithOrigins( "https://localhost:5001" );                                                       
           
                                   } );
             } );

Still facing issues with Drop-in . It is erroring out

"status":401

hello.
I get the following error during the local test
adyen_dotnet_subscription_example.Clients.RecurringClient[0]
Request for Payments failed::
{"status":401,"errorCode":"000","message":"HTTP Status Response - Unauthorized","errorType":"security"}

image

How to fix it?

Drop-in demo returns 'Error! Reason: Cancelled' using valid test cards

I have been trying out the drop-in demo using various test card numbers from https://docs.adyen.com/development-resources/test-cards/test-card-numbers. However, so far these have all returned the 'Error! Reason: Cancelled' message, even though I have successfully tested the same numbers using curl and prefixing the numbers with 'test_'. The response from the server is:

info: adyen_dotnet_online_payments.Controllers.ApiController[0]
Response for Payment API::
class PaymentResponse {
Action:
AdditionalData:
Amount:
Authentication:
Details:
DonationToken:
FraudResult:
MerchantReference: 39b82c21-fe7d-4d6e-a6ac-108cdb498d75
Order:
OutputDetails:
PaymentData:
PspReference: 883617192418467H
Redirect:
RefusalReason: FRAUD-CANCELLED
RefusalReasonCode: 22
ResultCode: Cancelled
}

Using curl with, for instance:

"paymentMethod": {
"type": "scheme",
"encryptedCardNumber": "test_5555444433331111",
"encryptedExpiryMonth": "test_03",
"encryptedExpiryYear": "test_2030",
"encryptedSecurityCode": "test_737"

}

(using the same number) I get the resultCode "Authorised".

originKeyError when creating Adyen Checkout

I get a originKeyError in the onError javascript when trying to create a Adyen checkout, using the drop-in option, Everything else seems to be working, callback and setting up the session. Any hints to resolve this?

Use IOption Pattern for the injection of our environmental variables

Description
Let's get rid of .GetEnvironmentalVariable("...") and use IOptions to bind the values into a Model. This way, we can inject these values and use them through Dependency Injection.

Technicals
We're currently using .GetEnvironmentalVariable("ADYEN_API_KEY") to retrieve our environmental variables.
https://github.com/adyen-examples/adyen-dotnet-online-payments/blob/main/Controllers/ApiController.cs#L23-L25
We can do better by extracting this into a model and injecting/binding it using the IOptions pattern.

Additional read: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-6.0

Acceptance Criteria

  • IOption can be injected into the constructor where TOptionsModel contains the following properties:
    • ADYEN_API_KEY
    • ADYEN_MERCHANT_ACCOUNT
    • ADYEN_CLIENT_KEY
    • ADYEN_HMAC_KEY
  • Environmental Variables are loaded in first, then overwritten by appsettings.json followed by appsettings.Development.json

Webhook single item

Process first and only element in the NotificationItems array.

See documentation.

JSON and HTTP POST notifications always contain a single NotificationRequestItem object.
SOAP notifications may contain up to six NotificationRequestItem objects, in case the events triggering notifications happen within a very short period of time.

Acceptance Criteria

  • Update the WebhookController to process first and only element in the array

Card number cannot be entered

When I use the test case to run, it can run normally, but when I get to the payment page, I can’t pay, please see the screenshot:
Drop-in =>Continue to checkout =>Credit or debit card
image

Payment is refused or cancelled

When I choose either the Drop-in or Card option AND when I enter one of the test card numbers for Mastercard or Visa, I get either Cancelled or Refused value of resultCode.

Example of console log:

Navigated to https://localhost:5001/
Navigated to https://localhost:5001/preview/dropin
Navigated to https://localhost:5001/checkout/dropin
adyenImplementation.js?v=DeHm8zJSTQb72kADPbcdsCCrt-TWxnIuW8p-8zoqdq0:66 onPaymentCompleted
adyenImplementation.js?v=DeHm8zJSTQb72kADPbcdsCCrt-TWxnIuW8p-8zoqdq0:67 {resultCode: 'Refused', sessionData: '[REMOVED]'} r {_id: 'dropin-[GUID]', props: {…}, state: {…}, _node: div#payment.payment, _component: {…}, …}

I have added https://localhost:5001 in allowed origins under Client settings in API Credential configuration.

Any ideas about what is wrong?

Unable to checkout

I've pulled the latest stable. I also set the following hard-coded from the values I got off my test Adyen account.

ADYEN_API_KEY
ADYEN_MERCHANT
ADYEN_CLIENT_KEY

When I start the server (dotnet run) and go to https://localhost:5001, Chrome changes it to not secure. I chose Drop-in and after clicking "Continue to Checkout", it fails with the error below

image

Am I missing something?

Support for API version 68

Hi,

It's great that a resource like this repo exists, that shows how Adyen can be implemented in dotnet. We're currently implementing version 68 of the API. This repo currently shows how to implement API version 67, so it is missing the session creation part.

The Adyen dotnet library has support for API version 68 since version 8.0.0 that was released a couple of months ago. Will this repo be updated to show how to work with payment sessions and other potential changes in API version 68?

Thanks!

Unmounting components results goes wrong when a partial payment is successfully completed

To reproduce:

  1. Go to Gift Card Component
  2. Click continue
  3. Click Redeem gift card
  4. Click Go back
  5. Click iDeal or click Credit or debit card and go back
  6. Click Redeem gift card
  7. Enter a success scenario where you enter a valid gift card
  8. When returning to the initial screen, the iDeal or Credit or debit card components are still mounted

Expected behavior
When returning to the initial screen, using the flow above, the iDeal or Credit or debit card components should not be mounted (only the buttons should be visible, not the 'payment screen' aka mounted component)

Pay By Link example: update status

Description:
Upgrade to the latest .NET library to retrieve your paymentLink using the respective endpoint.

Acceptance Criteria

  • The paymentLink status is updated properly through either the WebhookController when processing the notification
  • The paymentLink status is reflected in the index page (when fetching all current inmemory links)

Session concept not working.

Hi,
I tried the session concept with 3D secure with the new changes and it doesn't work.

Here "urlParams" is always null.

const urlParams = new URLSearchParams(window.location.search);

Any special configuration needed to make 3D secure work?

Question: how does one pass a unique order ID using Drop-in?

This may be categorized as either a question or suggestion for development rather than an issue.

It would be very useful to know how to adapt the code in this repository so that one can send a unique order ID to the InitiatePayment API endpoint from the client side.

Error "Cannot create an instance of an interface. Object type 'Adyen.Model.Checkout.Details.IPaymentMethodDetails'.

When binding state.data to an Adyen.Model.Checkout.PaymentRequest object on .Net Framework 4.7.2 it gives the error "Cannot create an instance of an interface. Object type 'Adyen.Model.Checkout.Details.IPaymentMethodDetails'.". Apparently .net Core is ok binding this, but .net framework does not like binding to an interface. Is there an object that I should be using to bind state.data that I'm missing?

Use Supervisor API from Gitpod to retrieve the `workspaceContextUrl`

It is possible to retrieve the workspaceContextUrl by using Gitpod's supervisor API. Instead of using pattern-matching here: https://github.com/adyen-examples/adyen-dotnet-online-payments/blob/main/.gitpod.yml#L3-L20

Command:
workspaceContextUrl = $(curl -s $SUPERVISOR_ADDR/_supervisor/v1/info/workspace | jq .workspaceContextUrl)

Output:
"https://github.com/adyen-examples/adyen-dotnet-online-payments/tree/main/checkout-example"

We can use pattern-matching to launch the respective application (subscription/checkout) afterwards.

if $workspaceContextUrl == *subscription-example
then
    dotnet run --project subscription-example
else
    dotnet run --project checkout-example
fi
... etc.

Acceptance Criteria:

  • Use the supervisor API to to start the correct workspace in Gitpod when launching /checkout-example
  • Use the supervisor API to to start the correct workspace in Gitpod when launching /subscription-example
  • Default: We always launch /checkout-example

Update Web Components/Drop-in from 5.0.0 to 5.16.x (or 5.17.x)

Description
Let's update Web Components/Drop-in from the current version to the latest version. We're behind quite many versions.

Technicals
When updating the following: https://github.com/adyen-examples/adyen-dotnet-online-payments/blob/main/Views/Shared/_Layout.cshtml#L10-L18

to:

https://docs.adyen.com/online-payments/release-notes?tab=embed-script-and-stylesheet_2022-06-15-sqoc_2#releaseNote=2022-06-13-web-componentsdrop-in-5.16.2

Note: 5.17 will be released later, so it would be good to wait so we can upgrade to the latest version in one-go.

Acceptance Criteria

  • Tests (build/e2e) passed
  • Web Components/Drop-in are updated to 5.16.x (or 5.17.x) latest version

Updating to use TypeScript and type definitions from adyen-web npm package

I'm working on changing the adyenImplementation.js in checkout-example to use TypeScript so that it is easier to update to the latest version and let the TypeScript compiler catch the breaking changes.

I've tried the steps below but it does not look like the adyen type definition files can be used by this project as they seem to depend on a module loader being used in the browser. Is there an easy way to use the TypeScript definition files from the Adyen npm package in this project?

My fork of the project with the changes below is at https://github.com/RyanONeill1970/adyen-dotnet-online-payments .

  1. I've copied adyenImplementation.js to /scripts/adyenImplementation.ts, it will overwrite the .js when compiled.
  2. This shows that TypeScript is unaware of AdyenCheckout. To fix this I've added a package.json and set dependencies to include "@adyen/adyen-web": "5.31.1" . This downloads the latest version of the Adyen JS library into node_modules.
  3. Changed callServer("/api/sessions") to callServer("/api/sessions", null) to explicitly pass in the unused parameter. Fixes a TypeScript parameter error.
  4. Added a tsconfig.json file and set the js target to be es2017, this fixes the error caused by the usage of async.
  5. In the tsconfig.json file, set moduleResolution to node which ensures the Adyen npm package is built and found.
  6. In the tsconfig.json file, set outDir to "wwwroot/js" to output the compiled adyen-implementation.js.
  7. Add a TypeScript definition reference of '///
    ' to the root of adyenImplementation.ts to ensure it finds the type definitions in the Adyen npm package. This should not be needed and is just for troubleshooting.

The TypeScript compiler does not pick up the type definitions from the the npm package, it seems ignore the file as it contains imports and exports. This results in a failed compile.

Original index.d.ts from the Adyen npm package;

import { CoreOptions } from './core/types';
import Checkout from './core';
declare function AdyenCheckout(props: CoreOptions): Promise<Checkout>;
export default AdyenCheckout;

If I replace the above file contents with the following, it compiles;

declare var AdyenCheckout: any;

This proves that TypeScript can find the file, but the contents don't look like a traditional type definition file (I think), so it is not used as such.

This means means I don't get any type definitions. For example, TypeScript now ignores the error with AdyenCheckout now being async in the latest version.

Enable HMAC signature validation

In the Webhook (WebhookController) add HMAC signature validation like in the other sample apps.

Make sure the response [accepted] is only returned when the HMAC validation is successful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.