Skip to content

Commit

Permalink
Add missing python code examples for profiles api
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesco van Zundert authored and Tom Hendrikx committed Jun 14, 2021
1 parent efaddc9 commit 4c2512e
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/reference/v2/profiles-api/create-profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,25 @@ Example
"mode" => "live",
]);
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
profile = mollie_client.profiles.create(
data={
'name': 'My website name',
'website': 'https://www.mywebsite.com',
'email': '[email protected]',
'phone': '+31208202070',
'categoryCode': '5399',
'mode': 'live',
}
)
.. code-block:: ruby
:linenos:
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/delete-profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ Example
$mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");
$mollie->profiles->delete("pfl_v9hTwCvYqw");
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profiles.delete('pfl_v9hTwCvYqw')
.. code-block:: ruby
:linenos:
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/disable-gift-card-issuer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ Request
curl -X DELETE https://api.mollie.com/v2/profiles/pfl_v9hTwCvYqw/methods/giftcard/issuers/festivalcadeau \
-H "Authorization: Bearer access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ"
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profile_methods.with_parent_id('pfl_v9hTwCvYqw', 'giftcard').delete('festivalcadeau')
Response
^^^^^^^^
.. code-block:: none
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/disable-method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ Request
$profile->disableMethod('ideal');
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profile_methods.with_parent_id('pfl_v9hTwCvYqw', 'ideal').delete()
Response
^^^^^^^^
.. code-block:: none
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/disable-voucher-issuer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ Request
curl -X DELETE https://api.mollie.com/v2/profiles/pfl_v9hTwCvYqw/methods/voucher/issuers/appetiz \
-H "Authorization: Bearer access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ"
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profile_methods.with_parent_id('pfl_v9hTwCvYqw', 'voucher').delete('appetiz')
Response
^^^^^^^^
.. code-block:: http
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/enable-gift-card-issuer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ Request
curl -X POST https://api.mollie.com/v2/profiles/pfl_v9hTwCvYqw/methods/giftcard/issuers/festivalcadeau \
-H "Authorization: Bearer access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ"
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profile_methods.with_parent_id('pfl_v9hTwCvYqw', 'giftcard').create('festivalcadeau')
Response
^^^^^^^^
.. code-block:: none
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/enable-method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Request
$profile->enableMethod('ideal');
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profile_methods.with_parent_id('pfl_v9hTwCvYqw', 'ideal').create()
Response
^^^^^^^^
.. code-block:: none
Expand Down
12 changes: 12 additions & 0 deletions source/reference/v2/profiles-api/enable-voucher-issuer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ Request
-H "Content-Type: application/json" \
--data-raw '{ "contractId": "abc123" }'
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
mollie_client.profile_methods.with_parent_id('pfl_v9hTwCvYqw', 'voucher').create(
'appetiz', data={'contractId': 'abc123'}
)
Response
^^^^^^^^
.. code-block:: http
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/get-profile-me.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ Request
$mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");
$profile = $mollie->profiles->getCurrent();
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_api_key('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM')
profile = mollie_client.profiles.get('me')
Response
^^^^^^^^
.. code-block:: none
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/get-profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ Example
$mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");
$profile = $mollie->profiles->get("pfl_v9hTwCvYqw");
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
profile = mollie_client.profiles.get('pfl_v9hTwCvYqw')
.. code-block:: ruby
:linenos:
Expand Down
10 changes: 10 additions & 0 deletions source/reference/v2/profiles-api/list-profiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ Example
$mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");
$profiles = $mollie->profiles->page();
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
profiles = mollie_client.profiles.list()
.. code-block:: ruby
:linenos:
Expand Down
19 changes: 19 additions & 0 deletions source/reference/v2/profiles-api/update-profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,25 @@ Example
$profile->categoryCode = "5399";
$updatedProfile = $profile->update();
.. code-block:: python
:linenos:
from mollie.api.client import Client
mollie_client = Client()
mollie_client.set_access_token('access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ')
profile = mollie_client.profiles.update(
'pfl_v9hTwCvYqw',
data={
'name': 'My website name - Update 1',
'website': 'https://www.mywebsite2.com',
'email': '[email protected]',
'phone': '+31208202070',
'categoryCode': '5399',
},
)
.. code-block:: ruby
:linenos:
Expand Down

0 comments on commit 4c2512e

Please sign in to comment.