adyen-examples / adyen-dotnet-online-payments Goto Github PK
View Code? Open in Web Editor NEWAccept payments on your .NET website with cards, wallets, and key local payment methods
License: MIT License
Accept payments on your .NET website with cards, wallets, and key local payment methods
License: MIT License
Any way to get bincode before payment and after payment
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
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".
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?
I am trying to post the "PaymentRequest" object via ajax (JSON.stringify) to server side but i am getting error as "BrowserInfo" is doesn't have parameterless constructor.
Any solution to this?
Thanks.
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
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
Compared to most examples, the dotnet code uses /Home prepended to paths, and uses Checkin instead of checkin.
We have to unformize this to make it easier to upgrade in the future.
Manged to get this example running after a few tries. Following the instruction resulted in an exception when getting the payment methods. Looks like the instructions are for MAC and not windows?
The javascript file adyenImplementation.js makes frequent use of "=>" which is not supported by IE. See https://stackoverflow.com/questions/44437497/syntax-error-using-in-ie.
I'll write a blogpost about this so developers can follow along. Let's include this in the readme once it's out.
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?
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
Am I missing something?
We are currently running on 3.1.0, but the latest version is 6x.
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!
To reproduce:
Gift Card Component
continue
Redeem gift card
Go back
iDeal
or click Credit or debit card
and go backRedeem gift card
iDeal
or Credit or debit card
components are still mountedExpected 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)
Description:
Upgrade to the latest .NET library to retrieve your paymentLink using the respective endpoint.
Acceptance Criteria
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?
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.
Investigate how we can support different E2E flows (checkout, subscription)
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?
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:
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:
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
Create workflow to run e2e testing
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 .
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.