Skip to content

Commit

Permalink
Merge pull request #391 from stripe/ob-fix-convert
Browse files Browse the repository at this point in the history
Alphabetize list and add missing objects
  • Loading branch information
ob-stripe authored Nov 28, 2017
2 parents 8b6855c + 112d09b commit deafdc5
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions lib/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,33 @@ public static function convertStripeObjectToArray($values)
public static function convertToStripeObject($resp, $opts)
{
$types = array(
// data structures
'list' => 'Stripe\\Collection',

// business objects
'account' => 'Stripe\\Account',
'alipay_account' => 'Stripe\\AlipayAccount',
'apple_pay_domain' => 'Stripe\\ApplePayDomain',
'bank_account' => 'Stripe\\BankAccount',
'application_fee' => 'Stripe\\ApplicationFee',
'balance' => 'Stripe\\Balance',
'balance_transaction' => 'Stripe\\BalanceTransaction',
'bank_account' => 'Stripe\\BankAccount',
'bitcoin_receiver' => 'Stripe\\BitcoinReceiver',
'bitcoin_transaction' => 'Stripe\\BitcoinTransaction',
'card' => 'Stripe\\Card',
'charge' => 'Stripe\\Charge',
'country_spec' => 'Stripe\\CountrySpec',
'coupon' => 'Stripe\\Coupon',
'customer' => 'Stripe\\Customer',
'dispute' => 'Stripe\\Dispute',
'ephemeral_key' => 'Stripe\\EphemeralKey',
'event' => 'Stripe\\Event',
'exchange_rate' => 'Stripe\\ExchangeRate',
'list' => 'Stripe\\Collection',
'login_link' => 'Stripe\\LoginLink',
'fee_refund' => 'Stripe\\ApplicationFeeRefund',
'file_upload' => 'Stripe\\FileUpload',
'invoice' => 'Stripe\\Invoice',
'invoiceitem' => 'Stripe\\InvoiceItem',
'event' => 'Stripe\\Event',
'file_upload' => 'Stripe\\FileUpload',
'token' => 'Stripe\\Token',
'transfer' => 'Stripe\\Transfer',
'transfer_reversal' => 'Stripe\\TransferReversal',
'login_link' => 'Stripe\\LoginLink',
'order' => 'Stripe\\Order',
'order_return' => 'Stripe\\OrderReturn',
'payout' => 'Stripe\\Payout',
Expand All @@ -101,9 +106,9 @@ public static function convertToStripeObject($resp, $opts)
'subscription' => 'Stripe\\Subscription',
'subscription_item' => 'Stripe\\SubscriptionItem',
'three_d_secure' => 'Stripe\\ThreeDSecure',
'fee_refund' => 'Stripe\\ApplicationFeeRefund',
'bitcoin_receiver' => 'Stripe\\BitcoinReceiver',
'bitcoin_transaction' => 'Stripe\\BitcoinTransaction',
'token' => 'Stripe\\Token',
'transfer' => 'Stripe\\Transfer',
'transfer_reversal' => 'Stripe\\TransferReversal',
);
if (self::isList($resp)) {
$mapped = array();
Expand Down

0 comments on commit deafdc5

Please sign in to comment.