.package(url: "https://github.com/MihaelIsaev/braintree_swift", from: "0.1.0"),
And add "Braintree"
in targets.
First of all import the lib
import Braintree
and then register it as provider
try services.register(Braintree(environment: .sandbox, merchantId: "YOUR_MERCHANT_ID", publicKey: "YOUR_PUBLIC_KEY", privateKey: "YOUR_PRIVATE_KEY"))
e.g. you'd like to generate a token for a user, it is possible through ClientToken
gateway
func clientToken(_ req: Request) throws -> Future<String> {
//get an instance of Braintree provider
let bt = try req.make(Braintree.self)
//access clientToken gateway and call its generate endpoint
return try bt.gateway(container: req).clientToken.generate()
}
Please feel free to contribute!
Braintree is a big library with a lot of gateways, its objects and requests.
Below you can see a list of completed and incompleted parts of the lib, and it would be great to get any help with it.
- AddOnGateway
- AddressGateway
- ClientTokenGateway
- CreditCardGateway
- CreditCardVerificationGateway
- CustomerGateway
- DiscountGateway
- DisputeGateway
- DocumentUploadGateway
- IdealPaymentGateway
- MerchantAccountGateway
- MerchantGateway
- OAuthGateway
- PayPalAccountGateway
- PaymentMethodGateway
- PaymentMethodNonceGateway
- PlanGateway
- ReportGateway
- SettlementBatchSummaryGateway
- SubscriptionGateway
- TestingGateway
- TransactionGateway
- TransactionLineItemGateway
- TransparentRedirectGateway
- UsBankAccountGateway
- UsBankAccountVerificationGateway
- WebhookNotificationGateway
- AccountUpdaterDailyReport
- AchMandate
- AddOn
- Address
- AmexExpressCheckoutCard
- AmexExpressCheckoutDetails
- AndroidPayCard
- AndroidPayDetails
- ApplePayCard
- ApplePayDetails
- AuthorizationAdjustment
- BinData
- BusinessDetails
- CoinbaseAccount
- CoinbaseDetails
- ConnectedMerchantPayPalStatusChanged
- ConnectedMerchantStatusTransitioned
- CreditCard
- CreditCardVerification
- Customer
- Descriptor
- Disbursement
- DisbursementDetails
- Discount
- Dispute
- DisputeEvidence
- DisputeStatusHistory
- DisputeTransaction
- DocumentUpload
- EuropeBankAccount
- FacilitatedDetails
- FacilitatorDetails
- FundingDetails
- GrantedPaymentInstrumentUpdate
- IbanBankAccount
- IdealPayment
- IdealPaymentDetails
- IndividualDetails
- MasterpassCard
- MasterpassCardDetails
- Merchant
- MerchantAccount
- Modification
- OAuthAccessRevocation
- OAuthCredentials
- OAuthResult
- PartnerMerchant
- PayPalAccount
- PayPalDetails
- PaymentInstrumentType
- PaymentMethod
- PaymentMethodNonce
- PaymentMethodNonceDetails
- Plan
- RiskData
- SamsungPayCard
- SamsungPayCardDetails
- SandboxValues
- SearchCriteria
- SettlementBatchSummary
- StatusEvent
- Subscription
- SubscriptionDetails
- SubscriptionStatusEvent
- ThreeDSecureInfo
- Transaction
- TransactionDetails
- TransactionLevelFeeReport
- TransactionLevelFeeReportRow
- TransactionLineItem
- UnknownPaymentMethod
- UsBankAccount
- UsBankAccountDetails
- UsBankAccountVerification
- ValidationError
- ValidationErrorCode
- ValidationErrors
- VenmoAccount
- VenmoAccountDetails
- VisaCheckoutCard
- VisaCheckoutCardDetails
- AddModificationRequest
- AddressRequest
- ApplicantDetailsAddressRequest
- ApplicantDetailsRequest
- BusinessAddressRequest
- BusinessRequest
- AClientTokenOptionsRequest
- AClientTokenRequest
- CreditCardAddressOptionsRequest
- CreditCardAddressRequest
- CreditCardOptionsRequest
- CreditCardRequest
- CreditCardVerificationBillingAddressRequest
- CreditCardVerificationCreditCardRequest
- CreditCardVerificationOptionsRequest
- CreditCardVerificationRequest
- CreditCardVerificationSearchRequest
- CustomerOptionsPayPalRequest
- CustomerOptionsPayPalShippingRequest
- CustomerOptionsRequest
- CustomerRequest
- CustomerSearchRequest
- DescriptorRequest
- DisputeSearchRequest
- DocumentUploadRequest
- FileEvidenceRequest
- FundingRequest
- IdsSearchRequest
- IndividualAddressRequest
- IndividualRequest
- IndustryRequest
- MerchantAccountCreateForCurrencyRequest
- MerchantAccountRequest
- ModificationRequest
- ModificationsRequest
- OAuthConnectUrlBusinessRequest
- OAuthConnectUrlRequest
- OAuthConnectUrlUserRequest
- OAuthCredentialsRequest
- OAuthRevokeAccessTokenRequest
- PayPalAccountOptionsRequest
- PayPalAccountRequest
- PayPalOnlyAccountRequest
- PaymentMethodAddressOptionsRequest
- PaymentMethodAddressRequest
- PaymentMethodDeleteRequest
- PaymentMethodForwardRequest
- PaymentMethodGrantRequest
- PaymentMethodGrantRevokeRequest
- PaymentMethodOptionsPayPalRequest
- PaymentMethodOptionsPayPalShippingRequest
- PaymentMethodOptionsRequest
- PaymentMethodRequest
- RiskDataCustomerRequest
- RiskDataTransactionRequest
- SEPAClientTokenRequest
- SearchRequest
- SettlementBatchSummaryRequest
- SubscriptionDescriptorRequest
- SubscriptionOptionsPayPalRequest
- SubscriptionOptionsRequest
- SubscriptionRequest
- SubscriptionSearchRequest
- SubscriptionTransactionOptionsRequest
- SubscriptionTransactionRequest
- TextEvidenceRequest
- TransactionAddressRequest
- TransactionApplePayCardRequest
- TransactionCloneRequest
- TransactionCreditCardRequest
- TransactionDescriptorRequest
- TransactionIndustryDataRequest
- TransactionIndustryRequest
- TransactionLevelFeeReportRequest
- TransactionLineItemRequest
- TransactionOptionsAmexRewardsRequest
- TransactionOptionsCloneRequest
- TransactionOptionsPayPalRequest
- TransactionOptionsRequest
- TransactionOptionsThreeDSecureRequest
- TransactionOptionsVenmoRequest
- TransactionPayPalRequest
- TransactionRefundRequest
- TransactionRequest
- TransactionSearchRequest
- TransactionThreeDSecurePassThruRequest
- TransparentRedirectRequest
- UpdateModificationRequest
- UsBankAccountVerificationConfirmRequest
- UsBankAccountVerificationSearchRequest