https://github.com/fixate/payu_za
PayU ZA Enterprise SOAP API integration
https://github.com/fixate/payu_za
Last synced: 2 months ago
JSON representation
PayU ZA Enterprise SOAP API integration
- Host: GitHub
- URL: https://github.com/fixate/payu_za
- Owner: fixate
- License: mit
- Created: 2015-06-23T12:39:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-24T16:07:12.000Z (almost 10 years ago)
- Last Synced: 2025-01-04T08:37:10.930Z (4 months ago)
- Language: Ruby
- Size: 116 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PayuZa
PayU ZA Enterprise SOAP API integration
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'payu_za'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install payu_za
## Usage
### Initializer
```ruby
PayUZa.configure do |c|
c.soap_username = ENV['PAYU_SOAP_USERNAME']
c.soap_password = ENV['PAYU_SOAP_PASSWORD']
c.safe_key = ENV['PAYU_SAFE_KEY']
# Be sure to set your environment to :production in prod - defaults to :staging
c.environment = :production # or :staging or Rails.env.to_sym# Other configuration
# Set the default api version (can be overriden per request)
# c.api_version = "ONE_ZERO"
#
# Set password_digest to true to prevent your password being sent in clear text
# Defaults to false because not sure if PayU supports wsse password digest
# c.password_digest = true
#
# Set your own wsdls - not sure why anyone would ever need this
# c.wsdl_endpoints = {
# development: 'https://localhost:12345/?wsdl',
# production: 'https://my-proxy.com/wsdl'
# }
end
```### DoTransaction Example
```ruby
client = PayUZa::Client.newadditional_info = client.new_struct(:additional_information, {
merchantReference: '12345',
payUReference: 'abcdefg1234'
})transaction = client.new_struct(:do_transaction, {
TransactionType: PayUZa::Structs::TRANSACTION_TYPE::PAYMENT,
AuthenticationType: PayUZa::Structs::AUTHENTICATION_TYPE::NA,
AdditionalInformation: additional_info
# etc ...
})# Object style
creditcard = client.new_struct(:credit_card)
creditcard.cardNumber = '4242424242424242'
creditcard.cardExpiry = '122013'transaction.Creditcard = creditcard
response = client.execute(transaction)
# or you can pass in a hash
response = client.execute(:do_transaction, {
Api: 'ONE_ZERO',
SafeKey: '12345'
# ...
})```
Supports `do_transaction`, `set_transaction` and `get_transaction`
## Contributing
1. Fork it ( https://github.com/fixate/payu_za/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request