Hi all.
PayPalCreditCard
Author: Devil-App
Version: 1.03
Only US, UK, Canada and Australia countries merchant can apply direct credit card payment
The library IS free.
You'll get a zip file containing:
1.Documentation configuration environment Paypal ( HERE )
2.Class in attachment ( dont forget compile with ultimate Rel HttpJob + Httutils2Service )
3.Example B4A in attachment
To send the money, just click on the Donate button below.
PayPalCreditCard
Author: Devil-App
Version: 1.03
- ReturnTransactionCard
Fields:- IsInitialized As Boolean
Tests whether the object has been initialized. - currency As String
- decription As String
- id As String
- sale_id As String
- sale_state As String
- state As String
- total As String
- Initialize
Initializes the fields to their default value.
- IsInitialized As Boolean
- paypalpay
Methods:- IsInitialized As Boolean
Tests whether the object has been initialized. - Initialize (environments As String, client_id_app As String, secret_app As String) As String
You have 3 Parameters:
environment ---> value: "sandbox" for testing - "live" for production
client_id_app ---> value: CLIENT ID that you see in your Dashboard (https://developer.paypal.com/)
secret_app = ---> value: SECRET that you see in your Dashboard (https://developer.paypal.com/)
Example:
Dim environment, client_id_app, secret_app as String
environment = "sandbox"
client_id_app = "xxxx"
secret_app = "yyyyy"
Dim test As paypalpay
test.Initialize( environment, client_id_app, secret_app )
....
End Sub - PayCreditCards(type_credit_card As String, number_card As String, expire_month As String, expire_year As String, ccv As String, first_name As String, last_name As String, address As String, city As String, state As String, postal_code As String, country_code As String, total As String, currency As String, description As String, messagewait As String, Module As Object, EventName As String) As String
To Pay Directly by Credit Card:
Example:
Sub Activity_Create(FirstTime As Boolean)
Dim type_credit_card, number_card, expire_month, expire_year, ccv, first_name, last_name, address As String
Dim city, state, postal_code, country_code, total, currency, description, waitmessage as String
type_credit_card = "visa" ---> value: "visa", "mastercard", "amex", "discover"
number_card = "4417119669820331"
expire_month = "11"
expire_year = "2018"
ccv = "874"
first_name = "Betsy"
last_name = "Buyer"
address = "111 First Street"
city = "Saratoga"
state = "CA"
postal_code = "95070"
country_code = "US"
total = "13.30"
currency = "USD" ---> https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/
description = "This is the payment transaction description."
waitmessage = "Wait Transaction in Progress...."
test.PayCreditCards( type_credit_card, number_card, expire_month, expire_year, ccv, first_name, _
last_name, address, city, state, postal_code, country_code, total, currency, description, _
waitmessage, Me, "check_transaction")
End Sub
Sub check_transaction( ReturnValueCard As ReturnTransactionCard)
LogColor(ReturnValueCard.sale_state, Colors.Blue)
If ReturnValueCard.sale_state = "completed" Then
LogColor(ReturnValueCard.id, Colors.Red)
LogColor(ReturnValueCard.state, Colors.Red)
LogColor(ReturnValueCard.sale_state, Colors.Red)
LogColor(ReturnValueCard.currency, Colors.Red)
LogColor(ReturnValueCard.decription, Colors.Red)
LogColor(ReturnValueCard.total, Colors.Red)
End If
End Sub
******
- IsInitialized As Boolean
- ReturnTransactionCard
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim environment, client_id_app, secret_app As String
Dim type_credit_card, number_card, expire_month, expire_year, ccv, first_name, last_name, address As String, _
city, state, postal_code, country_code, total, currency, description, waitmessage As String
'***Initialize PayPalCreditCard Library
environment = "sandbox"
client_id_app = "xxxx"
secret_app = "xxxxx"
Dim PayTransaction As paypalpay
PayTransaction.Initialize(environment, client_id_app, secret_app)
'***Credit Card Payments
type_credit_card = "visa" ' --> value: "visa", "mastercard", "amex", "discover"
number_card = "4417119669820331"
expire_month = "11"
expire_year = "2018"
ccv = "874"
first_name = "Betsy"
last_name = "Buyer"
address = "111 First Street"
city = "Saratoga"
state = "CA"
postal_code = "95070"
country_code = "US"
total = "18.00"
currency = "USD"
description ="This is the payment transaction description."
waitmessage = "Wait Transaction in Progress...."
PayTransaction.PayCreditCards(type_credit_card, number_card, expire_month, expire_year, ccv, first_name, _
last_name, address, city, state, postal_code, country_code, total, currency, description, _
waitmessage, Me, "check_transaction")
End Sub
Sub check_transaction( ReturnValueCard As ReturnTransactionCard)
LogColor(ReturnValueCard.sale_state, Colors.Blue)
If ReturnValueCard.sale_state = "completed" Then
LogColor(ReturnValueCard.id, Colors.Red)
LogColor(ReturnValueCard.state, Colors.Red)
LogColor(ReturnValueCard.sale_state, Colors.Red)
LogColor(ReturnValueCard.currency, Colors.Red)
LogColor(ReturnValueCard.decription, Colors.Red)
LogColor(ReturnValueCard.total, Colors.Red)
End If
End Sub
Only US, UK, Canada and Australia countries merchant can apply direct credit card payment
The library IS free.
You'll get a zip file containing:
1.Documentation configuration environment Paypal ( HERE )
2.Class in attachment ( dont forget compile with ultimate Rel HttpJob + Httutils2Service )
3.Example B4A in attachment
To send the money, just click on the Donate button below.
Attachments
Last edited: