Skip to content

Commit

Permalink
Adds lenght to response_reason_text, updates readme and version
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav0 committed Sep 10, 2020
1 parent 074d33c commit b740945
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,40 @@ https://yourdomain.com/epayco/confirmation
It is important to use https, and if you are working locally you can use tools
like [ngrok](https://ngrok.com/).


### Template tags
We have a templatetag to generate a payment button that is quick and easy to
implement. It also is very customisable, you can assign any variable that's
available on the epayco checkout page.

Here is an example of how to use it.

```
{% load epayco_checkout %}
<div class="my-button">
{% render_checkout amount=9999 name="Test payment" currency="COP" extra1=request.user.id extra2="membership-3" request=request %}
</div>
```
And that's it, you have a fully working payment button. This tag uses the image
you set in the settings `CHECKOUT_BUTTON_URL`.

You can check the complete list of options for this template tag
[here](https://github.com/gustav0/epayco_django/blob/master/epayco_django/templatetags/epayco_checkout.py).


### Default payment responses
We have a template that is shown by the default payment response validation view at
`https://example.com/payment/response-validation`.

You can override this and whatever you feel like. Just create a new template at:
`templates/simple_payment_response.html`


### Payment Confirmation

Now that you set payment confirmations to be reported to your site, we can listen
to whatever confirmation is sent, validate it and act on it. Listen to any of the
Now that you set payment confirmations to be reported to your site, we can listen
to whatever confirmation is sent, validate it and act on it. Listen to any of the
`epayco_django.signals` you are interested in and you should be able to acomplish
what you need. Here is an example:
```
Expand Down Expand Up @@ -151,11 +181,9 @@ class MyView(TemplateView):
```

## Contributing
I'm always grateful for any kind of contribution including but not limited to bug
reports, code enhancements, bug fixes, and even functionality suggestions.
I'm always grateful for any kind of contribution including but not limited to bug reports, code enhancements, bug fixes, and even functionality suggestions.

##### You can report any bug you find or suggest new functionality with a new
[issue](https://github.com/gustav0/epayco_django/issues).
##### You can report any bug you find or suggest new functionality with a new [issue](https://github.com/gustav0/epayco_django/issues).

##### If you want to add yourself some functionality to the wrapper:
1. Fork it ( https://github.com/gustav0/epayco_django)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.3 on 2020-09-10 00:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('epayco_django', '0002_transaction_id_max_length'),
]

operations = [
migrations.AlterField(
model_name='paymentconfirmation',
name='response_reason_text',
field=models.CharField(max_length=256),
),
]
2 changes: 1 addition & 1 deletion epayco_django/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class AbstractTransactionSegment(models.Model):
approval_code = models.CharField(max_length=16)
transaction_date = models.CharField(max_length=32)
cod_response = models.CharField(max_length=8)
response_reason_text = models.CharField(max_length=64)
response_reason_text = models.CharField(max_length=256)
errorcode = models.CharField(max_length=16)
cod_transaction_state = models.CharField(max_length=8)
business = models.CharField(max_length=256)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def read(fname):


setup(name='epayco-django',
version='0.0.6',
version='0.0.8',
include_package_data=True,
license='MIT',
description="A django integration for ePayco's gateway.",
Expand Down

0 comments on commit b740945

Please sign in to comment.