This repository was archived by the owner on Jun 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import base64
2-
31import requests
42import json
53from moyasar .payment import Payment
Original file line number Diff line number Diff line change 55
66class Create (Constructor ):
77 def __init__ (self , data ):
8- super ().__init__ (data )
8+ super ().__init__ (** data )
99
1010 @classmethod
1111 def create_url (cls ):
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ def __init__(self, **kwargs):
88 super ().__init__ (** kwargs )
99
1010 @classmethod
11- def build (cls , payment ):
12- if payment . source ['type' ] == "creditcard" :
13- payment . source = Source .source_to_creditcard (payment . source )
11+ def build (cls , source ):
12+ if source ['type' ] == "creditcard" :
13+ source = Source .source_to_creditcard (source )
1414 else :
15- payment . source = Source .source_to_sadad (payment . source )
16- return payment
15+ source = Source .source_to_sadad (source )
16+ return source
1717
1818 @classmethod
1919 def source_to_creditcard (cls , data ):
@@ -37,8 +37,9 @@ class Sadad(Source):
3737class Payment (Resource , Refund ):
3838 def __init__ (self , data ):
3939 super ().__init__ (data )
40- Source .build (self )
40+ self . source = Source .build (self . source )
4141
4242 def refund (self , amount = None ):
4343 super ().refund (amount )
44- __class__ .build (self )
44+ self .source = Source .build (self .source )
45+ return self
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ py==1.8.0
2222py-bcrypt == 0.4
2323Pygments == 2.3.1
2424pytest == 4.3.0
25- PyYAML == 3.13
25+ PyYAML == 4.2b1
2626requests == 2.21.0
2727six == 1.12.0
2828smmap2 == 2.0.5
Original file line number Diff line number Diff line change 1+ import setuptools
2+
3+ with open ("README.rst" , "r" ) as fh :
4+ long_description = fh .read ()
5+ setuptools .setup (
6+ name = "moyasar-python" ,
7+ version = "0.6" ,
8+ author = "Moyasar" ,
9+ author_email = "developer@moyasar.com" ,
10+ description = "Moyasar Python language wrapper" ,
11+ long_description = long_description ,
12+ long_description_content_type = "text/markdown" ,
13+ url = "https://github.com/moyasar/moyasar-python" ,
14+ packages = setuptools .find_packages (),
15+ classifiers = [
16+ "Programming Language :: Python :: 3" ,
17+ "License :: MIT License" ,
18+ "Operating System :: OS Independent" ,
19+ ],
20+ )
You can’t perform that action at this time.
0 commit comments