Skip to content

Commit 77fc1c9

Browse files
Update readme sdk version. Add python readme file
1 parent 741f267 commit 77fc1c9

8 files changed

Lines changed: 132 additions & 13 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ Download, unzip, add your keys, build and run in your preferred language. You ca
5353

5454
## All together in a simple view
5555

56-
| Language | Repository | Package | Status |
57-
|:--------:|:----------:|:-------:|:-------|
58-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/java) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/java.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_java_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_java_package.yml) |
59-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/dot-net/dot-net-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/net) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/net.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_net_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_net_package.yml) |
60-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/php) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/php.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_php_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_php_package.yml) |
61-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/python/python-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/python) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/python.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_python_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_python_package.yml) |
62-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/ruby/ruby-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/ruby) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/ruby.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_ruby_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_ruby_package.yml) |
63-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/go/go-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/go) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/go.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_go_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_go_package.yml) |
64-
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/node) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/node.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_node_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_node_package.yml) |
56+
| Language | Repository | Package | Status | SDK Version |
57+
|:--------:|:----------:|:-------:|:-------|:------------|
58+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/java) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/java.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_java_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_java_package.yml) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.checkout/checkout-sdk-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.checkout/checkout-sdk-java/) |
59+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/dot-net/dot-net-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/net) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/net.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_net_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_net_package.yml) | [![NuGet](https://img.shields.io/nuget/v/CheckoutSDK.svg)](https://www.nuget.org/packages/CheckoutSDK) |
60+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/php) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/php.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_php_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_php_package.yml) | [![Latest Stable Version](http://poser.pugx.org/checkout/checkout-sdk-php/v)](https://packagist.org/packages/checkout/checkout-sdk-php) |
61+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/python/python-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/python) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/python.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_python_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_python_package.yml) | [![PyPI - latest](https://img.shields.io/pypi/v/checkout-sdk?label=latest&logo=pypi)](https://pypi.org/project/checkout-sdk) |
62+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/ruby/ruby-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/ruby) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/ruby.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_ruby_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_ruby_package.yml) | [![Gem Version](https://badge.fury.io/rb/checkout_sdk.svg)](https://badge.fury.io/rb/checkout_sdk) |
63+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/go/go-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/go) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/go.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_go_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_go_package.yml) | [![GitHub release](https://img.shields.io/github/release/checkout/checkout-sdk-go.svg)](https://github.com/checkout/checkout-sdk-go/releases/) |
64+
| <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg" width="20" height="20"> | [:link:](https://github.com/checkout/sdk-samples/tree/main/node) | [:arrow_down:](https://github.com/checkout/sdk-samples/blob/packages/node.zip) | [![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_node_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_node_package.yml) | [![npm version](https://img.shields.io/npm/v/checkout-sdk-node.svg?style=flat)](https://www.npmjs.com/package/checkout-sdk-node) |
6565

6666
## Example images
6767
![image](/assets/image_front_payment_checkout.png)

go/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_go_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_go_package.yml)
2+
[![GitHub release](https://img.shields.io/github/release/checkout/checkout-sdk-go.svg)](https://github.com/checkout/checkout-sdk-go/releases/)
3+
14
This project is an example of how to start an integration with GO and [Checkout SDK](https://github.com/checkout/checkout-sdk-go)
25

36
This project uses `Go Modules` as the dependencies manager for all the requirements that a project needs,

java/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_java_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_java_package.yml)
2+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.checkout/checkout-sdk-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.checkout/checkout-sdk-java/)
3+
4+
15
This project is an example of how to start an integration with JAVA and [Checkout SDK](https://github.com/checkout/checkout-sdk-java)
26

37
This project uses `Gradle` as the dependencies manager for all the requirements that a project needs, ensure that you have Gradle installed before running the project.
@@ -66,8 +70,9 @@ RequestTokenSource tokenSource = RequestTokenSource.builder()
6670

6771
PaymentRequest request = PaymentRequest.builder()
6872
.source(tokenSource)
69-
.currency(Currency.GBP)
7073
.amount(2499L)
74+
.currency(Currency.GBP)
75+
.processingChannelId("pc_XXX")
7176
.build();
7277

7378
PaymentResponse response;

net/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_net_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_net_package.yml)
2+
[![NuGet](https://img.shields.io/nuget/v/CheckoutSDK.svg)](https://www.nuget.org/packages/CheckoutSDK)
3+
14
This project is an example of how to start an integration with .Net and [Checkout SDK](https://github.com/checkout/checkout-sdk-net)
25

36
This project uses `Microsoft.AspNetCore.App` and `net6.0` and `NuGetPackages` as the package manager for all the requirements that a project needs.
@@ -59,7 +62,8 @@ try
5962
{
6063
Source = new RequestTokenSource { Token = data.Token },
6164
Amount = 2499,
62-
Currency = Currency.GBP
65+
Currency = Currency.GBP,
66+
ProcessingChannelId = "pc_XXX"
6367
};
6468

6569
var response = await _checkoutApi.PaymentsClient().RequestPayment(request);

node/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_node_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_node_package.yml)
2+
[![npm version](https://img.shields.io/npm/v/checkout-sdk-node.svg?style=flat)](https://www.npmjs.com/package/checkout-sdk-node)
3+
14
This project is an example of how to start an integration with Node and [Checkout SDK](https://github.com/checkout/checkout-sdk-node)
25

36
This project uses `npm` as the package manager for all the requirements that a project needs, ensure that you have npm installed before running the project.
@@ -55,9 +58,9 @@ router.post('/pay', async (req, res) => {
5558
source: {
5659
token: myToken,
5760
},
61+
amount: 2499,
5862
currency: 'GBP',
5963
processing_channel_id: 'pc_zs5fqhybzc2e3jmq3efvybybpq',
60-
amount: 2499,
6164
risk: {
6265
enabled: false,
6366
},

php/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_php_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_php_package.yml)
2+
[![Latest Stable Version](http://poser.pugx.org/checkout/checkout-sdk-php/v)](https://packagist.org/packages/checkout/checkout-sdk-php)
3+
14
This project is an example of how to start an integration with PHP and [Checkout SDK](https://github.com/checkout/checkout-sdk-php)
25

36
This project uses `composer` as the package manager for all the requirements that a project needs, ensure that you have composer installed before running the project.
@@ -64,8 +67,9 @@ $requestTokenSource->token = $request->token;
6467

6568
$request = new PaymentRequest();
6669
$request->source = $requestTokenSource;
67-
$request->currency = Currency::$GBP;
6870
$request->amount = 2499;
71+
$request->currency = Currency::$GBP;
72+
$request->processing_channel_id = "pc_XXX";
6973

7074
try {
7175
echo json_encode($api->getPaymentsClient()->requestPayment($request));

python/README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_python_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_python_package.yml)
2+
[![PyPI - latest](https://img.shields.io/pypi/v/checkout-sdk?label=latest&logo=pypi)](https://pypi.org/project/checkout-sdk)
3+
4+
This project is an example of how to start an integration with Python and [Checkout SDK](https://github.com/checkout/checkout-sdk-python)
5+
6+
This project uses `pip` as the package manager for all the requirements that a project needs, ensure that you have pip installed before running the project.
7+
8+
# :sparkles: Before Start
9+
10+
To remain comply with PCI regulations, you need to protect your card numbers, fortunately Checkout have [Frames Framework](https://www.checkout.com/docs/integrate/frames#Who_is_Frames_for?) that helps you to tokenize the payment card, this wrapper includes method `submitCard()`. In the below example, we call this when the "Pay Now" button is clicked.
11+
12+
````html
13+
<form id="payment-form" method="POST">
14+
<div class="one-liner">
15+
<div class="card-frame"></div>
16+
<button id="pay-button" disabled>
17+
PAY GBP 24.99
18+
</button>
19+
</div>
20+
<p class="error-message"></p>
21+
<p class="payment-message"></p>
22+
</form>
23+
24+
<script src="https://cdn.checkout.com/js/framesv2.min.js"></script>
25+
````
26+
27+
Then we intercept the `event` and let Frames to tokenize the card
28+
29+
````javascript
30+
form.addEventListener('submit', function (event) {
31+
event.preventDefault();
32+
Frames.submitCard();
33+
});
34+
````
35+
36+
Make sure to provide your correct `Public Key` in `script.js`, which is the key that authorizes to you the access to Checkout API's
37+
38+
````javascript
39+
Frames.init('pk_sbox_XXX');
40+
````
41+
42+
Once that Frames validates and returns the tokenized token, then you can add another event to handle the request
43+
to the backed. If you have any questions regarding the Frames events you can visit the [documentation page](https://www.checkout.com/docs/integrate/frames/frames-reference)
44+
45+
On the backed you need to initiate the SDK with the proper `Secret Key` as follows:
46+
47+
```python
48+
try:
49+
sdk = CheckoutSdk.builder() \
50+
.secret_key('sk_sbox_XXX') \
51+
.environment(environment=Environment.sandbox()) \
52+
.build()
53+
except Exception as e:
54+
return json.dumps({'status': e.http_metadata.status_code, 'error-message': e.http_metadata.reason})
55+
```
56+
57+
If you have any questions regarding SDK usage, please refer to SDK landing [page](https://github.com/checkout/checkout-sdk-python)
58+
59+
Then you need to build your request, in this case is a `payment request` with `token source` and then
60+
just call the the SDK function to request a payment
61+
62+
```python
63+
request_token = request.json
64+
65+
token_source = RequestTokenSource()
66+
token_source.token = request_token['token']
67+
68+
payment_request = PaymentRequest()
69+
payment_request.source = token_source
70+
payment_request.amount = 2499
71+
payment_request.currency = Currency.GBP
72+
payment_request.processing_channel_id = 'pc_XXX'
73+
74+
response = sdk.payments.request_payment(payment_request)
75+
return json.dumps(response.__dict__, default=lambda o: o.__dict__, indent=4)
76+
```
77+
78+
And that's it! Your payment has been processed.
79+
80+
### :book: Checkout our official documentation.
81+
82+
* [Official Docs (Default)](https://docs.checkout.com/)
83+
* [Official Docs (Previous)](https://docs.checkout.com/previous)
84+
85+
### :books: Check out our official API documentation guide, where you can also find more usage examples.
86+
87+
* [API Reference (Default)](https://api-reference.checkout.com/)
88+
* [API Reference (Previous)](https://api-reference.checkout.com/previous)
89+
90+
91+
# :rocket: Run the project and test it out
92+
93+
```shell
94+
python -m pip install --upgrade pip
95+
pip install -r requirements-dev.txt
96+
flask --app app run
97+
```

ruby/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![build-status](https://github.com/checkout/sdk-samples/actions/workflows/create_ruby_package.yml/badge.svg)](https://github.com/checkout/sdk-samples/actions/workflows/create_ruby_package.yml)
2+
[![Gem Version](https://badge.fury.io/rb/checkout_sdk.svg)](https://badge.fury.io/rb/checkout_sdk)
3+
14
This project is an example of how to start an integration with Ruby and [Checkout SDK](https://github.com/checkout/checkout-sdk-ruby)
25

36
This project uses `Bundler` to track and install the gems and versions needed.

0 commit comments

Comments
 (0)