-
-
Notifications
You must be signed in to change notification settings - Fork 85
11. Profile Api
In order to process payments, you need to create a website profile. A website profile can easily be created via the Dashboard manually. However, the Mollie API also allows automatic profile creation via the Profiles API.
ProfileRequest profileRequest = new ProfileRequest() {
Name = {name},
Website = {website},
...
};
using IProfileClient client = new ProfileClient({yourApiKey});
ProfileResponse response = client.CreateProfileAsync(profileRequest);
Retrieve details of a profile, using the profile’s identifier.
using IProfileClient client = new ProfileClient({yourApiKey});
ProfileResponse profileResponse = await client.GetProfileAsync({profileId});
Use this API if you are creating a plugin or SaaS application that allows users to enter a Mollie API key, and you want to give a confirmation of the website profile that will be used in your plugin or application.
using IProfileClient client = new ProfileClient({yourApiKey});
ProfileResponse profileResponse = await client.GetCurrentProfileAsync();
A profile is required to process payments. A profile can easily be created and updated via the Dashboard manually. However, the Mollie API also allows automatic profile creation and updates via the Profiles API.
ProfileRequest profileRequest = new ProfileRequest() {
Name = {name},
Website = {website},
...
};
using IProfileClient client = new ProfileClient({yourApiKey});
ProfileResponse profileResponse = await client.UpdateProfileAsync({profileId}, profileRequest);
Enable or disable a payment method on a specific or authenticated profile to use it with payments.
using IProfileClient client = new ProfileClient({yourApiKey});
PaymentMethodResponse paymentMethodResponse = await profileClient.EnablePaymentMethodAsync({profileId}, PaymentMethod.Ideal);
await profileClient.DisablePaymentMethodAsync({profileId}, PaymentMethod.Ideal);
Enable or disable a gift card issuer on a specific or authenticated profile to use it with payments.
using IProfileClient client = new ProfileClient({yourApiKey});
const string issuerToToggle = "festivalcadeau";
EnableGiftCardIssuerResponse paymentMethodResponse = await profileClient.EnableGiftCardIssuerAsync({profileId}, issuerToToggle);
await profileClient.DisableGiftCardIssuerAsync({profileId}, issuerToToggle);