Last active
December 18, 2015 10:10
-
-
Save mjallday/5766475 to your computer and use it in GitHub Desktop.
Trigger KYC redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'balanced' | |
Balanced.configure(nil) | |
api_key = Balanced::ApiKey.new.save | |
secret = api_key.secret | |
Balanced.configure(secret) | |
marketplace = Balanced::Marketplace.new.save | |
card = Balanced::Card.new( | |
:card_number => "5105105105105100", | |
:expiration_month => "12", | |
:expiration_year => "2015", | |
).save | |
buyer = marketplace.create_buyer( | |
:email_address => "buyer@example.org", | |
:card_uri => card.uri | |
) | |
begin | |
buyer.promote_to_merchant( | |
:type => "person", | |
:name => "Billy Jones", | |
:street_address => "801 High St.", | |
:postal_code => "99999", | |
:country => "USA", | |
:region => 'EX', | |
:dob => "1842-01", | |
:phone_number => "+16505551234", | |
) | |
rescue Balanced::MoreInformationRequiredError => ex | |
# redirect here | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment