Skip to content

Commit cfdd458

Browse files
committed
Braintree string constants
1 parent fe020df commit cfdd458

26 files changed

+1083
-1058
lines changed

stubs/braintree/braintree/address.pyi

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from _typeshed import Incomplete
2+
from typing import Final
23

34
from braintree.configuration import Configuration as Configuration
45
from braintree.error_result import ErrorResult as ErrorResult
@@ -7,13 +8,13 @@ from braintree.successful_result import SuccessfulResult as SuccessfulResult
78

89
class Address(Resource):
910
class ShippingMethod:
10-
SameDay: str
11-
NextDay: str
12-
Priority: str
13-
Ground: str
14-
Electronic: str
15-
ShipToStore: str
16-
PickupInStore: str
11+
SameDay: Final = "same_day"
12+
NextDay: Final = "next_day"
13+
Priority: Final = "priority"
14+
Ground: Final = "ground"
15+
Electronic: Final = "electronic"
16+
ShipToStore: Final = "ship_to_store"
17+
PickupInStore: Final = "pickup_in_store"
1718

1819
@staticmethod
1920
def create(params: Incomplete | None = None): ...

stubs/braintree/braintree/apple_pay_card.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from typing import Any
1+
from typing import Any, Final
22

33
from braintree.resource import Resource as Resource
44

55
class ApplePayCard(Resource):
66
class CardType:
7-
AmEx: str
8-
MasterCard: str
9-
Visa: str
7+
AmEx: Final = "Apple Pay - American Express"
8+
MasterCard: Final = "Apple Pay - MasterCard"
9+
Visa: Final = "Apple Pay - Visa"
1010

1111
is_expired: Any
1212
subscriptions: Any

stubs/braintree/braintree/credit_card.pyi

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import Incomplete
22
from enum import Enum
3-
from typing import Any
3+
from typing import Any, Final
44

55
from braintree.address import Address as Address
66
from braintree.configuration import Configuration as Configuration
@@ -9,33 +9,33 @@ from braintree.resource import Resource as Resource
99

1010
class CreditCard(Resource):
1111
class CardType:
12-
AmEx: str
13-
CarteBlanche: str
14-
ChinaUnionPay: str
15-
DinersClubInternational: str
16-
Discover: str
17-
Electron: str
18-
Elo: str
19-
Hiper: str
20-
Hipercard: str
21-
JCB: str
22-
Laser: str
23-
UK_Maestro: str
24-
Maestro: str
25-
MasterCard: str
26-
Solo: str
27-
Switch: str
28-
Visa: str
29-
Unknown: str
12+
AmEx: Final = "American Express"
13+
CarteBlanche: Final = "Carte Blanche"
14+
ChinaUnionPay: Final = "China UnionPay"
15+
DinersClubInternational: Final = "Diners Club"
16+
Discover: Final = "Discover"
17+
Electron: Final = "Electron"
18+
Elo: Final = "Elo"
19+
Hiper: Final = "Hiper"
20+
Hipercard: Final = "Hipercard"
21+
JCB: Final = "JCB"
22+
Laser: Final = "Laser"
23+
UK_Maestro: Final = "UK Maestro"
24+
Maestro: Final = "Maestro"
25+
MasterCard: Final = "MasterCard"
26+
Solo: Final = "Solo"
27+
Switch: Final = "Switch"
28+
Visa: Final = "Visa"
29+
Unknown: Final = "Unknown"
3030

3131
class CustomerLocation:
32-
International: str
33-
US: str
32+
International: Final = "international"
33+
US: Final = "us"
3434

3535
class CardTypeIndicator:
36-
Yes: str
37-
No: str
38-
Unknown: str
36+
Yes: Final = "Yes"
37+
No: Final = "No"
38+
Unknown: Final = "Unknown"
3939

4040
class DebitNetwork(Enum):
4141
Accel = "ACCEL"

stubs/braintree/braintree/credit_card_verification.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any
1+
from typing import Any, Final
22

33
from braintree.attribute_getter import AttributeGetter as AttributeGetter
44
from braintree.configuration import Configuration as Configuration
@@ -8,10 +8,10 @@ from braintree.three_d_secure_info import ThreeDSecureInfo as ThreeDSecureInfo
88

99
class CreditCardVerification(AttributeGetter):
1010
class Status:
11-
Failed: str
12-
GatewayRejected: str
13-
ProcessorDeclined: str
14-
Verified: str
11+
Failed: Final = "failed"
12+
GatewayRejected: Final = "gateway_rejected"
13+
ProcessorDeclined: Final = "processor_declined"
14+
Verified: Final = "verified"
1515

1616
amount: Any
1717
currency_iso_code: Any

stubs/braintree/braintree/disbursement.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from typing import Any
1+
from typing import Any, Final
22

33
from braintree.merchant_account import MerchantAccount as MerchantAccount
44
from braintree.resource import Resource as Resource
55
from braintree.transaction_search import TransactionSearch as TransactionSearch
66

77
class Disbursement(Resource):
88
class Type:
9-
Credit: str
10-
Debit: str
9+
Credit: Final = "credit"
10+
Debit: Final = "debit"
1111

1212
amount: Any
1313
merchant_account: Any

stubs/braintree/braintree/dispute.pyi

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any
1+
from typing import Any, Final
22

33
from braintree.attribute_getter import AttributeGetter as AttributeGetter
44
from braintree.configuration import Configuration as Configuration
@@ -11,46 +11,46 @@ from braintree.transaction_details import TransactionDetails as TransactionDetai
1111

1212
class Dispute(AttributeGetter):
1313
class Status:
14-
Accepted: str
15-
AutoAccepted: str
16-
Disputed: str
17-
Expired: str
18-
Lost: str
19-
Open: str
20-
UnderReview: str
21-
Won: str
14+
Accepted: Final = "accepted"
15+
AutoAccepted: Final = "auto_accepted"
16+
Disputed: Final = "disputed"
17+
Expired: Final = "expired"
18+
Lost: Final = "lost"
19+
Open: Final = "open"
20+
UnderReview: Final = "under_review"
21+
Won: Final = "won"
2222

2323
class Reason:
24-
CancelledRecurringTransaction: str
25-
CreditNotProcessed: str
26-
Duplicate: str
27-
Fraud: str
28-
General: str
29-
InvalidAccount: str
30-
NotRecognized: str
31-
ProductNotReceived: str
32-
ProductUnsatisfactory: str
33-
Retrieval: str
34-
TransactionAmountDiffers: str
24+
CancelledRecurringTransaction: Final = "cancelled_recurring_transaction"
25+
CreditNotProcessed: Final = "credit_not_processed"
26+
Duplicate: Final = "duplicate"
27+
Fraud: Final = "fraud"
28+
General: Final = "general"
29+
InvalidAccount: Final = "invalid_account"
30+
NotRecognized: Final = "not_recognized"
31+
ProductNotReceived: Final = "product_not_received"
32+
ProductUnsatisfactory: Final = "product_unsatisfactory"
33+
Retrieval: Final = "retrieval"
34+
TransactionAmountDiffers: Final = "transaction_amount_differs"
3535

3636
class Kind:
37-
Chargeback: str
38-
PreArbitration: str
39-
Retrieval: str
37+
Chargeback: Final = "chargeback"
38+
PreArbitration: Final = "pre_arbitration"
39+
Retrieval: Final = "retrieval"
4040

4141
class ChargebackProtectionLevel:
42-
Effortless: str
43-
Standard: str
44-
NotProtected: str
42+
Effortless: Final = "effortless"
43+
Standard: Final = "standard"
44+
NotProtected: Final = "not_protected"
4545

4646
class PreDisputeProgram:
47-
NONE: str
48-
VisaRdr: str
47+
NONE: Final = "none"
48+
VisaRdr: Final = "visa_rdr"
4949

5050
class ProtectionLevel:
51-
EffortlessCBP: str
52-
StandardCBP: str
53-
NoProtection: str
51+
EffortlessCBP: Final = "Effortless Chargeback Protection tool"
52+
StandardCBP: Final = "Chargeback Protection tool"
53+
NoProtection: Final = "No Protection"
5454

5555
@staticmethod
5656
def accept(id): ...

stubs/braintree/braintree/document_upload.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from _typeshed import Incomplete
2+
from typing import Final
23

34
from braintree.configuration import Configuration as Configuration
45
from braintree.resource import Resource as Resource
56
from braintree.successful_result import SuccessfulResult as SuccessfulResult
67

78
class DocumentUpload(Resource):
89
class Kind:
9-
EvidenceDocument: str
10+
EvidenceDocument: Final = "evidence_document"
1011

1112
@staticmethod
1213
def create(params: Incomplete | None = None): ...

0 commit comments

Comments
 (0)